Repository navigation
Custom instructions - #233
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a custom instruction presets feature to the chat interface, allowing users to create, edit, select, and delete named instructions that are appended to the system prompt. It implements the CustomInstructionsDialog component, updates ChatPromptFactoryService to manage and persist the preset state in local storage, integrates the custom instructions link into the ChatPanel, and adds comprehensive unit, integration, and end-to-end tests. As there are no review comments provided, I have no feedback to offer on the changes.
⚡ A2UI Composer PR PreviewYour automated preview is successfully live (commit
|
16f26fc to
e5bc08c
Compare
suyangw-g
left a comment
There was a problem hiding this comment.
LGTM! Both P1 findings (onOptionChange edit/draft preservation across dropdown switches and .instructions-textarea responsive width) are cleanly resolved in e5bc08c. Leaving one non-blocking UX note on deletePreset().
| protected deletePreset(): void { | ||
| const idToDelete = this.selectedOption(); | ||
| this.presets.update(list => list.filter(p => p.id !== idToDelete)); | ||
| this.selectedOption.set(NONE_OPTION); | ||
| this.presetName.set(''); | ||
| this.instructionsContent.set(''); | ||
| } |
There was a problem hiding this comment.
[P2 — Minor UX Note] deletePreset() remains buffered in this.presets until Save is clicked (as codified in the new discards preset deletion when dialog is cancelled spec), while immediately switching the view to None (Off) ("Custom instructions are turned off..."). Because clicking a trash icon next to a preset looks like an immediate action, users who delete a preset and close the dialog via Cancel / Escape / backdrop may be surprised that the deleted preset reappears on next open. Non-blocking for this PR.
Support configuring, selecting, and persisting custom instructions presets in local storage. - Add CustomInstructionsDialog for managing and creating presets. - Inject active custom instructions into Gemini chat prompts via ChatPromptFactoryService. - Persist presets across session resets in ComposerShell. - Update ChatPanel and ChatCoordinator with custom instructions state.
Inject ChatPromptFactoryService directly into ChatPanel for custom instructions state and active preset management, removing redundant pass-through properties and methods from ChatCoordinator. Move ChatCoordinator.systemPrompt to the top of the class alongside other readonly properties. Declare custom instruction models using export declare interface in ChatPromptFactoryService.
Set dialog width to 600px and configure textarea dimensions to match SystemInstructionsDialog layout, avoiding shrink-to-fit collapse. Add Playwright bounding box assertion.
Sync preset name and instruction content directly into the working presets array on edit, and preserve draft preset state when toggling between dropdown options to prevent silent data loss before save. Update custom instructions textarea to width: 100% and min-width: 0 to prevent horizontal overflow on narrow viewports. Add unit tests covering edit and draft preservation across options.
e5bc08c to
1bd6761
Compare
…derer The catalog-aware system prompt now ends with main's custom instructions (a2ui-project#233), the Assistant panel takes main's width settings (a2ui-project#231), and the README drops the removed MCP sample while keeping the Slack sample.
Description
Add custom instructions support with named presets
Support configuring, selecting, and persisting custom instructions presets in local storage.
Pre-launch Checklist