Settings Rearchitecture — Single Page with Subnav
Objective
Section titled “Objective”Consolidate all user-facing settings into a single page at /settings, with Workspace settings at the top and Account settings below. Reuse the existing “user menu subnav” visual style for an indented in-page subnav. The subnav must support scrollspy (active highlight on scroll) and smooth-scrolling when clicking items.
Information Architecture and Anchors
Section titled “Information Architecture and Anchors”- Page:
/settings - Sections and anchors (top-to-bottom):
- Workspace
#workspace#workspace-users#workspace-locations#workspace-data-sources#workspace-billing
- Account
#account#profile#auth#connections#billing-profiles
- Workspace
Redirects:
- Legacy Data Sources →
/settings#workspace-data-sources - Legacy Connections →
/settings#connections - Legacy Workspace Settings →
/settings#workspace - Legacy Account Settings →
/settings#account
Navigation Changes
Section titled “Navigation Changes”Sidebar (left app nav):
- Top:
- Expand/collapse
- Workspace selector
- Grids
- Leads
- Settings →
/settings(replaces Workspace Settings)
- Bottom (user menu popover):
- Keep the current subnav style and component. Update its items/links to:
- Account settings →
/settings#account - Billing settings →
/settings#billing-profiles
- Account settings →
- Keep the current subnav style and component. Update its items/links to:
Notes:
- We are keeping the existing subnav styling; only the labels and hrefs change to point into the single page.
Page and Component Structure
Section titled “Page and Component Structure”New route and layout:
apps/web-app/src/routes/Settings/SettingsPage.tsx— renders the whole settings pageapps/web-app/src/components/Settings/SettingsLayout.tsx— two-column layout- Left: sticky subnav using the existing “user menu subnav” styles (indented list)
- Right: stacked section blocks with matching
idattributes for anchors
Subnav and scrollspy:
apps/web-app/src/components/Settings/SettingsSubnav.tsx- Reuse user menu subnav component styles (same tokens/classes)
- Items are grouped headings (Workspace, Account) with indented child items (users, locations, etc.)
apps/web-app/src/hooks/useScrollSpy.ts(IntersectionObserver) — existing or new hook
Sections (content components):
- Workspace
WorkspaceOverviewSection(optional minimal anchor header) — idworkspaceUsersSection— idworkspace-usersLocationsSection— idworkspace-locationsDataSourcesSection— idworkspace-data-sources(moved here)WorkspaceBillingSection— idworkspace-billing
- Account
AccountOverviewSection(optional anchor header) — idaccountProfileSection— idprofileAuthSection— idauth(change password, connect google)ConnectionsSection— idconnections(moved here)BillingProfilesSection— idbilling-profiles
Routing and Constants
Section titled “Routing and Constants”apps/web-app/src/routes/routes.ts- Add
Routes.Settings = '/settings' - Remove prior
WorkspaceSettingsandAccountSettingsconstants if present
- Add
- Legacy redirects
- Add lightweight redirect components for old paths to
/settings#…
- Add lightweight redirect components for old paths to
Subnav Behavior (requirements)
Section titled “Subnav Behavior (requirements)”- Keep the exact look-and-feel of the current user menu subnav (typography, spacing, hover/active states)
- Indentation to visually indicate subsections under Workspace and Account
- Smooth scroll on click; update
history.replaceStateto reflect the hash - Scrollspy updates active item based on visible section (offset to account for header height)
- Keyboard and screen-reader friendly (focus moves to section heading on navigation)
Data and Forms
Section titled “Data and Forms”- Reuse existing queries/mutations for users, locations, data sources, connections, and billing profiles
- Place forms and actions within their respective sections; show toasts and inline validation
- Permissions:
- Workspace sections gated by role (owner/admin vs member)
- Account sections available to the authenticated user
Telemetry
Section titled “Telemetry”- Emit events for subnav navigation and settings updates, including section and result (success/failure)
Testing
Section titled “Testing”- Unit:
useScrollSpy, subnav renders and active state handling - Integration: form submit → mutation → refetch per section
- E2E: deep-link to anchors, ensure scrollspy highlights correct item; verify legacy redirects
Work Breakdown
Section titled “Work Breakdown”- Routing and Sidebar
- Add
/settingsroute constant and page; add legacy redirects - Update sidebar: replace “Workspace Settings” with “Settings” →
/settings - Update user menu subnav items to anchor into
/settings
- Subnav and Layout
- Build
SettingsLayouttwo-column layout; sticky subnav (desktop), collapsible on mobile - Implement
SettingsSubnavusing existing user menu styles; wireuseScrollSpy
- Workspace Sections
- Implement Users, Locations, Data Sources, Workspace Billing sections; connect existing hooks
- Account Sections
- Implement Profile, Auth, Connections, Billing Profiles; connect existing hooks
- QA and Accessibility
- Responsive polish; keyboard focus to section headings on nav
- Tests and telemetry validation; copy/empty states
Milestones
Section titled “Milestones”✅ Milestone 1 — Shell, Nav, and Scaffolding (COMPLETED)
Section titled “✅ Milestone 1 — Shell, Nav, and Scaffolding (COMPLETED)”- ✅ Routing: added
/settingsroute and legacy redirects to anchors - ✅ Sidebar: replaced Workspace Settings with Settings →
/settings, moved Toggle Sidebar above Grids - ✅ Subnav: implemented
SettingsSubnavwith user menu styling, scrollspy, and smooth scroll - ✅ Scaffolding: rendered all section headers in page order with ids
- ✅ User menu: updated to use React Router Links instead of page reload, removed modal components
- Status: All acceptance criteria met. Deep-linking works, scrollspy active highlighting works, legacy redirects functional.
🔄 Milestone 2 — Workspace Sections Wiring (IN PROGRESS)
Section titled “🔄 Milestone 2 — Workspace Sections Wiring (IN PROGRESS)”- ✅ Users Section: Fully implemented with ListRecordLayout pattern
- ✅ Table and card views with toggle
- ✅ Add User panel (Sheet-based RecordPanel)
- ✅ Perfect table borders: light gray/brown top, font-color header bottom, light gray/brown row bottoms
- ✅ Zero state with proper padding and styling
- ✅ Locations Section: Fully implemented with ListRecordLayout pattern
- ✅ Table and card views with toggle
- ✅ Add Location panel with Google Places integration
- ✅ Consistent table border styling matching Users
- ✅ Zero state with proper padding
- 🚧 Data Sources Section: Needs conversion to ListRecordLayout pattern
- 🚧 Connections Section: Needs conversion to ListRecordLayout pattern
- Current Status: Users and Locations sections complete with consistent UI patterns. Need to convert remaining sections.
Milestone 3 — Account Sections Wiring
Section titled “Milestone 3 — Account Sections Wiring”- Profile, Auth (password/google connect), Connections (moved): connect live data/actions
- Remove “(coming soon)” from wired Account sections
- Acceptance:
- Profile edits persist; auth flows functional; connections settings parity with legacy
Milestone 4 — Billing Scaffolding (Follow-up Project)
Section titled “Milestone 4 — Billing Scaffolding (Follow-up Project)”- Keep
Workspace BillingandBilling Profilesheaders rendered with “(coming soon)” - Add read-only placeholders and telemetry for interest; no live mutations
- Acceptance:
- Sections present, clearly labeled; no dead links or broken actions
Milestone 5 — QA, A11y, and Telemetry
Section titled “Milestone 5 — QA, A11y, and Telemetry”- A11y focus management on in-page nav; keyboard nav verified
- E2E for anchors, scrollspy, redirects, and critical edits
- Observability: events for subnav navigation and successful saves
- Acceptance:
- All checks pass; no regressions in legacy entry points
Implementation Progress
Section titled “Implementation Progress”✅ Completed Components
Section titled “✅ Completed Components”apps/web-app/src/routes/Settings/SettingsPage.tsx- Main settings page with Section/SubSection layoutapps/web-app/src/components/Settings/SettingsSubnav.tsx- Indented subnav with scrollspyapps/web-app/src/hooks/useScrollSpy.ts- IntersectionObserver-based scrollspy hookapps/web-app/src/hooks/usePanelState.ts- URL-driven state management for List/Record panelsapps/web-app/src/components/ui/section.tsx- Section, SubSection, SectionHeading primitivesapps/web-app/src/components/ListRecordLayout/- Reusable List/Record panel patternListRecordLayout.tsx- Main layout orchestratorListPanel.tsx- Left panel with search, view toggle, add buttonRecordPanel.tsx- Right slide-in Sheet for record CRUD
apps/web-app/src/components/Settings/Users/- Complete Users sectionUsers.tsx- Main component using ListRecordLayoutUsersTable.tsx- Table view with perfect border stylingUsersCards.tsx- Card viewUserRecordPanel.tsx- User invitation/editing form
apps/web-app/src/components/Settings/Locations/- Complete Locations sectionLocationsList.tsx- Main component using ListRecordLayoutLocationsTable.tsx- Table view with consistent border stylingLocationsCards.tsx- Card viewLocationRecordPanel.tsx- Location creation/viewing form
apps/web-app/src/components/app-sidebar.tsx- Updated with single Settings link and Toggle Sidebarapps/web-app/src/components/nav-user.tsx- Updated user menu with React Router Linksapps/web-app/src/routes/LegacyRedirects/SettingsRedirects.tsx- Legacy URL redirects
🚧 Next Steps
Section titled “🚧 Next Steps”- Convert Data Sources section to ListRecordLayout pattern
- Convert Connections section to ListRecordLayout pattern
- Implement Account sections (Profile, Authentication, Billing Profiles)
Key Design Patterns Established
Section titled “Key Design Patterns Established”ListRecordLayout Pattern
Section titled “ListRecordLayout Pattern”A consistent pattern for sections with lists of records (Users, Locations, Data Sources, Connections):
- ListPanel (left): Title, search, table/card view toggle, “Add” button
- RecordPanel (right): Slide-in Sheet for viewing/creating/editing records
- URL State: Entity, view mode, recordId, and panel mode managed via query parameters
- Consistent Styling: All tables use the same 3-border pattern with brand colors
Table Border Standards
Section titled “Table Border Standards”Established consistent table styling across all sections:
- Top border: 1px light gray/brown (
border-t-[#3A2E2F]/20) - Header bottom border: 1px standard font color (
border-b-[#3A2E2F]) - Row borders: 1px light gray/brown bottom borders (
border-b-[#3A2E2F]/20)
Section Layout Standards
Section titled “Section Layout Standards”- Section:
py-8vertical padding, contains multiple SubSections - SubSection:
py-6vertical padding, optional separator line - Consistent horizontal padding: Applied at page level (
px-6) for perfect alignment