* refactor: remove cached-api in favor of direct fetch functions
* fix: update auto-pr test mocks for cached-api removal
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: willsather <56037657+willsather@users.noreply.github.com>
Co-authored-by: willsather <will@sather.ws>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Improve React performance: parallelize fetches, dynamic imports, memoization
- Parallelize independent server-side data fetches with Promise.all in page.tsx
- Add next/dynamic for DiffViewer, CreatePRDialog, CreateRepoDialog modals
- Add optimizePackageImports for lucide-react in next.config.ts
- Memoize SessionChatContext provider value (36 properties)
- Memoize derived state (renderMessages, lastMessage, showThinkingIndicator)
- Convert sandboxUiStatus IIFE to useMemo
- Use messages.length in scroll effect dependency array
- Update audit doc to mark fixed items
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Address remaining React best practices audit items
- Add loading.tsx/error.tsx for key route segments (Suspense boundaries)
- Replace hasMounted useState+useEffect with useSyncExternalStore
- Extract ChatSidebar component from monolithic SessionChatContent
- Replace direct fetch with SWR in CreateRepoDialog for cache sharing
- Convert conditional && rendering to explicit ternaries
- Remove unused react-hook-form, @hookform/resolvers, form.tsx, chat-context.tsx
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Move sidebar to session layout so it persists during chat navigation
The loading spinner was replacing the entire page (including sidebar)
when switching between chats, causing a jarring flash. By introducing a
Next.js layout at the session level, the sidebar stays mounted and only
the chat content area shows the loading state during navigation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Show session name and input shell in chat loading state
Instead of a full-page spinner, the chat loading state now preserves
the header (with real session/repo name from layout context) and an
input area shell so only the messages area shows the loading spinner.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix input height mismatch in loading skeleton and suppress overlay flash
Use a real disabled textarea in the loading skeleton so height matches
the actual input exactly. Also hide the sandbox overlay during initial
reconnection (idle state) to prevent the Resume/Create buttons from
flashing briefly on navigation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Improve web chat route responsiveness by removing fetch waterfalls, caching repeated setup work, and trimming initial session payloads.
* Improve chat UI responsiveness with memoized message grouping and smarter polling backoff.
* Improve GitHub repo fetch performance with cached installation queries
* Fix chat auto-scroll during streaming updates
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
* feat: unified GitHub App install + OAuth flow with per-org install UI
Replaces the two-step OAuth-then-install flow with a single GitHub App
installation flow that handles OAuth authorization inline (via GitHub's
'Request user authorization during installation' setting).
- Add app callback OAuth code exchange so install + account link happen
in one redirect
- Use /installations/select_target URL to always show the account/org
picker (fixes redirect to existing personal install settings)
- Add per-org install via target_id for direct org install links
- Add /api/github/orgs/install-status endpoint returning per-org
install state with GitHub IDs
- Rebuild accounts settings page with per-org status rows, install/
configure actions, request-access guidance, and post-return toasts
- Delete the separate OAuth link routes (no longer needed)
- Add sonner for toast notifications
- Update repo-selector-compact wording to 'Install to organization'
- Document GitHub App setup requirements (public app, OAuth during
install, callback URL) in .env.example and AGENTS.md
* Fix GitHub app callback auth and installation sync pagination
* Fix GitHub reconnect after disconnect skipping install page
After disconnecting GitHub, the app only revoked the OAuth token but the
GitHub App installation remained. Clicking Connect again sent users to
the install page which redirected to existing installation settings
instead of re-authorizing.
Use a github_reconnect cookie set during disconnect to route reconnects
through the OAuth authorize URL, re-linking the account and syncing
existing installations without requiring a fresh app install.
* Fix installation upsert conflict and initial repo push token
* Fix repo creation to use installation tokens and add owner picker
Use installation tokens for org repo creation (createInOrg) and user
OAuth tokens for personal accounts. Add account/org picker to the
create repo dialog so users select where to create the repository.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix repo creation push token and missing installation handling
Return an error when the requested owner has no GitHub App installation
instead of silently falling back to the user's personal account. Use
installation token for push only on org repos — personal accounts use
the OAuth token that created the repo to avoid permission gaps when the
installation has "selected repositories" access.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>