|
1 | 1 | --- |
2 | 2 | name: add-settings-page |
3 | | -description: Add a new Sim settings page, or audit existing settings pages for design-system compliance with the shared SettingsPanel layout. Use when creating a settings tab, or when asked to check/clean up settings pages so they match the design system (consistent title, header, search, spacing). |
| 3 | +description: Add or audit settings pages that use SettingsPanel in the existing Sim app. Use implement-platform for isolated Platform settings. |
4 | 4 | --- |
5 | 5 |
|
6 | 6 | # Settings Page (add / audit) |
7 | 7 |
|
| 8 | +For `apps/sim/platform/**`, use [implement-platform](../implement-platform/SKILL.md). In a mixed request, apply the steps below only to the existing app's settings. |
| 9 | + |
8 | 10 | Settings page chrome (header bar, scroll region, content column, nav-driven |
9 | 11 | title + description) is owned by the `settings/[section]/layout.tsx` shell. Each |
10 | 12 | page renders through **`SettingsPanel`**, which registers the page's header data |
@@ -45,28 +47,28 @@ For each page component, confirm the checklist in `.claude/rules/sim-settings-pa |
45 | 47 | Each grep lists candidates; review every match against the expected ones named below. |
46 | 48 |
|
47 | 49 | 1. Find hand-rolled shells that should be `SettingsPanel`: |
48 | | - `git grep -n "flex h-full flex-col bg-\[var(--bg)\]" -- 'apps/sim/**/settings/**' 'apps/sim/ee/'` |
| 50 | + `git grep -n "flex h-full flex-col bg-\[var(--bg)\]" -- 'apps/sim/**/settings/**' 'apps/sim/ee/' ':(exclude)apps/sim/platform/**'` |
49 | 51 | — expected matches: the workspace and organization `settings/layout.tsx` shells and the |
50 | 52 | shared header shell (`components/settings/settings-header.tsx`); an entitlement/loading gate |
51 | 53 | is also fine. `CredentialDetailLayout` (the `settings/secrets/[credentialId]` exception) is |
52 | 54 | an exempt hand-rolled shell outside these pathspecs. A detail sub-view is never a match: it |
53 | 55 | passes `back={{ text, icon: ArrowLeft, onSelect }}` to `SettingsPanel`. Anything else is a |
54 | 56 | violation: render it through `SettingsPanel`. |
55 | 57 | 2. Find hand-rolled title blocks: |
56 | | - `git grep -n "text-\[var(--text-body)\] text-lg" -- 'apps/sim/**/settings/**' 'apps/sim/ee/'` |
| 58 | + `git grep -n "text-\[var(--text-body)\] text-lg" -- 'apps/sim/**/settings/**' 'apps/sim/ee/' ':(exclude)apps/sim/platform/**'` |
57 | 59 | — the only title is the `<h1>` in `settings-header.tsx`; a non-heading value at that size |
58 | 60 | (e.g. the credit balance in `ee/organization-usage/components/usage-credits.tsx`) is fine. |
59 | 61 | 3. Find literal pixel text sizes (should be 0 — see "Text Scale" in |
60 | 62 | `.claude/rules/sim-styling.md`): |
61 | | - `git grep -nE "text-\[1[0-8]px\]" -- 'apps/sim/**/settings/**' 'apps/sim/ee/'`. |
| 63 | + `git grep -nE "text-\[1[0-8]px\]" -- 'apps/sim/**/settings/**' 'apps/sim/ee/' ':(exclude)apps/sim/platform/**'`. |
62 | 64 | Display type above the scale (`text-[40px]` hero headings) is deliberate and out of |
63 | 65 | scope. |
64 | 66 | 4. Confirm each page imports `SettingsPanel` and that its registry entry has an |
65 | 67 | accurate `description` of consistent length with its peers. |
66 | 68 | - Editable pages: confirm Save/Discard go through `saveDiscardActions()` and |
67 | 69 | dirty is wired via `useSettingsUnsavedGuard` (called before early-return |
68 | 70 | gates) — flag any hand-rolled Save button, `beforeunload`, or unsaved modal. |
69 | | - `git grep -n "beforeunload" -- 'apps/sim/**/settings/**' 'apps/sim/ee/' 'apps/sim/components/settings/' ':(exclude,glob)**/*.test.*'` |
| 71 | + `git grep -n "beforeunload" -- 'apps/sim/**/settings/**' 'apps/sim/ee/' 'apps/sim/components/settings/' ':(exclude)apps/sim/platform/**' 'apps/sim/hooks/use-settings-browser-navigation.ts' ':(exclude,glob)**/*.test.*'` |
70 | 72 | should only hit the centralized `use-settings-browser-navigation.ts`. |
71 | 73 | 5. Fix each finding with the smallest structural change that satisfies the checklist; |
72 | 74 | do not touch handlers, state, queries, or gate returns. A pixel-size fix swaps |
|
0 commit comments