1181 Commits

Author SHA1 Message Date
Shantur Rathore
00fc462c8f Add placeholder text for long paste attachments in prompt
- Insert [pasted #N] at cursor position when pasting
- Remove placeholder when attachment chip is deleted
- Maintains cursor position after paste
- User can see where paste was inserted in text flow
2025-10-24 01:21:57 +01:00
Shantur Rathore
83fa3d2dc4 Mark task 022 as complete 2025-10-24 01:19:10 +01:00
Shantur Rathore
7138fb4e23 Implement long paste handling with text attachments
- Detect pastes >150 chars or >3 lines
- Convert long pastes to text attachments
- Show clipboard icon for text attachments
- Display summary (e.g., 'pasted #1 (10 lines)')
- Auto-increment paste counter
- Reset counter on message send
- Short pastes insert normally
2025-10-24 01:19:00 +01:00
Shantur Rathore
d2620dd3c3 Fix empty query file search to fetch all files instead of using space 2025-10-24 01:09:57 +01:00
Shantur Rathore
68503c2511 Fix no matching files on empty query by awaiting git files first 2025-10-24 01:08:30 +01:00
Shantur Rathore
f3a7c9757d Improve attachment chip design with file icons and better styling 2025-10-24 01:05:46 +01:00
Shantur Rathore
4d468e278f Add visual attachment chips and fix empty query file search 2025-10-24 01:00:01 +01:00
Shantur Rathore
79fe1c4b7b Convert file paths to file:// URLs for server compatibility 2025-10-24 00:55:20 +01:00
Shantur Rathore
f291649f74 Fix file picker keyboard event handling and loading state 2025-10-24 00:52:17 +01:00
Shantur Rathore
b6dc4ba249 Fix file path format and initialization issues
- Remove leading slash from file paths (use relative paths from workspace)
- Server expects relative paths like 'file.md' not '/file.md'
- Convert isInitialized from let to signal to persist across renders
- Fix file picker not showing files on first open
- Paths from find.files() are already relative to workspace
2025-10-24 00:50:30 +01:00
Shantur Rathore
26ab3e066f Fix file attachment API format and duplicate attachments
- Add required 'url' field to file parts in API request
- Use url, mime, filename instead of path field
- Prevent duplicate attachments by checking if path already exists
- Show all files when picker opens with empty query (use space as query)
- Filter git files only when search query provided
- Enter key now works correctly when file list has items
2025-10-24 00:47:02 +01:00
Shantur Rathore
2629276229 Make file attachments truly inline as text in textarea
- Insert @filename directly into textarea value when file selected
- Remove separate chip display above textarea
- Text now flows naturally: 'look at this file @app.tsx and tell me'
- Clear all ignored positions when @ is deleted (reset state)
- Show attachment count in hints when files attached
- Attachments tracked separately but appear as text to user
- Auto-resize textarea after inserting filename
2025-10-24 00:42:16 +01:00
Shantur Rathore
debaef628a Fix file picker not reopening after Escape
- Clear ignored @ position when user moves away from it
- Track when @ position changes and remove old position from ignored set
- Allows file picker to work again on new @ mentions
- Example: @app (Escape) → @file (picker opens for new @)
2025-10-24 00:36:32 +01:00
Shantur Rathore
fb9d3a08eb Improve file picker UX: inline chips, focus preservation, escape behavior
- Move attachment chips inside textarea wrapper (appears inline)
- Keep textarea focused when pressing Escape (no focus stealing)
- Track ignored @ positions after Escape to prevent re-triggering picker
- Clear ignored positions on message send
- Use capture phase for Escape key handling (true flag on addEventListener)
- Escape now works like email: type @example.com naturally after dismissing picker
- Chips show above textarea input with better spacing (pt-2 pb-1)
2025-10-24 00:27:36 +01:00
Shantur Rathore
d735067042 Fix infinite loop in file picker with proper initialization flag
- Use isInitialized flag to prevent effect re-triggering
- Use gitFilesFetched flag to prevent duplicate git API calls
- Fetch git files and initial files only once on first open
- Only refetch when search query actually changes
- Git files are optional - don't block on empty results
- Logs show initialization state for debugging
2025-10-24 00:17:33 +01:00
Shantur Rathore
0e93cb56af Add comprehensive logging to file picker for debugging
- Log all API calls with timing information
- Log cache hits and misses
- Log query changes and effect triggers
- Log response data structure
- Log file counts at each step
- Log errors with elapsed time
- Helps diagnose slow loading and missing files issues
2025-10-24 00:13:48 +01:00
Shantur Rathore
a3c60d0e37 Fix file picker error handling and reduce API calls
- Handle file.status() errors gracefully (warn instead of error)
- Make git files optional (empty array if endpoint fails)
- Prevent duplicate API calls by tracking last query
- Only fetch git files once (check if cached before fetching)
- Short-circuit when no search query (just show git files)
- Better error messages (warn for git, error for search)
2025-10-24 00:08:11 +01:00
Shantur Rathore
9a47cfd8d9 Fix file picker UX issues
- Change from modal dialog to inline popover (no focus stealing)
- Keep textarea focused while file picker is open
- Fix loading flickering by caching git files
- Debounce file search to prevent rapid refetching
- Escape closes picker without removing @ text
- Enter selects file from picker
- Arrow keys navigate picker when open, history when closed
- Position picker above textarea using absolute positioning
- Mouse hover updates selection index
- Remove blur/focus from picker input
2025-10-23 22:58:09 +01:00
Shantur Rathore
6e4fa9479e Mark task 021 as complete 2025-10-23 22:46:34 +01:00
Shantur Rathore
bdd9837538 Add file attachments with @ mentions and drag & drop support
- Create attachment type system with file, text, symbol, and agent sources
- Implement file picker with SDK integration (find.files, file.status)
- Add @ detection in prompt input to trigger file search
- Create attachment chips UI for managing attached files
- Add attachment state management per session
- Update message submission to include attachments
- Implement drag & drop support for adding files
- Show git-modified files first in file picker with +/- indicators
- Filter files as user types after @
- Clear attachments after successful message send
2025-10-23 22:46:29 +01:00
Shantur Rathore
9dfb3cd612 Add auto-scroll to command palette for keyboard navigation
Keep selected command visible when navigating with arrow keys by automatically scrolling the list
2025-10-23 22:36:18 +01:00
Shantur Rathore
54569b166d Add command palette with 19 commands and improved keyboard navigation
Implement VSCode-style command palette (Cmd+Shift+P) with comprehensive command organization:
- 19 commands organized into 5 categories: Instance, Session, Agent & Model, Input & Focus, System
- Category-based grouping with proper visual hierarchy
- Keyboard shortcuts displayed for all applicable commands
- Search/filter by command name, description, keywords, or category

Add keyboard shortcuts:
- Cmd+Shift+A: Open agent selector
- Cmd+Shift+M: Open model selector (existing)
- Instance/Session navigation shortcuts (Cmd+[/], Cmd+Shift+[/])

Fix keyboard navigation:
- Model selector now highlights options with arrow keys using data-[highlighted] attribute
- Agent selector properly opens via keyboard shortcut
- Global keyboard handler skips Combobox/Select components to allow native navigation

Improve discoverability:
- Prominent centered Command Palette hint in connection status bar
- Keyboard shortcut hints next to agent and model selectors

Complete task 020-command-palette
2025-10-23 22:32:49 +01:00
Shantur Rathore
b06b8104a5 Add task specifications for Phase 5 advanced input features
- 015-keyboard-shortcuts.md (completed)
- 020-command-palette.md (completed)
- 021-file-attachments.md (next: @mentions, drag-drop, chips)
- 022-long-paste-handling.md (summarize long pastes)
- 023-symbol-attachments.md (LSP integration)
- 024-agent-attachments.md (agent context)
- 025-image-clipboard-support.md (image handling)
2025-10-23 21:40:19 +01:00
Shantur Rathore
40cb17d0eb Fix syntax highlighting by upgrading to Shiki v3 with all languages
- Upgrade shiki from ^1.0.0 to ^3.13.0
- Use shiki/bundle/full with all bundled languages (200+)
- Change getHighlighter to createHighlighter (v3 API)
- Fix CodeBlockInline to track reactive dependencies (theme, code, language)
- Add markdown code block detection in tool call outputs
- Render tool outputs with Markdown component when they contain code blocks
- Support syntax highlighting for bash, webfetch, and default tool outputs
2025-10-23 21:38:16 +01:00
Shantur Rathore
4c98a3df06 Add keyboard shortcuts system with reusable hint components
- Implement centralized keyboard registry with 20+ shortcuts
- Add instance navigation (Cmd+[1-9], Cmd+[/])
- Add session navigation (Cmd+Shift+[1-9], Cmd+Shift+[/])
- Add agent/model cycling (Tab, Cmd+Shift+M)
- Add input shortcuts (Cmd+P focus, Cmd+K clear, ↑↓ history)
- Add command palette (Cmd+Shift+P) with 8 MVP commands
- Implement message history per folder in IndexedDB (max 100)
- Create reusable Kbd and HintRow components
- Replace all keyboard hint rendering with consistent components
- Use text-based shortcuts (Cmd+Shift+M) for clarity
2025-10-23 20:18:45 +01:00
Shantur Rathore
3c5c4755b8 Add logs tab with real-time server output and consolidate syntax highlighting
- Implement dedicated Logs tab showing stdout/stderr from OpenCode server
- Add log level parsing (INFO, ERROR, WARN, DEBUG) with color coding
- Stream logs from main process to renderer via IPC events
- Persist scroll position and auto-scroll state per instance
- Synchronize instance IDs between renderer and main process
- Consolidate syntax highlighting to single shared highlighter instance
- Optimize markdown rendering with global highlighter initialization
- Fix code block copy button to always appear on right side
- Enable debug logging with --print-logs --log-level DEBUG flags
2025-10-23 11:14:35 +01:00
Shantur Rathore
b836086978 Add markdown rendering with syntax highlighting and copy buttons
- Implement markdown parser using marked with Shiki syntax highlighting
- Add CodeBlockInline component for tool call outputs with syntax highlighting
- Add Markdown component for assistant message text with code blocks
- Add ThemeProvider for light/dark mode support
- Add copy buttons to all code blocks (markdown and tool calls)
- Support 20+ languages: TypeScript, JavaScript, Python, Bash, JSON, HTML, CSS, C++, Java, C, C#, Rust, Go, PHP, Ruby, Swift, Kotlin, and more
- Auto-detect language from file extensions in tool call outputs
- Apply consistent styling for code blocks across the application
- Fix whitespace handling in markdown-rendered text
- Add language labels to all code blocks
2025-10-23 10:07:17 +01:00
Shantur Rathore
7cf0f9a179 Add agent and model selection with automatic defaults and subagent support
- Implement automatic agent/model selection for new sessions (first agent, prioritize Anthropic default)
- Extract and restore agent/model from last assistant message when resuming sessions
- Add subagent support: child sessions can select subagents, parent sessions cannot
- Display subagent badge in agent dropdown for identification
- Truncate agent descriptions to 50 characters in dropdown
- Improve model search to include full provider/model ID path
- Auto-select input text on focus for easy model search
- Add getDefaultModel() with priority: agent model → Anthropic → first provider
2025-10-23 09:25:26 +01:00
Shantur Rathore
0add900f1b Mark task 010 as complete 2025-10-23 01:18:32 +01:00
Shantur Rathore
d7f619486e Implement comprehensive tool call rendering with state persistence
- Implement tool-specific rendering for all 14 tool types (read, edit, write, bash, webfetch, todowrite, task, etc.)
- Each tool shows contextually relevant information (file previews, diffs, command output, todo lists)
- Add metadata-driven content display using preview, diff, output, and todos from tool state
- Implement status-based rendering (pending, running, completed, error) with animations
- Create global state store for expandable items (tool calls and reasoning sections)
- Fix state persistence: expanded tool calls and reasoning sections remain expanded when new messages arrive
- Fix scroll position preservation during live message updates
- Fix reasoning toggle loop by replacing native details element with custom expandable
- Add comprehensive documentation in TOOL_CALL_IMPLEMENTATION.md
- Reduce font sizes for better readability in expanded tool content
- Add proper keying to For loops to prevent component recreation
- Match TUI patterns for tool names, actions, and content formatting
2025-10-23 01:18:25 +01:00
Shantur Rathore
fa77b4e82e Working messages display 2025-10-22 22:10:51 +01:00