Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
0bfde52
wip(integrations): add service for the api.
MarcMcIntosh Nov 6, 2024
81c8b6d
fix(integrations): add _ to unused function argument.
MarcMcIntosh Nov 6, 2024
281568d
wip(integrations): add enabled feild.
MarcMcIntosh Nov 6, 2024
777d4a0
chore(types): update integration fixture
MarcMcIntosh Nov 6, 2024
e8bd52f
Merge branch 'alpha' into integrations-api
MarcMcIntosh Nov 6, 2024
af79cde
wip: integrations page layout + data retrieval
alashchev17 Nov 6, 2024
780268b
wip: conditional rendering of form and cards & JSON schema parsing in…
alashchev17 Nov 7, 2024
a8abf89
wip: customized form & updating data
alashchev17 Nov 10, 2024
18e1383
wip: icon in title & overall enhancements
alashchev17 Nov 12, 2024
1b8838a
wip: renamed buttons
alashchev17 Nov 12, 2024
6606f83
Merge branch 'alpha' into integrations-api
MarcMcIntosh Nov 18, 2024
e45d3dd
wip(integration api): update response types.
MarcMcIntosh Nov 18, 2024
ffb8c21
Merge remote-tracking branch 'origin/integrations-api-self-configure'…
alashchev17 Nov 18, 2024
be2e6a2
wip: ajv & rjsf libraries removal
alashchev17 Nov 18, 2024
86238ee
wip(intergrations api): add save handler.
MarcMcIntosh Nov 18, 2024
a62056e
Merge branch 'integrations-api-self-configure' into feat/setup-integr…
alashchev17 Nov 18, 2024
04568e8
fix(integrations): typo in types
MarcMcIntosh Nov 18, 2024
308c944
wip: fixing endpoints & new hooks for data fetching
alashchev17 Nov 18, 2024
8a3f592
fix(integrations): typos.
MarcMcIntosh Nov 18, 2024
d28f00f
fix: type guards conditions
alashchev17 Nov 19, 2024
d027e8c
wip(integrations UI): grouping integrations on global, project specific
alashchev17 Nov 19, 2024
89524ed
wip(integrations): schema parsing & refactoring
alashchev17 Nov 20, 2024
2647fc9
wip: rendering values & LSP responses handling
alashchev17 Nov 21, 2024
3bfaf7c
Wip smart links button (#206)
MarcMcIntosh Nov 21, 2024
9920261
wip: smartlinks within fields & return to integraitons page from chat
alashchev17 Nov 21, 2024
f0ac48a
wip(integrations): availability
alashchev17 Nov 22, 2024
8176ab9
wip: return button alignment
alashchev17 Nov 22, 2024
a660bbd
Merge branch 'alpha' into integrations-api-self-configure
alashchev17 Nov 22, 2024
9ea4cb5
Merge branch 'alpha' into integrations-api-self-configure
alashchev17 Nov 22, 2024
e05442a
Merge branch 'integrations-api-self-configure' into feat/setup-integr…
alashchev17 Nov 22, 2024
d987924
wip: form disabled if values didn't change
alashchev17 Nov 22, 2024
c8c7190
wip: better UI & cancel values of form
alashchev17 Nov 25, 2024
e7c35e0
wip(configuration chat): handle going back.
MarcMcIntosh Nov 25, 2024
7a1d62b
wip: header for integrations & better layout & availability
alashchev17 Nov 25, 2024
d44f2ed
Merge branch 'feat/setup-integrations' into refactor/integration-chat
MarcMcIntosh Nov 26, 2024
221dc27
fix(integration chat): change tools setting to explore.
MarcMcIntosh Nov 26, 2024
3c9dee9
chore(missing deps in hook): `renderField` function was missing deps.
MarcMcIntosh Nov 26, 2024
b9fb138
feat(integration data cache): add slice for integrations cache.
MarcMcIntosh Nov 26, 2024
bcf2eac
fix(integration cache): remove item on save.
MarcMcIntosh Nov 26, 2024
ec026bd
wip: field.f_type -> [f_type, f_size]
alashchev17 Nov 26, 2024
cee5d13
fix(config chat): chat being sent multiple times.
MarcMcIntosh Nov 27, 2024
ad2395e
wip(tool confirmation): skip confirming tool use when running a confi…
MarcMcIntosh Nov 27, 2024
e2bce83
feat: add apply all button to configuration chat.
MarcMcIntosh Nov 27, 2024
998e655
feat: reload old configuration chat and go back to the form
MarcMcIntosh Nov 28, 2024
ed2c3ae
feat(configuration chat): add error message handler.
MarcMcIntosh Nov 28, 2024
44b53c3
chore: set up storybook.
MarcMcIntosh Nov 28, 2024
cd356d1
wip: form cancel removed & smartlinks on the right side of form buttons
alashchev17 Nov 28, 2024
857da33
WIP: Refactor/integration chat (#209)
MarcMcIntosh Nov 28, 2024
1022484
wip(configuration changes): detect if config value has changed from t…
MarcMcIntosh Nov 28, 2024
d299b03
wip(configuration): animate changes
MarcMcIntosh Nov 28, 2024
f7427f5
wip: add faders for chat.
MarcMcIntosh Nov 29, 2024
141e695
fix(config chat): reuse last model and system prompt
MarcMcIntosh Nov 29, 2024
8b563be
feat(configuration): add fading text field.
MarcMcIntosh Nov 29, 2024
230a396
fix: conditionally fade if fadeValue is provided.
MarcMcIntosh Nov 29, 2024
b6933e6
feat(configuration) add animated text area.
MarcMcIntosh Nov 29, 2024
e3513df
fix(animated inputs): the main input doesn't need absolute positioning.
MarcMcIntosh Nov 29, 2024
97115f2
Merge branch 'feat/setup-integrations' into feat/integration-changed-…
MarcMcIntosh Nov 29, 2024
d98d2d9
chore(integration form): update story.
MarcMcIntosh Nov 29, 2024
1e88d86
chore(configuration animation): remove old attempt at animating.
MarcMcIntosh Nov 29, 2024
d718260
Feature: Docker Containers API (#210)
alashchev17 Dec 3, 2024
f830129
Merge branch 'feat/setup-integrations' into feat/integration-changed-…
MarcMcIntosh Dec 3, 2024
46fed0f
refactor(fixtures): update integration fixtures.
MarcMcIntosh Dec 3, 2024
b2cbb2f
Merge branch 'alpha' into feat/integration-changed-values-display
MarcMcIntosh Dec 5, 2024
200d42e
fix(IntegrationFormProps): export the form prop for use in story book.
MarcMcIntosh Dec 5, 2024
16820b9
wip(animated inputs): add files for checkbox and switch.
MarcMcIntosh Dec 5, 2024
0430805
Merge branch 'alpha' into feat/integration-changed-values-display
MarcMcIntosh Dec 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/__fixtures__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ export * from "./context_files";
export * from "./prompts";
export * from "./integrations";
export * from "./survey_questions";
export * from "./integration";
export * from "./chat_links_response";
export * from "./chat_config_thread";
110 changes: 110 additions & 0 deletions src/__fixtures__/integration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import { Integration } from "../services/refact/integrations";

export const INTEGRATION_GET_RESPONSE: Integration = {
project_path: "",
integr_name: "postgres",
integr_config_path: "/Users/marc/.config/refact/integrations.d/postgres.yaml",
integr_schema: {
fields: {
host: {
f_type: "string_long",
f_desc:
"Connect to this host, for example 127.0.0.1 or docker container name.",
f_placeholder: "marketing_db_container",
},
port: {
f_type: "string_short",
f_desc: "Which port to use.",
f_default: "5432",
},
user: {
f_type: "string_short",
f_placeholder: "john_doe",
},
password: {
f_type: "string_short",
f_default: "$POSTGRES_PASSWORD",
smartlinks: [
{
sl_label: "Open passwords.yaml",
sl_goto: "EDITOR:passwords.yaml",
},
],
},
database: {
f_type: "string_short",
f_placeholder: "marketing_db",
},
psql_binary_path: {
f_type: "string_long",
f_desc:
"If it can't find a path to `psql` you can provide it here, leave blank if not sure.",
f_placeholder: "psql",
},
},
available: {
on_your_laptop_possible: true,
when_isolated_possible: true,
},
smartlinks: [
{
sl_label: "Test",
sl_chat: [
{
role: "user",
content:
"🔧 The postgres tool should be visible now. To test the tool, list the tables available, briefly desctibe the tables and express\nsatisfaction and relief if it works, and change nothing. If it doesn't work or the tool isn't available, go through the usual plan in the system prompt.\nThe current config file is %CURRENT_CONFIG%.\n",
},
],
},
],
docker: {
filter_label: "",
filter_image: "postgres",
new_container_default: {
image: "postgres:13",
environment: {
POSTGRES_DB: "marketing_db",
POSTGRES_USER: "john_doe",
POSTGRES_PASSWORD: "$POSTGRES_PASSWORD",
},
},
smartlinks: [
{
sl_label: "Add Database Container",
sl_chat: [
{
role: "user",
content:
"🔧 Your job is to create a postgres container, using the image and environment from new_container_default section in the current config file: %CURRENT_CONFIG%. Follow the system prompt.\n",
},
],
},
],
// "smartlinks_for_each_container": [
// {
// "sl_label": "Use for integration",
// "sl_chat": [
// {
// "role": "user",
// "content": "🔧 Your job is to modify postgres connection config in the current file to match the variables from the container, use docker tool to inspect the container if needed. Current config file: %CURRENT_CONFIG%.\n"
// }
// ]
// }
// ]
},
},
integr_values: {
psql_binary_path: "/usr/bin/psql",
host: "localhost",
port: "5432",
user: "postgres",
password: "$POSTGRES_PASSWORD",
database: "test_db",
available: {
on_your_laptop: true,
when_isolated: false,
},
},
error_log: [],
};
6 changes: 6 additions & 0 deletions src/components/AnimatedInputs/AnimatedCheckbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from "react";

export const AnimatedCheckbox: React.FC = () => {
// TODO: Implement AnimatedCheckbox
return <div />;
};
30 changes: 30 additions & 0 deletions src/components/AnimatedInputs/AnimatedInputs.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
.fade_input {
/* position: absolute;
top: 0;
left: 0; */
width: 100%;
}

.fade_input_in {
opacity: 1;
animation: 2s linear 1 normal none running fade-opacity;
}

.fade_input_out {
position: absolute;
top: 0;
left: 0;
z-index: -1;
opacity: 0;
animation: 2s linear 1 reverse none running fade-opacity;
box-shadow: inset 0 0 0 var(--text-field-border-width) var(--green-a7);
}

@keyframes fade-opacity {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
6 changes: 6 additions & 0 deletions src/components/AnimatedInputs/AnimatedSwitch.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import React from "react";

export const AnimatedSwitch: React.FC = () => {
// TODO: Implement the AnimagedSwitch component
return <div />;
};
29 changes: 29 additions & 0 deletions src/components/AnimatedInputs/AnimatedTextArea.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { Meta, StoryObj } from "@storybook/react";
import { AnimatedTextArea } from "./AnimatedTextArea";
import { Theme, Container } from "@radix-ui/themes";

const meta = {
title: "Components/AnimatedInputs/AnimatedTextArea",
component: AnimatedTextArea,
decorators: [
(Story) => (
<Theme>
<Container p="8">
<Story />
</Container>
</Theme>
),
],
} satisfies Meta<typeof AnimatedTextArea>;

export default meta;

type Story = StoryObj<typeof AnimatedTextArea>;

export const Default: Story = {
args: {
defaultValue: "World",
fadeValue: "Hello",
name: "test",
},
};
64 changes: 64 additions & 0 deletions src/components/AnimatedInputs/AnimatedTextArea.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import React from "react";
import { Box, TextArea, TextAreaProps } from "@radix-ui/themes";
import classNames from "classnames";
import styles from "./AnimatedInputs.module.css";

export type AnimatedTextAreaProps = TextAreaProps & {
fadeValue?: TextAreaProps["value"];
};

function getFadeProps(
props: AnimatedTextAreaProps,
): Omit<TextAreaProps, "onChange" | "name"> {
const {
onChange: _onChange,
value: _value,
// defaultValue,
name: _name,
fadeValue,
...rest
} = props;

return { ...rest, defaultValue: fadeValue };
}

function getInputProps(
props: AnimatedTextAreaProps,
): Omit<TextAreaProps, "fadeValue"> {
const { fadeValue: _fadeValue, ...rest } = props;
return rest;
}

export const AnimatedTextArea: React.FC<AnimatedTextAreaProps> = (props) => {
const fadeProps = getFadeProps(props);
const inputProps = getInputProps(props);

const shouldFade = props.fadeValue ?? false;

if (!shouldFade) {
return <TextArea {...inputProps} className={props.className} />;
}

return (
<Box position="relative">
<TextArea
{...fadeProps}
className={classNames(
styles.fade_input,
styles.fade_input_out,
props.className,
)}
hidden={true}
/>

<TextArea
{...inputProps}
className={classNames(
styles.fade_input,
styles.fade_input_in,
props.className,
)}
/>
</Box>
);
};
63 changes: 63 additions & 0 deletions src/components/AnimatedInputs/AnimatedTextField.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import React from "react";
import { Box, TextField } from "@radix-ui/themes";
import classNames from "classnames";
import styles from "./AnimatedInputs.module.css";

export type AnimatedTextFieldProps = TextField.RootProps & {
fadeValue?: TextField.RootProps["value"];
};

function getFadeProps(
props: AnimatedTextFieldProps,
): Omit<TextField.RootProps, "onChange" | "name"> {
const {
onChange: _onChange,
value: _value,
// defaultValue,
name: _name,
fadeValue,
...rest
} = props;

return { ...rest, defaultValue: fadeValue };
}

function getInputProps(
props: AnimatedTextFieldProps,
): Omit<TextField.RootProps, "fadeValue"> {
const { fadeValue: _fadeValue, ...rest } = props;
return rest;
}

export const AnimatedTextField: React.FC<AnimatedTextFieldProps> = (props) => {
const fadeProps = getFadeProps(props);
const inputProps = getInputProps(props);

const shouldFade = props.fadeValue ?? false;

if (!shouldFade) {
return <TextField.Root {...inputProps} className={props.className} />;
}

return (
<Box position="relative">
<TextField.Root
{...fadeProps}
className={classNames(
styles.fade_input,
styles.fade_input_out,
props.className,
)}
hidden={true}
/>
<TextField.Root
{...inputProps}
className={classNames(
styles.fade_input,
styles.fade_input_in,
props.className,
)}
/>
</Box>
);
};
29 changes: 29 additions & 0 deletions src/components/AnimatedInputs/AnimatedTextFiled.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { Meta, StoryObj } from "@storybook/react";
import { AnimatedTextField } from "./AnimatedTextField";
import { Theme, Container } from "@radix-ui/themes";

const meta = {
title: "Components/AnimatedInputs/AnimatedTextField",
component: AnimatedTextField,
decorators: [
(Story) => (
<Theme>
<Container p="8">
<Story />
</Container>
</Theme>
),
],
} satisfies Meta<typeof AnimatedTextField>;

export default meta;

type Story = StoryObj<typeof AnimatedTextField>;

export const Default: Story = {
args: {
defaultValue: "World",
fadeValue: "Hello",
name: "test",
},
};
2 changes: 2 additions & 0 deletions src/components/AnimatedInputs/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./AnimatedTextField";
export * from "./AnimatedTextArea";
Loading
Loading