Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 18 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,24 @@ Frontend calls go through `app/src/services/rest.ts`, which sends typed bridge m

The desktop host uses WebView2/Edge Chromium. Modern CSS is available in the app runtime, so prefer clear, current CSS such as flex/grid gaps, `min()`/`max()`/`clamp()`, logical properties, and modern selectors where they make the UI simpler.

Keep ConverseTek-specific layout, colour, spacing, and component polish in ordinary CSS/PostCSS files under `app/src/css/` and component-local CSS files. Do not migrate local app styling into CSS-in-JS, broad `theme.useToken()` rewrites, or large `ConfigProvider` component-token blocks.

For AntD 6, use `ConfigProvider` `theme` for true app-wide design intent: enable `cssVar`, set stable global primitives such as `colorPrimary` and `borderRadius`, and use algorithms or motion settings only when they should affect the whole application. Treat AntD 6 as a CSS-variable system, not a reason to replace the app's CSS architecture.

Use AntD component tokens only when the value should apply to every instance of that component across ConverseTek. Avoid using a global component token block to fix one local surface, for example styling the header menu through `theme.components.Menu`; that can unintentionally restyle unrelated dropdowns, trees, or menus.

For local AntD compatibility styling, prefer scoped CSS variable overrides on app-owned wrappers, for example `.header .ant-menu-horizontal { --ant-menu-item-color: #fff; }`. Use AntD semantic hooks such as `classNames`, `styles`, and popup class hooks where available to attach those scopes to dropdowns, popovers, modals, and other portalled UI. Header menus, submenu popups, and other contextual surfaces should normally be restored with local CSS variables/classes rather than global theme component tokens.

Avoid broad `.ant-*` selector overrides and `!important` unless a local, documented fallback is necessary. If an AntD selector must be targeted, keep it scoped to an app-owned wrapper and revisit it during AntD upgrades.

Do not reintroduce AntD Less variable assumptions, `babel-plugin-import`, or `antd/dist/antd.css`. Import `antd/dist/reset.css` and keep normal CSS as the styling source of truth.

Before larger AntD styling changes, check the official docs:

- AntD theme customisation: `https://ant.design/docs/react/customize-theme/`
- AntD style compatibility and override priority: `https://ant.design/docs/react/compatible-style/`
- AntD 6 CSS variable direction: `https://ant.design/docs/blog/css-tricks/`

## Frontend Workflow

The frontend uses Vite. Use `CT: Fast Dev` for the normal hot reload workflow; it starts or reuses the Vite server, then starts the WebView2 desktop shell with `CT_WEB_URL=http://127.0.0.1:5173/` so the backend bridge remains available. Keep `CT: UI Build` for static builds into `dist/` and the debug output folder.
Expand Down
9 changes: 4 additions & 5 deletions Services/AiProviderService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public AiDraftRunResult RunDraft(AiDraftProviderRequest providerRequest) {
File.WriteAllText(result.StderrPath, "", Encoding.UTF8);

try {
Process process = CreateCodexProcess(providerRequest.Settings, result.OutputPath, commandPath);
Process process = CreateCodexProcess(providerRequest.Settings, result.PromptPath, result.OutputPath, commandPath);
StringBuilder stdoutBuilder = new StringBuilder();
StringBuilder stderrBuilder = new StringBuilder();
process.OutputDataReceived += (sender, args) => {
Expand All @@ -286,8 +286,6 @@ public AiDraftRunResult RunDraft(AiDraftProviderRequest providerRequest) {
process.Start();
process.BeginOutputReadLine();
process.BeginErrorReadLine();
process.StandardInput.Write(prompt);
process.StandardInput.Close();

bool exited = process.WaitForExit(providerRequest.Settings.TimeoutSeconds * 1000);

Expand Down Expand Up @@ -326,7 +324,7 @@ public AiDraftRunResult RunDraft(AiDraftProviderRequest providerRequest) {
}
}

private Process CreateCodexProcess(AiSettings settings, string outputPath, string commandPath) {
private Process CreateCodexProcess(AiSettings settings, string promptPath, string outputPath, string commandPath) {
string codexCommand = FindCodexCommand(settings);
string schemaPath = Path.Combine(BASE_DIRECTORY, "config", "ai-draft-output.schema.json");
if (!File.Exists(schemaPath)) {
Expand All @@ -350,6 +348,7 @@ private Process CreateCodexProcess(AiSettings settings, string outputPath, strin
command.Append(" --output-schema ").Append(QuoteForCmd(schemaPath));
command.Append(" --output-last-message ").Append(QuoteForCmd(outputPath));
command.Append(" -");
command.Append(" < ").Append(QuoteForCmd(promptPath));

File.WriteAllText(commandPath, command.ToString(), Encoding.UTF8);

Expand All @@ -358,7 +357,7 @@ private Process CreateCodexProcess(AiSettings settings, string outputPath, strin
startInfo.Arguments = "/d /s /c \"" + command + "\"";
startInfo.WorkingDirectory = BASE_DIRECTORY;
startInfo.UseShellExecute = false;
startInfo.RedirectStandardInput = true;
startInfo.RedirectStandardInput = false;
startInfo.RedirectStandardOutput = true;
startInfo.RedirectStandardError = true;
startInfo.CreateNoWindow = true;
Expand Down
7 changes: 0 additions & 7 deletions app/.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,6 @@
"legacy": true
}
],
[
"import",
{
"libraryName": "antd",
"style": true
}
],
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
["@babel/plugin-proposal-class-properties", { "loose": false }],
Expand Down
Loading
Loading