feat(web): settings rework — category-list → detail-subpage for global and repo settings #198
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab#198
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
Replace the two single long settings pages (
web/src/routes/Settings.tsx,web/src/routes/RepoSettings.tsx) with a category-list → detail-subpage structure (iOS Settings pattern), mobile-first, for both global and repo settings.Routes & responsive behavior
/settings/:sectionand/repos/:id/settings/:section./settings,/repos/:id/settings):general);/…/:sectionrenders a slim (~180px) inline category list beside the section content (master-detail). The category list is visually lighter than the app SideNav rail (plain text links, active one accented) so it doesn't read as rail-next-to-rail.Categories
Global (
/settings/…):generalagentsnotificationsRepo (
/repos/:id/settings/…):generalintegrationsbranchesagentsautolandsecretsdangerCategory metadata (slug, title, one-line description, icon, danger flag) lives in one array per settings area, driving routes, index rows, and the desktop category list from a single source.
Index rows & icons
dangerpinned last and styled in the app's danger red (index row and desktop list entry).lucide-solid(official Lucide package for SolidJS, ISC, tree-shakeable) — this issue adds the dependency. Render at 18–20px, inheritcurrentColor.Navigation chrome
Repos / <name> / Settings / <Section>, where "Settings" links to the index. Global settings stays breadcrumb-free.Save model
useSettingsFormprimitive owns dirty tracking, PATCH submit, and the unsaved-changes guard:useBeforeLeave(@solidjs/router) +beforeunload, both via nativeconfirm("Discard unsaved changes?").Code layout
RepoSettings.tsx(currently 1215 lines) andSettings.tsx(759) are dissolved into these files; every resulting file must land under the 1000-line cap.Acceptance criteria
/settingsand/repos/:id/settingsrender the category index on mobile and redirect togeneralon desktop;/…/:sectiondeep links work on both form factorsdangerlast and redlucide-solidadded; icons inheritcurrentColorin light and dark themes/repos/:id/settingskeep workingBlocked by
None - can start immediately
Agent Brief
Category: enhancement
Summary: Restructure global and repo settings from single long pages into a category-list → detail-subpage IA (mobile index, desktop master-detail), with per-section forms and an unsaved-changes guard.
Current behavior:
Global settings and repo settings each render as one long single-route page (
/settingsand/repos/:id/settings) containing every section stacked vertically. The repo settings component is over the 1000-line cap (currently ~1215 lines). Icons in the app are hand-inlined SVGs; there is no icon library dependency. Saves already use dirty-fields-only PATCH per section, but there is no navigation guard for unsaved edits.Desired behavior:
The issue body is the authoritative spec — categories, routes, responsive behavior, save model, and code layout are all defined there. The behavioral contract in short:
/settings/:sectionand/repos/:id/settings/:sectionrender one category each. The bare routes render a tappable category index below the app shell's desktop breakpoint (1024px) and redirect to thegeneralsection at or above it, where a slim inline category list (visually lighter than the app SideNav rail) sits beside the section content. Crossing the breakpoint keeps the current route; growing to desktop while on the bare index triggers the redirect.dangercategory is pinned last and styled in the app's danger red.useSettingsForm) owns dirty tracking, submit, and the unsaved-changes guard (useBeforeLeavefrom @solidjs/router plusbeforeunload, both via nativeconfirm). Device-local or act-immediately sections (Notifications, Install app, Secrets, Danger zone) stay guard-free.Settings / <Section>trail where "Settings" links to the index; global settings stays breadcrumb-free.lucide-soliddependency; index/list icons come from it, imported per-icon, rendered ~18–20px, inheritingcurrentColorin both themes.Key interfaces:
useSettingsForm— shared primitive for dirty tracking, dirty-fields-only PATCH submit, and the leave/close guarduseBeforeLeave(@solidjs/router) andbeforeunloadfor the guardAcceptance criteria:
The checklist in the issue body is the acceptance contract. Highlights: every existing field reachable under the new categories with unchanged PATCH payloads; guard fires on in-app navigation and tab close only for dirty form sections; deep links work on both form factors; old monolith route files removed with every new file under the 1000-line repolint cap and existing
/repos/:id/settingslinks still working; tests cover metadata↔route wiring, per-section dirty PATCH payloads, and guard behavior.Out of scope: