Commit Graph
26 Commits
Author SHA1 Message Date
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 d701d07a5b Improve UI interactions and responsiveness across components 2025-12-26 16:33:35 -05:00
Chris Scott f6847ba5ba Use MoreVertical icon in dropdown menus to match RepoDetailHeader 2025-12-26 13:52:17 -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 ac188c953b Remove console.log debug statements and cleanup debug code 2025-12-25 10:38:01 -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 e993a83027 Fix Zod v4 schema errors, mobile permission dialog overflow, and TTS test mocking 2025-12-14 23:19:59 -05:00
Chris Scott adbc632f0e Enhance permission request handling for multi-session support 2025-12-13 23:19:55 -05:00
Chris Scott 383b55741b Fix permission dialog to show actual commands and file paths 2025-12-12 23:47:21 -05:00
Chris Scott 725f782079 Add iconOnly prop to BranchSwitcher for compact display 2025-12-12 20:31:53 -05:00
Chris Scott e4a27e53e5 Improve branch switcher layout consistency across components 2025-12-12 19:08:34 -05:00
Chris Scott dc7964021d Add @ mention support for agents and files, extract CopyButton component 2025-12-06 11:21:06 -08:00
Chris Scott 3e31dbcdf8 Fix parent/child session navigation for task tool calls 2025-12-06 11:15:09 -08:00
Chris Scott d61da27dee Fix select all to select all filtered sessions instead of adding to existing selection 2025-12-05 18:48:53 -08:00
Chris Scott f12654ce66 Fix session model detection to use actual session model instead of default preference 2025-12-05 16:11:48 -08:00
OpenCode Assistant a434431a17 fix: resolve session list scrolling issue by adding min-h-0 to flex containers 2025-12-05 14:40:23 +00:00
Chris Scott 8c0689eac8 Update UI components and refactor message display 2025-11-29 20:23:45 -05:00
Chris Scott 977507fa82 Add shadcn checkbox component and update repo/session cards 2025-11-29 17:56:33 -05:00
Chris Scott e163b64dde Fix iOS PWA layout issues and improve mobile header 2025-11-28 17:24:14 -05:00
Chris Scott 64e49a8a52 Improve chat UI with scroll management and bash command handling 2025-11-28 17:07:51 -05:00
Chris Scott 83834e7ed7 Add local repository support and permission request handling 2025-11-28 10:26:03 -05:00
Chris Scott dcf2dd68e7 Add file preview dialog and line navigation in git diff viewer 2025-11-27 10:52:05 -05:00
Chris Scott fea3c214af Add MCP server management with auto-restart functionality 2025-11-26 23:43:19 -05:00
Chris Scott d9ee1a67b7 fix: improve model display and session header layout 2025-11-25 09:52:08 -05:00
Chris Scott bbf66c259b Initial release v0.2.5 2025-11-23 23:25:27 -05:00