Commit Graph

27 Commits

Author SHA1 Message Date
Shantur Rathore
c9ef192ef2 improve message autoscroll and metadata 2025-11-08 23:11:45 +00:00
Shantur Rathore
03ff2779b0 persist prompt drafts per session 2025-11-08 22:24:19 +00:00
Shantur Rathore
c6b3686f13 add toasts, session usage tracking, and copy controls 2025-11-08 22:04:50 +00:00
Shantur Rathore
4b2cb9d212 Improve session sidebar UX and tool rendering 2025-11-07 22:53:45 +00:00
Shantur Rathore
5483932196 Improve session defaults and onboarding UI 2025-11-07 21:22:46 +00:00
Shantur Rathore
7193103646 Track tool part versions for reliable updates 2025-11-07 15:12:21 +00:00
Shantur Rathore
27da588d22 Track tool part versions for SSE updates 2025-11-07 13:41:07 +00:00
Shantur Rathore
e7957fd67d Resolve pasted placeholders before sending prompts 2025-11-06 09:42:52 +00:00
Shantur Rathore
40832ec1b6 Align prompt persistence and Electron builds with Node toolchain 2025-10-31 16:01:29 +00:00
Shantur Rathore
37a47699e3 refine thinking part filtering 2025-10-30 16:31:13 +00:00
Shantur Rathore
41843de5e0 fix: route escape abort through busy stub 2025-10-30 00:21:10 +00:00
Shantur Rathore
d18e44f721 Cache markdown render output per message part 2025-10-28 14:41:09 +00:00
Shantur Rathore
6597783e85 Stabilize message stream rendering caches 2025-10-28 13:48:56 +00:00
Shantur Rathore
79e4931b28 Precompute message display parts and pause scroll handling 2025-10-28 12:10:43 +00:00
Shantur Rathore
3a15ba7f76 Optimize streaming updates and clear optimistic parts 2025-10-28 11:19:19 +00:00
Shantur Rathore
7a91f4fd26 Track session metrics per session 2025-10-27 15:48:29 +00:00
Shantur Rathore
39e653e896 SessionInfo calculates only when messages are updated 2025-10-27 11:53:27 +00:00
Shantur Rathore
c4a8a54bd7 Add context window percentage and subscription model detection to session info 2025-10-25 18:41:15 +01:00
Shantur Rathore
e58462b926 Fix revert/undo state synchronization and message cleanup
- Clear session.revert when server sends undefined (fixes inability to send messages after revert)
- Handle message.removed and message.part.removed SSE events to reload messages
- Ensures reverted messages are removed from UI in real-time without requiring app restart
2025-10-24 18:21:11 +01:00
Shantur Rathore
3edd852ee2 Implement compact, undo, and init commands
- Add compact command with proper API parameters (providerID, modelID)
- Implement undo command matching TUI behavior:
  - Find previous user message before revert point
  - Restore reverted message to prompt input
  - Filter messages client-side based on session.revert field
- Add init command with proper hex-encoded message ID generation
- Add session.revert field handling:
  - Parse revert field from API responses in fetchSessions and createSession
  - Update revert field via SSE session.updated events
  - Filter messages during render when revert point is set
- Add SSE event handlers for session.compacted and session.error
- Add force reload option to loadMessages for post-compact refresh
- Messages now filter instantly based on revert state without API reload
2025-10-24 17:41:55 +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
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
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
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
Shantur Rathore
fa77b4e82e Working messages display 2025-10-22 22:10:51 +01:00