Commit Graph

96 Commits

Author SHA1 Message Date
Shantur Rathore
2d3815ec33 refactor: restyle prompt input via tokens 2025-10-28 19:43:24 +00:00
Shantur Rathore
cb56eed4f9 docs: add tailwind refactor follow-up tasks 2025-10-28 19:40:33 +00:00
Shantur Rathore
377595c19d chore: archive task 045 2025-10-28 18:59:01 +00:00
Shantur Rathore
8f27a2d594 refactor: restyle message item via tokens 2025-10-28 18:58:05 +00:00
Shantur Rathore
63327d02ec chore: archive task 044 2025-10-28 18:56:27 +00:00
Shantur Rathore
28fb233907 feat: define typography tokens 2025-10-28 18:55:48 +00:00
Shantur Rathore
1b07109a40 chore: archive task 043 2025-10-28 18:54:50 +00:00
Shantur Rathore
76d75a89c5 feat: migrate color tokens 2025-10-28 18:53:47 +00:00
Shantur Rathore
455f623dcf chore: archive task 042 2025-10-28 18:49:21 +00:00
Shantur Rathore
3b166da8f1 chore: scaffold style tokens 2025-10-28 18:48:46 +00:00
Shantur Rathore
6f242c910b Add web_developer 2025-10-28 18:47:30 +00:00
Shantur Rathore
03e8254714 chore: archive task 041 2025-10-28 18:46:35 +00:00
Shantur Rathore
493dc749ec chore: prep tailwind for theming 2025-10-28 18:45:39 +00:00
Shantur Rathore
0a3ac6cbf2 docs: add theme overhaul task series 2025-10-28 18:42:54 +00:00
Shantur Rathore
1ce5b125a9 Expand dark theme coverage across client UI 2025-10-28 18:19:17 +00:00
Shantur Rathore
8858fe052b Ensure build script runs from package root 2025-10-28 18:18:48 +00:00
Shantur Rathore
2c46b7476b Broaden code fence detection and default to text 2025-10-28 16:48:50 +00:00
Shantur Rathore
d743ebda29 Improve markdown rendering and syntax highlighting 2025-10-28 16:42:23 +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
030fc4986e Remember last used binary and show environment variables 2025-10-26 11:30:29 +00:00
Shantur Rathore
0b26ffd97d Add environment variables configuration to OpenCode instances
- Add environment variables editor in advanced settings
- Store environment variables in global preferences
- Pass environment variables to OpenCode processes when spawning
- Display environment variables in instance information and server logs
- Fix system PATH binary handling for 'opencode' command
- Show detailed environment variable values in startup logs
- Save and restore last used binary across app restarts
- Add system PATH binary to recent binaries list when used

Features:
- Environment variables editor with add/remove functionality
- Persistent storage of environment variables across sessions
- Real-time display of active environment variables in logs
- Instance information shows configured environment variables
- Proper handling of system PATH vs custom binary paths
- Last used binary persistence and automatic restoration
2025-10-26 10:48:47 +00:00
Shantur Rathore
f63a4b3754 Add OpenCode binary selection with version detection
- Add binary selector component with dropdown and validation
- Support custom OpenCode binary paths and system PATH binary
- Async version checking for all binaries when selector opens
- Store recent binaries with timestamps and version info
- Enhanced instance creation to use selected binary
- Improved storage system for binary preferences
- Fixed validation to handle system PATH binaries properly
2025-10-26 10:26:32 +00:00
Shantur Rathore
f4a664bfe7 Migrate from IndexedDB to file-based storage with cross-instance sync 2025-10-25 20:21:52 +01: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
c01a7e7315 Add session tokens/cost display to status bar like TUI
- Add utility functions to calculate and format session info from messagesInfo
- Display tokens and cost on left side of status bar
- Center Command Palette text in status bar
- Format matches TUI: '110K • /bin/sh.42'
- Updates in real-time as messages are processed
2025-10-24 23:55:12 +01:00
Shantur Rathore
0fc78fbfdd Fix Cmd+Shift+L shortcut conflict by removing old switch-to-logs 2025-10-24 23:31:13 +01:00
Shantur Rathore
72f5059037 Refactor logs tab to Info tab with instance information and logs
- Create reusable InstanceInfo component extracted from instance-welcome-view
- Create InfoView component combining instance info and logs sections
- Replace LogsView with InfoView in App.tsx
- Rename 'Logs' tab to 'Info' with Info icon
- Update all references from 'logs' to 'info' throughout codebase
- Maintain scroll position and auto-scroll behavior for logs
- Add dark mode support to all components
2025-10-24 18:48:52 +01:00
Shantur Rathore
24237c25b9 Fix MCP server status parsing to match API response
- Map server status values correctly: connected -> running, disabled -> stopped, failed -> error
- Remove array parsing logic as API returns Record<string, status>
- Fixes incorrect MCP server status display in instance welcome view
2025-10-24 18:41:26 +01:00
Shantur Rathore
2c9a29ebc4 Fix invalid HTML structure in folder selection view
- Move delete button outside of folder selection button
- Prevents button nesting which is invalid HTML
- Fixes build warning about malformed HTML
2025-10-24 18:37:39 +01:00
Shantur Rathore
b0e636d781 Add recent folders feature with localStorage persistence
- Create FolderSelectionView component showing recent folders and browse option
- Store up to 10 recent folders in localStorage with timestamps
- Show folder selection view on app start when no instances exist
- Display folder selection modal when creating new instance from existing instance
- Add keyboard navigation (arrows, page up/down, home/end, enter, delete)
- Add ability to remove folders from recent list
- Track folder access time and display relative timestamps
- Close modal with Escape key or close button
- Update preferences store with recent folders management
2025-10-24 18:36:11 +01:00
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
be3acd6724 Implement toggle thinking blocks with localStorage persistence
- Add preferences store to manage user preferences in localStorage
- Toggle thinking blocks visibility via command palette (default: hidden)
- Dynamic command label shows current state (Show/Hide Thinking Blocks)
- Filter reasoning parts based on preference in message-stream
- Conditionally render reasoning parts in message-part component
- Support function labels in Command interface for dynamic text
2025-10-24 18:24:35 +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
d7e3ae4624 Fix send button not enabling after revert/undo
When restoring message text to prompt input after revert/undo, dispatch input event to trigger textarea's onInput handler. This updates the prompt signal and enables the send button immediately.
2025-10-24 17:48:03 +01:00
Shantur Rathore
1362a5872a Add revert button to user messages
- Add revert icon (↶) button in message header for all user messages
- Clicking revert button reverts session to that specific message
- Restores the message text back to the prompt input
- Style revert button with hover effects and border highlight
- Revert action updates UI automatically via SSE session.updated event
2025-10-24 17:44:19 +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
a4968e9eb5 Fix electron-builder validation errors
- Move electron from dependencies to devDependencies (required by electron-builder)
- Add author field to package.json (required by electron-builder)
2025-10-24 16:48:30 +01:00
Shantur Rathore
bb35946b28 Add binary build system for cross-platform distribution
- Add scripts/build.ts: Bun-based build script for generating binaries
- Support macOS (x64, ARM64, Universal), Windows (x64, ARM64), Linux (x64, ARM64)
- Add build:* npm scripts for each platform (build:mac, build:win, build:linux, etc)
- Configure electron-builder with platform-specific settings:
  * macOS: DMG + ZIP, Universal binaries, proper icon paths
  * Windows: NSIS installer + ZIP, configurable install directory
  * Linux: AppImage + DEB + tar.gz packages
- Add BUILD.md: Comprehensive build documentation with examples
- Update README.md: Add build instructions and reference BUILD.md
- Artifacts named: OpenCode Client-{version}-{os}-{arch}.{ext}
- Output directory: release/

Usage:
  bun run build:mac       # macOS Universal (Intel + Apple Silicon)
  bun run build:win       # Windows x64
  bun run build:linux     # Linux x64
  bun run build:all       # All platforms
2025-10-24 16:46:34 +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
6f31ffc467 Replace session picker modal with instance welcome view
Transform the session picker from a modal into a comprehensive welcome screen that displays instance metadata, session history, and creation options. The new view provides full keyboard navigation, shows MCP server status, OpenCode binary path, and project information in a compact, space-efficient layout.

Key features:
- Instance metadata sidebar showing folder, project, VCS, version, binary path, MCP status, and server info
- Session list with keyboard navigation (↑↓, PgUp/PgDn, Home/End, Enter)
- Cmd+Enter shortcut to create new session from anywhere
- Compact design with efficient space usage
- Visual MCP server status indicators (running/stopped/error)
- Scrollable layout that keeps "New Session" section accessible
2025-10-24 15:41:59 +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
af304dd6d3 Move image clipboard task to done 2025-10-24 13:15:01 +01:00
Shantur Rathore
640dbec2fb Add image clipboard support with paste detection and thumbnails 2025-10-24 13:14:54 +01:00