2.7 KiB
2.7 KiB
User Request: Wire Power Features & Clean UI
The goal is to finalize the implementation of "Power Features" and "Clean UI" by wiring existing components into the main TUI (bin/opencode-ink.mjs) and creating the missing Fuzzy Finder.
User Review Required
Note
This plan modifies the core
opencode-ink.mjsfile. It introduces a newFuzzyFindercomponent and updates the Sidebar and Chat rendering.
Proposed Changes
1. New Component: Fuzzy File Finder
File: bin/ui/components/FuzzyFinder.mjs [NEW]
- Create a fuzzy file finder overlay.
- Uses
globor recursive scan to get file list. - Filters list based on user input.
- Displays results with
ink-select-input.
2. Sidebar Integration: Todo List
File: bin/opencode-ink.mjs
- Import
CleanTodoListfrom./ui/components/CleanTodoList.mjs. - Import
scanTodosfrom../lib/todo-scanner.mjs. - Add state:
const [todos, setTodos] = useState([]). - Add effect: Run
scanTodoson startup and file changes. - Pass
todosprop toPremiumSidebar.
File: bin/ui/components/PremiumSidebar.mjs
- Accept
todosprop. - Render
CleanTodoListin a new section (or replace Shortcuts if crowded, or collapsible).
3. Chat UI Clean-up: ChatBubble
File: bin/opencode-ink.mjs
- Import
ChatBubblefrom./ui/components/ChatBubble.mjs. - Update
ViewportMessage(internal component) orScrollableChatto renderChatBubbleinstead of rawBox/Text. - logic to route
systemmessages throughChatBubblewithrole="system".
4. Theme Switcher
File: bin/opencode-ink.mjs
- Convert
themeconstant to state:const [activeTheme, setActiveTheme] = useState(THEMES.dracula). - Add
/themecommand toshowCommandPaletteor command processor to allow switching. - Ensure
activeThemeis passed to components that need it (or they import it - might need refactoring if they import statictheme).- Note:
tui-theme.mjsexports a statictheme. We might need to implement a Context or pass theme props. For now, we will use a simple state and pass it where possible, or update the global ifinkallows (unlikely pure global). - Strategy: We will pass
themeas prop toPremiumSidebar,ChatBubble, etc.
- Note:
Verification Plan
Automated Tests
- None currently available for TUI visual regression.
Manual Verification
- Fuzzy Finder: Press
Ctrl+P(or typed command/find). Typeserver. Verifyserver.jsis found. - Todo List: Check Sidebar for "Tasks" section. Verify it shows TODOs from project files.
- Chat UI: Send a message "hello". Verify user message is right-aligned/styled. Response is left-aligned with clean gutter.
- Themes: Type
/theme monokai. Verify Sidebar colors change.