Commit Graph

29 Commits

Author SHA1 Message Date
Shantur Rathore
14b8270471 Update prompt input placeholder to mention paste support
- Remove /command reference as commands are not currently supported
- Add mention of paste support for images and text
2025-10-24 18:28:18 +01:00
Shantur Rathore
7be4248e20 Enable command queueing and fix message duplication issues
- Remove sending() state blocking to allow queueing multiple messages
- Add optimistic message creation with temp IDs for immediate UI feedback
- Implement QUEUED badge display matching TUI behavior (accent color, bold)
- Compute queued state: user message ID > last assistant message ID
- Clear prompt input immediately before async send for better UX
- Fix duplicate messages by properly finding and replacing temp messages
- Fix duplicate parts by clearing optimistic parts when real message arrives
- Fix state mutation bugs in message.part.updated handler (immutable updates)
- Fix state mutation bugs in message.updated handler (immutable updates)

Matches TUI implementation for consistent user experience across clients.
2025-10-24 16:38:42 +01:00
Shantur Rathore
e3bc947195 Implement double-escape session abort matching TUI behavior
- Add double-escape debounce pattern with 1-second timeout
- First escape shows warning, second escape aborts session
- Fix session busy check to handle undefined timeCompleted field
- Add abortSession API call to sessions store
- Show visual feedback in prompt input during debounce
- Remove Escape from filtered keys in prompt-input auto-focus
2025-10-24 16:09:32 +01:00
Shantur Rathore
a1a5c4b396 Fix image attachment deletion by setting display property 2025-10-24 14:01:22 +01:00
Shantur Rathore
d39a571c16 Add [Image #N] placeholder text for pasted images 2025-10-24 13:53:13 +01:00
Shantur Rathore
640dbec2fb Add image clipboard support with paste detection and thumbnails 2025-10-24 13:14:54 +01:00
Shantur Rathore
3c73a6bc4a Refactor to unified picker showing both agents and files 2025-10-24 13:09:49 +01:00
Shantur Rathore
d17e8e56c8 Add agent attachments with @agent mentions 2025-10-24 13:02:43 +01:00
Shantur Rathore
153387bbb4 Add automatic focus to prompt input when typing 2025-10-24 12:49:59 +01:00
Shantur Rathore
0aca7ba7e5 Fix file attachment position tracking when deleting @ mentions 2025-10-24 12:46:38 +01:00
Shantur Rathore
6dcdd8294d Implement client-side file scanning with gitignore support
- Use Node.js fs APIs to recursively scan workspace folder
- Load and parse .gitignore to filter files
- Cache scanned files for performance
- Filter files by search query on client side
- Skip .git and node_modules directories
- Support gitignore patterns (basic wildcards)
- No server API calls needed for file listing
2025-10-24 09:52:53 +01:00
Shantur Rathore
f19add1c47 Simplify file picker to show only git files with filtering
- Remove server file search API calls
- Only use git file status for file list
- Filter git files by search query on client side
- Add trailing / when inserting folder paths
- Simpler and faster implementation
- Respects gitignore (via git status)
2025-10-24 09:49:16 +01:00
Shantur Rathore
fdd6c8d63b Allow folders in file picker and use them as search filters
- Remove directory filtering from file picker
- When folder selected, insert folder path into input (not as attachment)
- Folder path becomes search query to filter files in that folder
- Files still create attachments as before
- User can navigate folder structure using @ mentions
2025-10-24 09:26:13 +01:00
Shantur Rathore
947f19885e Implement smart deletion for file attachment mentions
- Backspace at end of @filename deletes entire mention
- Delete at start of @filename deletes entire mention
- Selecting @filename and deleting removes it
- Automatically removes file attachment and chip
- Only deletes if @filename has matching attachment
- Same UX as paste placeholder deletion
2025-10-24 01:28:08 +01:00
Shantur Rathore
881fb5ff66 Implement smart deletion for paste placeholders
- Backspace at end of [pasted #N] deletes entire placeholder
- Delete at start of [pasted #N] deletes entire placeholder
- Selecting placeholder and deleting removes it
- Automatically removes attachment when placeholder deleted
- Cursor repositioned to placeholder start after deletion
2025-10-24 01:24:25 +01:00
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
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
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
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
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
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
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
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
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