Skip to content

Conversation

@ShivaGupta-14
Copy link
Contributor

@ShivaGupta-14 ShivaGupta-14 commented Oct 28, 2025

Solves Issue #566

This PR implements the user settings page, introducing account management features and folder list pagination as outlined in the issue.

Path

  • frontend/src/pages/SettingsPage.tsx
  • frontend/src/components/settings/AccountSettingsCard.tsx
  • frontend/src/features/onboardingSlice.ts

Approach

Problem

  • The Settings Page was a placeholder and lacked core functionality.
  • Users had no way to update their account details, such as their display name or profile icon.
  • The folder list displayed all items at once, making the page long and cluttered for users with many folders.

Solution

  • Implemented an Account Information section where users can update their display name and select a new avatar.
  • Added client-side validation to the name input field to prevent empty submissions.
  • Persisted the user's name and avatar choice in localStorage to maintain state across sessions.
  • Limited the initial display of folders to 6 and added a "View More" button to incrementally load the next set, cleaning up the UI.

Testing Done

  • Verified that updating the name and selecting an avatar works correctly and saves to localStorage.
  • Tested the input validation by attempting to save an empty name, which correctly displays an error state.
  • Checked that the folder list is properly paginated and the "View More" button functions as expected.

Summary

  • New Features

    • Added an Account Settings section allowing users to change their display name and profile avatar.
    • Introduced pagination for the folder list to improve readability and performance.
  • UX Improvements

    • Added input validation with clear error messaging for a better user experience.
    • The folder list is now clean and navigable, regardless of the number of items.

Summary by CodeRabbit

  • New Features

    • Settings reorganized into General and Account tabs for easier navigation
    • Account settings allow updating display name and choosing a highlighted avatar
    • Folder list shows a limited preview with a "View More" button to load more items in batches
  • Bug Fixes / UX Improvements

    • Save flow validates name and blocks saving with an empty name; Save button disabled until an avatar is selected

This commit introduces the initial implementation of the user settings page, providing core account management features and improving the UI.

Key features include:

- Users can now update their display name and select a profile avatar from the account section.

- The folder list is now restricted to an initial view of 6 items, with a 'View More' button for more.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 28, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds a tabbed Settings UI (General vs Account), a new AccountSettingsCard to edit and persist user name/avatar, and incremental folder loading in FolderManagementCard with a "View More" button and per-folder rendering adjustments.

Changes

Cohort / File(s) Summary
Settings Page Tabbed UI
frontend/src/pages/SettingsPage/Settings.tsx
Added activeTab state and tab header; toggles rendering between General (FolderManagementCard, UserPreferencesCard, ApplicationControlsCard) and Account (AccountSettingsCard); added page title header and minor layout adjustments.
New Account Settings Component
frontend/src/pages/SettingsPage/components/AccountSettingsCard.tsx
New default-exported AccountSettingsCard React component. Initializes name and selectedAvatar from localStorage, provides avatar selection grid from central avatars list, validates name input, dispatches setName/setAvatar to onboarding slice on save, and persists to localStorage. Save button disabled when no avatar selected.
Folder Pagination & Rendering
frontend/src/pages/SettingsPage/components/FolderManagementCard.tsx
Added visibleFoldersCount state (initial 6) and handleViewMore to increment by 5; renders folders.slice(0, visibleFoldersCount); uses folder.folder_id as key; conditionally shows "View More"; per-folder AI tagging/progress reads from taggingStatus[folder.folder_id].

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant SettingsPage
  participant AccountCard
  participant FolderCard
  participant Redux as OnboardingSlice
  participant Storage as localStorage

  User->>SettingsPage: open Settings
  SettingsPage->>SettingsPage: render tab header
  alt selects "Account" tab
    SettingsPage->>AccountCard: mount AccountSettingsCard
    User->>AccountCard: edit name / choose avatar
    AccountCard->>AccountCard: validate input
    User->>AccountCard: click Save
    AccountCard->>Redux: dispatch setName/setAvatar
    AccountCard->>Storage: persist name/avatar
    Note right of AccountCard: Save disabled if no avatar selected
  else selects "General" tab
    SettingsPage->>FolderCard: mount FolderManagementCard
    FolderCard->>FolderCard: render folders[0..N-1] (N=6)
    User->>FolderCard: click "View More"
    FolderCard->>FolderCard: increase N by 5 and re-render
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Inspect localStorage initialization and persistence in AccountSettingsCard.tsx.
  • Verify Redux dispatch payloads and onboarding slice compatibility.
  • Confirm keys and slicing logic in FolderManagementCard.tsx and "View More" visibility.
  • Check tab keyboard accessibility and active state handling in Settings.tsx.

Possibly related issues

Possibly related PRs

Suggested labels

enhancement

Poem

🐰 Tabs hop in, all neat and bright,
Name and avatar find their light,
Folders show a few then more,
Click "View More" to explore,
A rabbit cheers — settings in sight!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The PR title "feat: Implement settings page functionality" accurately relates to the changeset's overall purpose and is concise and readable. However, the title is quite generic and doesn't clearly communicate the specific, meaningful features being implemented. The PR introduces several key capabilities: a tabbed UI with Account Settings for managing user display name and avatar selection, client-side validation for name input, localStorage persistence, and folder list pagination with a "View More" button. While the title captures the high-level intent, a teammate scanning history would not immediately understand what specific functionality was added without viewing the full PR details. Consider refining the title to be more specific about the key features implemented. A more descriptive title such as "Add Account Settings tab and folder pagination to Settings page" or "Implement tabbed Settings page with account management" would better communicate the primary changes while remaining concise and helping teammates understand the changeset at a glance.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4280082 and 1e67430.

📒 Files selected for processing (2)
  • frontend/src/pages/SettingsPage/components/AccountSettingsCard.tsx (1 hunks)
  • frontend/src/pages/SettingsPage/components/FolderManagementCard.tsx (4 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
frontend/src/pages/SettingsPage/Settings.tsx (1)

39-51: Remove unnecessary fragments.

The empty fragments wrapping the tab content (lines 40-44 and 48-50) serve no purpose and can be removed for cleaner code.

Apply this diff:

           <div className="mt-6 space-y-8">
             {activeTab === 'general' && (
-              <>
+              <div className="space-y-8">
                 <FolderManagementCard />
                 <UserPreferencesCard />
                 <ApplicationControlsCard />
-              </>
+              </div>
             )}
 
             {activeTab === 'account' && (
-              <>
+              <div className="space-y-8">
                 <AccountSettingsCard />
-              </>
+              </div>
             )}
           </div>

Or simply remove the fragments entirely since the parent div already has the spacing classes.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 433a1bb and 9a61e23.

📒 Files selected for processing (3)
  • frontend/src/pages/SettingsPage/Settings.tsx (1 hunks)
  • frontend/src/pages/SettingsPage/components/AccountSettingsCard.tsx (1 hunks)
  • frontend/src/pages/SettingsPage/components/FolderManagementCard.tsx (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
frontend/src/pages/SettingsPage/components/AccountSettingsCard.tsx (2)
frontend/src/features/onboardingSlice.ts (2)
  • setName (28-30)
  • setAvatar (25-27)
frontend/src/constants/avatars.ts (1)
  • avatars (1-10)
frontend/src/pages/SettingsPage/components/FolderManagementCard.tsx (2)
frontend/src/components/ui/switch.tsx (1)
  • Switch (29-29)
frontend/src/components/ui/progress.tsx (1)
  • Progress (37-37)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Tauri Build Check (windows-latest)
  • GitHub Check: Tauri Build Check (ubuntu-22.04)
  • GitHub Check: Tauri Build Check (macos-latest, --target aarch64-apple-darwin)
  • GitHub Check: Backend Tests
🔇 Additional comments (3)
frontend/src/pages/SettingsPage/components/FolderManagementCard.tsx (2)

1-1: LGTM: Pagination state setup is clean.

The pagination implementation with visibleFoldersCount starting at 6 and incrementing by 5 provides a good progressive disclosure pattern.

Also applies to: 32-36


139-147: LGTM: View More button implementation is correct.

The conditional rendering and click handler correctly implement progressive disclosure of folder items.

frontend/src/pages/SettingsPage/components/AccountSettingsCard.tsx (1)

33-38: LGTM: Name validation UX is user-friendly.

Clearing the error state on input change provides immediate feedback and good user experience.

@rahulharpal1603 rahulharpal1603 linked an issue Oct 28, 2025 that may be closed by this pull request
7 tasks
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9a61e23 and 4280082.

📒 Files selected for processing (2)
  • frontend/src/pages/SettingsPage/components/AccountSettingsCard.tsx (1 hunks)
  • frontend/src/pages/SettingsPage/components/FolderManagementCard.tsx (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/src/pages/SettingsPage/components/FolderManagementCard.tsx
🧰 Additional context used
🧬 Code graph analysis (1)
frontend/src/pages/SettingsPage/components/AccountSettingsCard.tsx (2)
frontend/src/features/onboardingSlice.ts (2)
  • setName (28-30)
  • setAvatar (25-27)
frontend/src/constants/avatars.ts (1)
  • avatars (1-10)
🪛 GitHub Actions: PR Check
frontend/src/pages/SettingsPage/components/AccountSettingsCard.tsx

[warning] 1-1: Code style issues found in the above file. Run 'prettier --write' to fix.


[error] 1-1: Prettier formatting check failed. Run 'prettier --write' to fix code style issues in this file.

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Tauri Build Check (windows-latest)

@ShivaGupta-14 ShivaGupta-14 deleted the feat/settings-page branch October 28, 2025 19:57
@ShivaGupta-14
Copy link
Contributor Author

ShivaGupta-14 commented Oct 28, 2025

I think something happen in my setup, I will open a new PR again.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat: Implement Settings UI Completely

1 participant