Commit Graph
35 Commits
Author SHA1 Message Date
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 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 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 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 f12654ce66 Fix session model detection to use actual session model instead of default preference 2025-12-05 16:11:48 -08:00
Chris Scott 73db8c491d Make file suggestions dropdown height responsive 2025-12-05 07:31:33 -08: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 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 1b9bb87858 Fix auto-scroll using wheel/touch events and reduce mobile text spacing 2025-11-29 14:36:38 -05:00
Chris Scott 2d7de3496f Consolidate all scroll logic into useAutoScroll hook 2025-11-29 12:13:38 -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 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 ae929a7c96 Fix intermittent mobile scroll lock and suppress expected git errors on empty repos 2025-11-29 00:02:10 -05:00
Chris Scott f90683071f Fix mobile scroll on session reload and git errors on empty repos 2025-11-28 22:33:51 -05:00
Chris Scott fb91b4d3a3 Add TTS support with OpenAI-compatible endpoint configuration
- Add TTS settings schema and configuration UI with validation
- Create backend TTS proxy with 24hr file-based caching
- Add frontend useTTS hook with Cache API caching
- Add TTS playback button on assistant messages (step-finish)
- Include test button to verify TTS configuration
2025-11-28 19:52:35 -05:00
Chris Scott 283348b64f fix mobile styles 2025-11-28 17:42:58 -05:00
Chris Scott ca8037e192 Remove extra padding from prompt input on mobile 2025-11-28 17:29:21 -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 9a2ebc9652 Fix mobile chat layout overflow and sticky prompt input 2025-11-27 22:00:36 -05:00
Chris Scott 4cac704207 Optimize file browser performance with memoization and improve virtualized text rendering 2025-11-27 14:19:33 -05:00
Chris Scott 6c88f23b5f Fix iOS keyboard background and add PWA standalone detection 2025-11-27 11:24:47 -05:00
Chris Scott 44c42990cd redesign prompt input with unified layout and floating container 2025-11-26 23:59:43 -05:00
Chris Scott 1723fa1d38 truncate long model names 2025-11-25 16:52:08 -05:00
Chris Scott 349c130311 Fix Docker build: use pnpm workspaces and route frontend API calls through backend proxy 2025-11-25 14:17:17 -05:00
Chris Scott d9ee1a67b7 fix: improve model display and session header layout 2025-11-25 09:52:08 -05:00
Chris Scott 614557ba30 fix: add fixed width to mode toggle button to prevent layout shift 2025-11-24 10:37:18 -05:00
Chris Scott bbf66c259b Initial release v0.2.5 2025-11-23 23:25:27 -05:00