git-subtree-dir: aiui git-subtree-mainline:0c4826f8ccgit-subtree-split:e30ac1d106
3.5 KiB
3.5 KiB
Plan: Code Mode UI — Orange Input, Design System Context, File Browser Context
Context
The user wants three connected features that enhance the coding experience in AIUI:
- Visual indication when in code mode (orange input container, "Code" label)
- Ability to select design system items as coding context
- Ability to select files from file browser as coding context
After this, the user wants to circle back and create a flawless version of content extraction/tab surfacing.
Changes
1. Orange Code Mode Input Container
Files: ChatWindow.vue, ChatInput.vue
ChatWindow.vue (line 106-115):
- Pass
activeTabto ChatInput as a prop::active-tab="activeTab" - Change placeholder logic:
activeTab === 'code' ? 'Code...' : isStreaming ? 'Waiting for response...' : 'Message AIUI...'
ChatInput.vue:
- Add
activeTabprop (optional string, default'') - Conditionally style the container div (line 79-81):
- When
activeTab === 'code': usebg-accent/15 border border-accent/25 backdrop-blur-xlinstead ofpath-glass-bubble - Keep the
rounded-2xl px-4 py-3 flex items-end gap-2 transition-all duration-300classes
- When
- Conditionally style the send button orange when in code mode
2. Design System Item Selection for Coding Context
Files: useCodeContext.ts, DesignSystemGrid.vue
useCodeContext.ts:
- Add
selectedDesignTokens: ref<string[]>([])to module state (stores item IDs) - Add
toggleDesignToken(id)— adds/removes from selection array - Add
clearDesignTokens()— clears selection - Add
isDesignTokenSelected(id)— checks if item is in selection - Clear on
exitCodeMode() - Export all new state/actions
DesignSystemGrid.vue:
- Import
useCodeContext - When
codeModeis true, show a selection indicator (accent ring + checkmark) on items selectItemshould calltoggleDesignToken(item.id)when in code mode (instead ofopenDesignSystemItem)- When NOT in code mode, keep existing behavior (open detail view)
- Selected items get
ring-2 ring-accent/50 bg-accent/10styling
3. File Browser Selection for Coding Context
Files: useCodeContext.ts, ProjectGrid.vue
useCodeContext.ts:
- Add
selectedFiles: ref<string[]>([])— paths of files selected for context - Add
toggleFileSelection(path)— adds/removes from selection - Add
clearFileSelection()— clears all - Add
isFileSelected(path)— checks if file in selection - Clear on
exitCodeMode() - Export new state/actions
ProjectGrid.vue:
- Import
useCodeContext - When
codeModeis true, file clicks toggle selection instead of (or in addition to) opening - Show visual selection state (accent highlight/checkmark) on selected files in FileTreeNode
Files to Modify
packages/app/src/components/chat/ChatWindow.vue— pass activeTab proppackages/app/src/components/chat/ChatInput.vue— conditional orange styling + "Code" placeholderpackages/app/src/composables/useCodeContext.ts— add design token + file selection statepackages/app/src/components/content/DesignSystemGrid.vue— toggle selection in code modepackages/app/src/components/content/ProjectGrid.vue— toggle file selection in code mode
Verification
pnpm typecheck— no type errorspnpm lint— no new lint errors- Manual:
/codecommand → input turns orange with "Code..." placeholder - Manual: In code mode, design system tab → clicking items toggles selection (accent ring)
- Manual: In code mode, file browser → clicking files toggles selection
- Manual: Exiting code mode clears all selections