Commit Graph
92 Commits
Author SHA1 Message Date
Chris Scott a00db28fa4 Switch MCP management to use OpenCode server API with version requirement >=1.0.137 2025-12-09 18:33:39 -05:00
OpenCode Assistant 42149c4759 Fix mobile input UI issues
- Fix down arrow disappearing at bottom and model visibility
- Only hide secondary buttons on mobile during active streaming, not when scroll button shows
- Fix stop button to only show during actual session processing (busy/retry states)
- Integrate session status with streaming state for better stop button control
2025-12-08 13:52:40 +00:00
OpenCode Assistant 9608d1ce19 Fix mobile layout button overflow in PromptInput
Hide model selector and help dropdown on mobile when processing
or when scroll-to-bottom button is visible to prevent button
overflow on narrow screens.
2025-12-08 05:15:33 +00:00
Chris Scott c1aa8ba101 Fix critical linting errors and React hooks violations 2025-12-07 23:51:17 -05:00
Chris Scott f48acfa06b Add retry handling components and session status management 2025-12-07 23:47:54 -05:00
Chris Scott 7fdf776b50 Add message queuing and retry handling with status indicators 2025-12-07 23:47:23 -05:00
Chris Scott 42b5eff728 Restart OpenCode server after OAuth callback with loading UI 2025-12-07 23:26:11 -05:00
Chris Scott bc99c96021 Add OAuth provider authentication support (#14)
* feat: Implement OAuth support for provider authentication

- Add OAuth routes and API endpoints for authorize/callback flows
- Create OAuthAuthorizeDialog and OAuthCallbackDialog components
- Extend ProviderSettings to support both OAuth and API key auth
- Add OAuth credential support to auth service
- Update shared schemas with OAuth request/response types
- Support both 'auto' and 'code' OAuth flows
- Maintain backward compatibility with existing API key authentication

Backend:
- backend/src/routes/oauth.ts (new)
- backend/src/services/auth.ts (extended)
- backend/src/index.ts (route registration)

Frontend:
- frontend/src/api/oauth.ts (new)
- frontend/src/components/settings/OAuthAuthorizeDialog.tsx (new)
- frontend/src/components/settings/OAuthCallbackDialog.tsx (new)
- frontend/src/components/settings/ProviderSettings.tsx (enhanced)

Shared:
- shared/src/schemas/auth.ts (OAuth schemas)

* feat: Complete OAuth implementation with comprehensive features

- Add comprehensive error handling for OAuth failures with specific error messages
- Implement OAuth token status checking and expiration monitoring
- Add token refresh preparation with 5-minute expiration buffer
- Enhance OAuth API client with detailed error reporting
- Update OAuth routes to include database parameter and token status endpoint
- Add complete OAuth documentation to README with setup guide
- Improve user experience with clear error messages and troubleshooting steps
- Support both auto and code OAuth flows for different providers
- Maintain backward compatibility with existing API key authentication

Error Handling:
- Specific error messages for invalid codes, expiration, access denied
- Graceful fallback for server errors and network issues
- User-friendly error display in OAuth dialogs

Token Management:
- Token status endpoint for checking credential validity
- Expiration monitoring with automatic refresh preparation
- Secure storage of OAuth credentials alongside API keys

Documentation:
- Complete OAuth setup guide in README
- Comparison table for OAuth vs API keys
- Troubleshooting section for common OAuth issues

* fix: Resolve OAuth button opening API key dialog instead

- Add isOAuthMode state to track authentication mode
- Update API key dialog to only open when not in OAuth mode
- Modify OAuth and API key button handlers to set proper mode
- Add proper cleanup handlers to reset OAuth mode on close
- Ensure dialog state management prevents conflicting dialogs

This fixes the issue where clicking 'Add OAuth' would incorrectly
open the API key dialog instead of the OAuth authorization dialog.

* refactor: Address audit findings for OAuth implementation

Critical fixes:
- Remove unused db parameter from createOAuthRoutes()
- Add query invalidation in handleOAuthSuccess to update UI after OAuth
- Remove unused setOAuth and getOAuthWithRefreshCheck methods
- Fix file permission in delete method (add mode: 0o600)

DRY improvements:
- Extract duplicated error handling to shared oauthErrors.ts utility
- Add OAuthMethod constants to replace magic numbers 0/1
- Use centralized OPENCODE_SERVER_URL constant via ENV config
- Remove unused ProviderAuthMethodsResponseSchema import

Code quality:
- Add documentation comment noting types should match shared schemas
- Consolidate error mapping logic into single mapOAuthError function
- Improve code maintainability and reduce duplication

Files changed:
- backend/src/routes/oauth.ts
- backend/src/services/auth.ts
- backend/src/index.ts
- frontend/src/lib/oauthErrors.ts (new)
- frontend/src/api/oauth.ts
- frontend/src/components/settings/OAuthAuthorizeDialog.tsx
- frontend/src/components/settings/OAuthCallbackDialog.tsx
- frontend/src/components/settings/ProviderSettings.tsx

* Store model selection client-side with recent models display

* Limit provider settings to OAuth-capable providers only

* Remove unused code and consolidate model initialization into useModelSelection hook
2025-12-07 23:01:05 -05:00
Chris Scott ec1d96a77d Fix session caching - enable refetch on focus and reconnect 2025-12-07 14:34:35 -05:00
Chris Scott 08e3414677 Add swipe-back gesture navigation for mobile 2025-12-06 23:38:28 -05:00
Chris Scott 8aabb79328 Handle session.idle event to fix resumed sessions showing as active 2025-12-06 12:23:33 -08: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 e1b8fbce5e Add /details and /export slash commands 2025-12-05 18:22:54 -08:00
Chris Scott fc658627d9 Align command suggestions with file suggestions and support command arguments 2025-12-05 17:57:32 -08:00
Chris Scott 6828b668b0 Optimize model select dialog with memoized components and query caching 2025-12-05 16:38:43 -08:00
Chris Scott 6658d3ed6c Remove redundant back button from model select dialog 2025-12-05 16:27:09 -08:00
Chris Scott b11b3a227e Add getSessionModel utility function 2025-12-05 16:13:05 -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
Chris Scott c7d01b1c6e Add loading state to branch switcher during branch switch 2025-12-05 16:11:18 -08:00
Chris Scott e2e6ca07ae Update provider management and model selection UI 2025-12-05 12:30:05 -08:00
Chris Scott 23ec317c5c Fix branch switcher width and add text truncation 2025-12-05 07:56:12 -08:00
Chris Scott daf5754cc1 Replace branch button with dropdown in RepoCard 2025-12-05 07:35:35 -08:00
Chris Scott 73db8c491d Make file suggestions dropdown height responsive 2025-12-05 07:31:33 -08:00
Chris Scott fef761c860 fix: PWA scrolling on RepoDetail page 2025-12-05 07:17:27 -08:00
Chris Scott d197ab97ff fix: add min-h-0 to session list container for proper scrolling 2025-12-05 07:05:15 -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 8acd0da5cb Add branch refetch on dropdown open and window focus 2025-12-01 15:53:34 -08:00
Chris Scott b1af865915 Remove unused message queue files 2025-11-30 23:21:52 -05:00
Chris Scott 8665a4d0bb Fix command and file suggestions rendering position on mobile and desktop 2025-11-30 23:17:56 -05:00
Chris Scott deacb9f865 Add abort session fallback with retry mechanism
- Immediately re-enable input when user clicks Stop
- Retry abort API call every 3 seconds in background (max 10 retries)
- Force-complete messages locally so UI is not blocked
- Stop retrying when server confirms abort via SSE
2025-11-30 22:38:48 -05:00
Chris Scott af0dcac7c8 Add GitHub token environment variable support and improve git operations 2025-11-30 21:05:30 -05:00
Chris Scott 025b2990ed Add MessageSkeleton component and fix loading states in SessionDetail
- Create MessageSkeleton component for better loading UX
- Update SessionDetail to use skeleton loading instead of spinner
- Fix type conflicts by removing duplicate exports from schemas
- Improve loading state handling with proper conditional rendering
2025-11-30 16:06:41 -05:00
Chris Scott 8c0689eac8 Update UI components and refactor message display 2025-11-29 20:23:45 -05:00
Chris Scott d650287211 Fix CreateConfigDialog event propagation and mobile scrolling 2025-11-29 18:32:56 -05:00
Chris Scott c0c18a5bde Add settings dialogs and improve settings UI components 2025-11-29 18:01:25 -05:00
Chris Scott 28fddb638d Make repo name click toggle checkbox instead of navigation 2025-11-29 18:00:10 -05:00
Chris Scott 977507fa82 Add shadcn checkbox component and update repo/session cards 2025-11-29 17:56:33 -05:00
Chris Scott 7c257cddcd Use pointer events and timestamp lock for reliable scroll disengagement 2025-11-29 14:50:30 -05:00
Chris Scott 1b9bb87858 Fix auto-scroll using wheel/touch events and reduce mobile text spacing 2025-11-29 14:36:38 -05:00
Chris Scott d534ef1c6c Stop auto-follow on any user scroll event 2025-11-29 12:16:12 -05:00
Chris Scott 2d7de3496f Consolidate all scroll logic into useAutoScroll hook 2025-11-29 12:13:38 -05:00
Chris Scott 6c514120c3 Fix scroll-up during streaming not disabling auto-follow 2025-11-29 12:10:17 -05:00
Chris Scott 494d2907fa Move useAutoScroll hook to SessionDetail and pass scroll functions to children 2025-11-29 12:07:23 -05:00
Chris Scott 1204cbace9 Re-enable auto-scroll following when scrolled to bottom 2025-11-29 12:04:21 -05:00
Chris Scott 2a74d6d7f5 Extract scroll logic into reusable useAutoScroll hook 2025-11-29 12:00:46 -05:00
Chris Scott 652b08d363 Auto-scroll during streaming after user sends a message 2025-11-29 11:58:47 -05:00
Chris Scott 8317eb9e98 Simplify scroll behavior to only auto-scroll on initial session load 2025-11-29 10:11:52 -05:00
Chris Scott 298be46623 feat: add theme-aware OpenCode logo to header
- Add OpenCode wordmark logos for light and dark themes
- Update Header component to display logo on main page
- Enhance useTheme hook to return current theme state
- Implement responsive logo sizing for mobile devices
2025-11-29 10:01:08 -05:00