Click to edit UI (#385)

- [x] add e2e test - happy case (make sure it clears selection and next
prompt is empty, and preview is cleared); de-selection case
- [x] shim - old & new file
- [x] upgrade path
- [x] add docs
- [x] add try-catch to parser script
- [x] make it work for next.js
- [x] extract npm package
- [x] make sure plugin doesn't apply in prod
This commit is contained in:
Will Chen
2025-06-11 13:05:27 -07:00
committed by GitHub
parent b86738f3ab
commit c1aa6803ce
79 changed files with 12896 additions and 113 deletions

View File

@@ -33,6 +33,8 @@ import type {
UserBudgetInfo,
CopyAppParams,
App,
ComponentSelection,
AppUpgrade,
} from "./ipc_types";
import type { AppChatContext, ProposalResult } from "@/lib/schemas";
import { showError } from "@/lib/toast";
@@ -224,6 +226,7 @@ export class IpcClient {
public streamMessage(
prompt: string,
options: {
selectedComponent: ComponentSelection | null;
chatId: number;
redo?: boolean;
attachments?: File[];
@@ -232,7 +235,15 @@ export class IpcClient {
onError: (error: string) => void;
},
): void {
const { chatId, redo, attachments, onUpdate, onEnd, onError } = options;
const {
chatId,
redo,
attachments,
selectedComponent,
onUpdate,
onEnd,
onError,
} = options;
this.chatStreams.set(chatId, { onUpdate, onEnd, onError });
// Handle file attachments if provided
@@ -264,6 +275,7 @@ export class IpcClient {
prompt,
chatId,
redo,
selectedComponent,
attachments: fileDataArray,
})
.catch((err) => {
@@ -284,6 +296,7 @@ export class IpcClient {
prompt,
chatId,
redo,
selectedComponent,
})
.catch((err) => {
showError(err);
@@ -859,6 +872,19 @@ export class IpcClient {
appId: number;
chatContext: AppChatContext;
}): Promise<void> {
return this.ipcRenderer.invoke("set-context-paths", params);
await this.ipcRenderer.invoke("set-context-paths", params);
}
public async getAppUpgrades(params: {
appId: number;
}): Promise<AppUpgrade[]> {
return this.ipcRenderer.invoke("get-app-upgrades", params);
}
public async executeAppUpgrade(params: {
appId: number;
upgradeId: string;
}): Promise<void> {
return this.ipcRenderer.invoke("execute-app-upgrade", params);
}
}