Skip to content

feat(settings): Add Settings Page with UX improvements#231

Merged
DevanshuNEU merged 5 commits into
OpenCodeIntel:mainfrom
DevanshuNEU:feat/settings-page
Jan 29, 2026
Merged

feat(settings): Add Settings Page with UX improvements#231
DevanshuNEU merged 5 commits into
OpenCodeIntel:mainfrom
DevanshuNEU:feat/settings-page

Conversation

@DevanshuNEU

@DevanshuNEU DevanshuNEU commented Jan 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a Settings page accessible from the user avatar dropdown with proper UX patterns.

Changes

Settings Page (SettingsPage.tsx)

  • Profile section: Email and member since date
  • Connections section: GitHub connection status with disconnect button
  • Repositories section: Shows X/3 slots used (free tier)
  • Danger Zone: Delete all repos with typing confirmation

Navigation Improvements

  • Removed from sidebar: Settings and Global Search (cleaner nav)
  • Settings in avatar dropdown: More intuitive location
  • Fixed dropdown click-outside: Replaced custom implementation with shadcn DropdownMenu

UX Improvements

  • Typing confirmation for destructive actions: Must type "delete all" to enable delete button (GitHub-style pattern)
  • Removed fake delete account button: Was a non-functional placeholder that just signed out
  • Loading states: Skeleton components while data loads
  • Uses shadcn components: Card, Dialog, Alert, Badge, Separator, Skeleton, DropdownMenu

Testing

  1. Click avatar → Settings link works, dropdown closes on outside click
  2. Settings page loads with correct user data
  3. GitHub disconnect works (if connected)
  4. Delete all repos requires typing "delete all" to enable button
  5. Sidebar only shows Repositories and Documentation

Part of Polish Sprint

  • Settings Page MVP
  • Staging environment setup
  • Sentry error monitoring
  • Landing page update

Summary by CodeRabbit

  • New Features

    • Settings page: profile, GitHub connection management, repository overview, and bulk delete with typed confirmation.
  • Navigation

    • Dashboard now uses internal routing: home, settings, and fallback to dashboard home.
    • Sidebar: removed Global Search and Settings entries.
  • UI Improvements

    • Replaced manual user menu with a structured dropdown in the top navigation.

✏️ Tip: You can customize this high-level summary in your review settings.

- Profile section with email and member since date
- GitHub connection status with disconnect button
- Repository slots display (X/3 free tier)
- Danger zone with delete repos and delete account
- All actions have confirmation dialogs
- Uses Card, Dialog, Alert, Badge, Separator, Skeleton components
- Loading states and error handling included
- Remove delete account button (was non-functional placeholder)
- Add typing confirmation for delete repos ('delete all' required)
- Remove Settings and Global Search from sidebar (Settings in avatar)
- Replace custom dropdown with shadcn DropdownMenu (fixes click-outside)
- Cleaner sidebar with just Repositories and Documentation
@vercel

vercel Bot commented Jan 29, 2026

Copy link
Copy Markdown

@DevanshuNEU is attempting to deploy a commit to the Dev's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jan 29, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Replaces direct DashboardHome render with React Router Routes in Dashboard layout, removes Global Search and Settings items from Sidebar, replaces TopNav's manual user menu with a shadcn DropdownMenu, and adds a new SettingsPage for profile, GitHub connections, repo management, and a typed "Delete All" flow.

Changes

Cohort / File(s) Summary
Routing / Dashboard Layout
frontend/src/components/Dashboard.tsx
Replaced direct DashboardHome render with a Routes block: index → DashboardHome, settingsSettingsPage, *Navigate to /dashboard. Added imports for Routes, Route, Navigate, and SettingsPage.
Sidebar
frontend/src/components/dashboard/Sidebar.tsx
Removed Global Search and Settings navigation items and their icon imports; remaining nav unchanged.
Top Navigation
frontend/src/components/dashboard/TopNav.tsx
Removed local dropdown state and manual menu markup; introduced shadcn DropdownMenu components and reorganized imports; avatar/label preserved and command palette position retained.
Settings Page
frontend/src/pages/SettingsPage.tsx
Added SettingsPage component implementing Profile, GitHub Connections (status + disconnect), Repositories view with slot counts, confirmation dialog requiring exact typed input to "Delete All", per-repo DELETE loop, loading states, toasts, and relevant UI components.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Browser
    participant SettingsPage as Settings Page
    participant UserContext as User Context
    participant GitHubHook as useGitHubRepos Hook
    participant API as Backend API

    User->>Browser: Navigate to /dashboard/settings
    Browser->>SettingsPage: Render SettingsPage
    SettingsPage->>UserContext: Read user profile
    UserContext-->>SettingsPage: Return profile (email, member since)
    SettingsPage->>GitHubHook: Fetch connection state & repos
    GitHubHook-->>SettingsPage: Return connected state + repo list

    User->>SettingsPage: Click "Delete All Repos"
    SettingsPage->>User: Show confirmation dialog
    User->>SettingsPage: Enter confirmation text & confirm

    loop for each repo
        SettingsPage->>API: DELETE /api/repos/:repoId
        API-->>SettingsPage: 200 OK / error
    end

    SettingsPage->>SettingsPage: Clear repos state
    SettingsPage->>User: Show success or error toast
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I hopped through routes and tidy menus bright,

Settings lined up in a cozy sight,
GitHub paws counted, repos in a row,
A typed "delete all" — then watch them go,
I nibble carrots and cheer the light.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(settings): Add Settings Page with UX improvements' accurately reflects the main change: introducing a new Settings page with navigation and UX improvements, as evidenced by the new SettingsPage.tsx component and modifications to navigation components.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@frontend/src/pages/SettingsPage.tsx`:
- Around line 48-61: The fetchRepos function currently calls response.json()
without checking HTTP status; update fetchRepos to inspect response.ok after the
fetch to handle non-2xx responses: if response.ok parse the JSON and call
setRepos(data.repositories || []), otherwise parse or read the error body (json
or text) for logging and either setRepos([]) or leave existing state and throw
or return early so error handling in the catch block runs; ensure
setReposLoading(false) still runs in finally. Reference: fetchRepos,
session?.access_token, API_URL, setRepos, setReposLoading.
- Around line 74-94: handleDeleteAllRepos currently sends DELETEs in a loop
without checking response.ok and unconditionally clears local repos on any
exception, leaving UI out of sync on partial failures; update
handleDeleteAllRepos to check each fetch response.ok (using API_URL and
session?.access_token) and if any response is not ok either throw or collect
failed IDs, stop further deletion on error (or continue but track failures),
only call setRepos([]), setDeleteReposDialog(false) and clear deleteConfirmation
when every delete succeeded, and in case of partial failures refetch the repo
list from the server to reconcile local state and show a toast that includes the
number or IDs of failed deletions so the user knows what remained; ensure
setDeleteReposLoading(false) still runs in finally.
🧹 Nitpick comments (2)
frontend/src/pages/SettingsPage.tsx (1)

43-46: Missing dependency in useEffect.

The checkStatus function from useGitHubRepos is called but not listed in the dependency array. This can cause stale closure issues if checkStatus changes between renders. React's exhaustive-deps rule would flag this.

♻️ Suggested fix
  useEffect(() => {
    checkStatus()
    fetchRepos()
-  }, [])
+  }, [checkStatus])

Alternatively, if checkStatus is not memoized in the hook, consider wrapping fetchRepos with useCallback and including both, or document why the empty dependency array is intentional (e.g., only run once on mount).

frontend/src/components/Dashboard.tsx (1)

9-13: Routing structure looks correct.

The nested Routes within DashboardLayout correctly handles the settings path. One minor consideration: the catch-all route renders DashboardHome at the mismatched URL rather than redirecting. This could leave users at URLs like /dashboard/typo showing the home content.

💡 Optional: Redirect unknown paths to clean URL
+import { Routes, Route, Navigate } from 'react-router-dom'
...
-        <Route path="*" element={<DashboardHome />} />
+        <Route path="*" element={<Navigate to="/dashboard" replace />} />

Comment thread frontend/src/pages/SettingsPage.tsx
Comment thread frontend/src/pages/SettingsPage.tsx
- fetchRepos: check response.ok before parsing JSON, log errors properly
- handleDeleteAllRepos: track failed deletions, refetch on partial failure
- Show toast with failed repo names on partial failure
- Reconcile local state with server on any error
- Add checkStatus to useEffect dependency array (avoid stale closure)
- Redirect unknown dashboard paths to /dashboard instead of showing home

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@frontend/src/pages/SettingsPage.tsx`:
- Line 133: The UI currently can display negative "slots available" when repo
count exceeds MAX_REPOS; locate where available slots are computed (use symbols
MAX_REPOS and the variable or expression that derives current repo count, e.g.,
repos.length or slotsAvailable) and clamp the result to zero (replace "MAX_REPOS
- currentCount" with "Math.max(0, MAX_REPOS - currentCount)") so the UI never
shows negatives; apply the same clamp to all places this calculation is used
(including the component that defines isDeleteEnabled and the code referenced
around lines for slots display).
- Around line 43-68: The effect currently only depends on checkStatus so
fetchRepos may return early when session?.access_token is not yet set and
reposLoading never gets cleared; update the hook so fetchRepos runs when the
session token appears by adding session?.access_token (or session) to the
useEffect dependency array and ensure fetchRepos always flips
setReposLoading(false) (or sets it to true before starting) even when returning
early; locate the useEffect and the fetchRepos function and modify dependencies
and loading state handling accordingly (functions: useEffect, fetchRepos,
setReposLoading, session, checkStatus).

Comment thread frontend/src/pages/SettingsPage.tsx
Comment thread frontend/src/pages/SettingsPage.tsx
- Add session?.access_token to useEffect deps (re-runs when auth loads)
- Set reposLoading=false on early return (prevents stuck loading state)
- Set reposLoading=true at start of fetch (consistent state)
- Clamp available slots to 0 (prevents negative display if repos > MAX)
@vercel

vercel Bot commented Jan 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
opencodeintel Ready Ready Preview, Comment Jan 29, 2026 6:49pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant