Commit Graph
183 Commits
Author SHA1 Message Date
Chris ScottandOpenCode Agent b88d8a4bf3 Fix permission approval for subagent sessions by tracking source directory (#38)
When permission events arrive via SSE, record which repo/directory they
came from. Use this mapping in getClient() to ensure the correct directory
parameter is sent when approving permissions for subagent sessions.

Fixes #33

Co-authored-by: OpenCode Agent <agent@opencode.ai>
2025-12-29 08:35:45 -05:00
Chris Scott d7873241e0 Add image and PDF attachment support with drag-drop and paste 2025-12-28 22:52:16 -05:00
Chris Scott cc04cb073c Add MCP server search functionality to repo dialog 2025-12-28 21:32:15 -05:00
Chris Scott cad84d2f63 Improve OpenCode config error handling and toast notifications 2025-12-28 21:10:00 -05:00
Chris Scott 876b444599 Add config rollback and startup error recovery 2025-12-28 20:52:36 -05:00
Chris Scott 120d087910 Add support for GitHub shorthand repo URLs 2025-12-27 19:27:37 -05:00
Chris Scott ee99bb65fc Reorder branch switcher dropdown: view changes and add branch at top, scrollable branch list below 2025-12-27 18:19:57 -05:00
Chris Scott ad329ac287 Fix compaction toast to persist until completion 2025-12-27 18:06:29 -05:00
Chris Scott f1557fba5d Improve permission dialog UI and update Python package documentation 2025-12-27 17:54:43 -05:00
Chris Scott a500d2ce55 Fix empty file editing in file browser 2025-12-27 17:16:47 -05:00
OpenCode Agent 52f1ccbf1e Remove duplicate session status fetching to fix race condition 2025-12-27 22:09:07 +00:00
Chris Scott 923b70833d Fix performance optimizations for permission handling and session management (#32) 2025-12-27 09:52:30 -05:00
b28f069576 Fix/permission request directory (#31)
* Fix permission response by including directory parameter

Extract directory from query key in useActiveRepos hook and pass it
to OpenCodeClient when responding to permissions. Use composite keys
for client and SSE connection tracking to support multiple repos with
the same URL but different directories.

* Keep permission dialog open on response failure and show error toast

* Fix permission request proxying to preserve query parameters

The backend proxy was incorrectly handling URL query parameters when stripping the /api/opencode prefix. This caused the directory parameter to not be passed correctly to the OpenCode server, breaking the permission request/response flow.

Changes:
- Separate pathname and search parameters explicitly
- Only strip /api/opencode from pathname, preserve search params
- Add logging for permission requests to aid debugging
- Update error logging to use correct variables

This fix ensures that permission responses are properly forwarded to the OpenCode server with all necessary query parameters, allowing the session to proceed correctly when users grant permissions.

* Fix permission client lookup when only individual sessions are loaded

The PermissionContext failed to find a client when responding to permissions because it only scanned the sessions list query, but SessionDetail and other pages only load individual sessions via useSession.

Changes:
- Update useActiveRepos to also scan individual session queries
- Match query keys like ['opencode', 'session', url, sessionId, directory]
- Extract session ID from individual session query data
- Build active repos map from both sessions list and individual session queries

This ensures permission dialogs can find the appropriate client to send responses, even when viewing a single session without loading the full sessions list.

* Fix permission client lookup with fallback to query cache

The activeRepos state was often empty when permission dialogs appeared due to timing issues with the React Query cache subscription. This caused No client found for session errors.

Changes:
- Add fallback scan of query cache directly in getClient when activeRepos is empty
- Remove excessive debug logging that was spamming console
- Add minimal log only when fallback is actually used
- Fix query key length checks to be more robust

This ensures permission responses work correctly even if the useActiveRepos hook hasn't yet populated the state, by falling back to scanning the query cache directly to find the session and creating the appropriate OpenCodeClient.

* Add directory-based permission requests with global notification and message auto-refresh

---------

Co-authored-by: OpenCode Agent <agent@opencode.ai>
Co-authored-by: Chris Scott <chris@cstech.dev>
2025-12-27 09:21:45 -05:00
OpenCode Agent 548698c65c Hide BranchSwitcher on mobile, move to dropdown menu 2025-12-27 01:18:27 +00:00
Chris Scott 5628c4c7be Fix message editing state and stream detection logic 2025-12-26 18:23:37 -05:00
Chris Scott 4fd658fc7d Add diff expansion controls with ContentDiffViewer and CodePreview components 2025-12-26 18:07:33 -05:00
Chris Scott ae338bb576 Make branch switcher dropdown scrollable on mobile 2025-12-26 16:37:21 -05:00
Chris Scott d701d07a5b Improve UI interactions and responsiveness across components 2025-12-26 16:33:35 -05:00
Chris Scott 64b36b8d83 Make branch switcher fill width in mobile dropdown menu 2025-12-26 13:53:23 -05:00
Chris Scott f6847ba5ba Use MoreVertical icon in dropdown menus to match RepoDetailHeader 2025-12-26 13:52:17 -05:00
Chris Scott 3c97756266 Extract RepoDetail header into reusable component with mobile dropdown menu 2025-12-26 13:47:32 -05:00
Chris Scott e3a3cbde84 Add global permission request system with centralized context and dialog 2025-12-26 13:36:18 -05:00
Chris Scott 6ce3548dfe refactor RepoCard component layout and interaction
Simplify card layout with consistent button styling, proper event handling for card clicks, and improved visual feedback with hover states. Consolidate branch and status indicators in a cleaner layout structure.
2025-12-25 13:11:49 -05:00
Chris Scott ff3971f26d Fix toast notification ID conflict in createConfig 2025-12-25 10:46:09 -05:00
Chris Scott 3fd62b77a1 Add RepoMcpDialog component for MCP server management 2025-12-25 10:38:51 -05:00
Chris Scott ac188c953b Remove console.log debug statements and cleanup debug code 2025-12-25 10:38:01 -05:00
Chris Scott ce2630936d Update UI styling for mode toggle and session indicators 2025-12-22 00:09:21 -05:00
Chris Scott 45119436ae Adjust repo list container height calculations 2025-12-21 21:32:09 -05:00
OpenCode Agent c884656d8a Fix button styling and repo list layout 2025-12-22 02:21:51 +00:00
Chris Scott 277b5456a3 Improve branch switcher caching and repo list mobile layout 2025-12-21 20:30:53 -05:00
Chris Scott 1d7d632393 Fix TypeScript linting error in webSpeechSynthesizer 2025-12-21 19:59:33 -05:00
Chris Scott 19752eace9 Add web speech synthesizer utility 2025-12-21 19:54:01 -05:00
Chris Scott af39267aae Add TTS settings configuration and context management 2025-12-21 19:52:54 -05:00
Chris Scott 1ae8ed81b2 Improve mobile UX for message actions and scroll button; add revert message filtering 2025-12-21 17:50:21 -05:00
Chris Scott 3a01ca9356 Update model and scroll buttons to match send button height with dark theme borders 2025-12-21 17:19:37 -05:00
Chris Scott f433cb0c1a Add white border to send button in dark theme 2025-12-21 17:18:44 -05:00
Chris Scott 8061437304 Add initial commit for local repos, filter sessions by directory, remove unused priority indicator 2025-12-21 14:28:56 -05:00
Chris Scott 75430230c1 Use API as source of truth for branch switcher current branch 2025-12-21 14:26:46 -05:00
Chris Scott bd3d2b1c86 Move TTS stop button from App to SessionDetail 2025-12-21 13:37:10 -05:00
Chris Scott 17a9556c2a Add message editing state management and UI improvements 2025-12-21 13:18:39 -05:00
Chris ScottandChris Scott 0cbfe2e358 Fix pnpm resources (#29)
* Add message undo/refresh features and stop audio floating button

* Exclude workspace directory from pnpm workspace detection

---------

Co-authored-by: Chris Scott <chris@cstech.dev>
2025-12-21 09:46:38 -05:00
Chris Scott fb430359ce Add todo tool rendering components for task management 2025-12-21 08:51:59 -05:00
Chris Scott 82d3a109ac Import existing OpenCode config on initialization and fix schema types 2025-12-20 10:11:30 -05:00
Chris ScottandChris Scott a9ebee72c4 Fix compact command validation flow (#28)
* feat: Implement /compact command with processing feedback

- Add 'compact' status type to session status store
- Update SessionStatusIndicator to show purple pulsing animation for compaction
- Add summarizeSession() API method to OpenCode client
- Modify command handler for /compact to:
  - Get current model from state
  - Show compaction toast
  - Set session to compacting status
  - Call summarize endpoint with provider/model
- Update SSE handler to clear compact status on session.compacted event

The user sees a purple animated indicator and 'Compacting' text during the operation, matching the TUI experience.

* Fix compact command to use break instead of return for model validation

---------

Co-authored-by: Chris Scott <chris@cstech.dev>
2025-12-19 00:10:12 -05:00
Chris Scott 516a894627 Add vitest dependency and exclude test files from build 2025-12-18 22:48:14 -05:00
Chris Scott 44240f0aab Fix TTS sanitization and message handling bugs
- Add duplicate config validation to backend
- Fix TTS button comparison using original text
- Track original vs sanitized text in TTS context
- Update toast import in message hooks
- Add type safety for error handling
2025-12-18 22:44:07 -05:00
OpenCode Agent 698ad7b020 Add TTS markdown sanitization to filter unreadable symbols 2025-12-19 02:53:15 +00:00
OpenCode Agent 6c4daaeae7 Add message undo/refresh functionality with editable user prompts
- Add revertMessage and unrevertSession methods to OpenCode API client
- Create useRemoveMessage and useRefreshMessage hooks for message operations
- Add MessageActionButtons component with X (remove) and refresh buttons
- Add EditableUserMessage component for editing prompts before resend
- Update MessageThread to integrate action buttons and editable messages
- Update AGENTS.md with improved guidelines and pnpm preference
2025-12-16 18:53:31 +00:00
Chris Scott b27d4a9cbb Add Mermaid diagram support to frontend message display 2025-12-16 00:06:06 -05:00
Chris Scott 810565b6ea Add global CSS rule to prevent iOS zoom on all inputs 2025-12-15 23:28:33 -05:00