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 ta
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-add-settings-page-3cdb74c87006 ,按照其中的说明把「add-settings-page」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Settings page chrome (header bar, scroll region, content column, nav-driven
title + description) is owned by the settings/[section]/layout.tsx shell. Each
page renders through SettingsPanel, which registers the page's header data
(actions, search, back) with that shell and renders only the body. The full
convention lives in .claude/rules/sim-settings-pages.md — read it first; this
skill is the procedure.
Key paths:
apps/sim/app/workspace/[workspaceId]/settings/[section]/layout.tsx (SettingsHeaderShell)SettingsPanel registrar: apps/sim/components/settings/settings-panel.tsxapps/sim/components/settings/navigation.tsapps/sim/app/workspace/[workspaceId]/settings/[section]/settings.tsxapps/sim/app/workspace/[workspaceId]/settings/components/<name>/<name>.tsx and EE pages under apps/sim/ee/<feature>/components/navigation.ts: add the id to the SettingsSection union,
then a NavigationItem with label AND a one-line description (verb-first,
~40–55 chars, product voice per .claude/rules/constitution.md). Place it in
the right section group and set any gating flags (requiresHosted,
requiresEnterprise, etc.).effectiveSection render switch
in settings/[section]/settings.tsx (lazy dynamic(...) like its siblings).SettingsPanel per the rule's canonical page shape:
actions, search, children, modal siblings in a fragment.SaveDiscardActions (dirty-gated Discard+Save chips) in actions, and call
useSettingsUnsavedGuard({ isDirty }) before any early-return gate.
Detail sub-views additionally route the back chip through
guard.guardBack(closeFn) and render the shared UnsavedChangesModal. Never
hand-roll a Save button, a beforeunload, or an "Unsaved changes" modal —
they're centralized. See the "Save / Discard + unsaved-changes guard" section
in .claude/rules/sim-settings-pages.md.cd apps/sim && bun run type-check; bunx biome check --write <file>.For each page component, confirm the checklist in .claude/rules/sim-settings-pages.md:
SettingsPanel:
git grep -n "flex h-full flex-col bg-\[var(--bg)\]" -- 'apps/sim/**/settings/' 'apps/sim/ee/'
— every match should be either settings-panel.tsx, a detail sub-view
(has a <Chip leftIcon={ArrowLeft}> back button), or an entitlement/loading
gate early-return. Anything else is a page that still needs migrating.git grep -n "text-\[var(--text-body)\] text-lg" -- 'apps/sim/**/settings/' 'apps/sim/ee/'.claude/rules/sim-settings-pages.md for the token map and the row
title/subtitle pairing convention):
git grep -nE "text-\[1[0-8]px\]" -- 'apps/sim/**/settings/' 'apps/sim/ee/' — should
be 0. Display type above the scale (text-[40px] hero headings) is deliberate
and out of scope.SettingsPanel and that its NavigationItem has an
accurate description of consistent length with its peers.
SaveDiscardActions and
dirty is wired via useSettingsUnsavedGuard (called before early-return
gates) — flag any hand-rolled Save button, beforeunload, or unsaved modal.
git grep -n "beforeunload" -- 'apps/sim/**/settings/' 'apps/sim/ee/'
should only hit the centralized use-settings-before-unload.ts.SettingsPanel swap:
move header chips to actions, the standalone search to search, delete the
<h1> title block, replace the three closing </div> (column/scroll/shell)
with </SettingsPanel>, and keep modal siblings in a <> fragment. Do NOT
touch handlers, state, queries, conditional rendering, or detail/gate returns.
Drop per-page gap-*/pt-* on the content column in favor of the panel default.text-[12px] → text-caption,
never a different size) — this must render pixel-identical, not restyle the
page. Leave color tokens (--text-primary vs --text-body, etc.) untouched
unless they're also being changed for an unrelated, deliberate reason.ChipInput/) ONLY after grepping that
they are not still used elsewhere in the file (e.g. by a detail view).SettingsResourceRowRead "The resource row" in .claude/rules/sim-settings-pages.md first — it is the
contract. Then, per page:
git grep -n "truncate text-\[var(--text-body)\] text-sm" -- 'apps/sim/app/workspace/' 'apps/sim/ee/'
Every match outside settings-resource-row.tsx is either a row to migrate or a
genuinely different shape (multi-line body, tabular columns, a grid) that stays
bespoke — decide which, and say so.<button>/<Link> around the row becomes
onClick/href on the row itself. Wrapping the row is what the primitive
exists to stop — it is also invalid HTML once trailing holds a control.trailing, decorative → badge.
Getting this backwards makes the row's right edge a dead zone.navigable only if the row opens a detail page, and clickLabel always.-mx-2 — the row now owns the bleed. Use
RESOURCE_LIST_STACK / RESOURCE_LIST_GRID; do not hand-write the gap.<button disabled={!can}> becomes onClick={can ? … : undefined} +
navigable={can}, which renders a plain non-interactive row. Verify the gated
state has no clickable affordance left.description or badge.bun run type-check, biome check, the page's tests, and a diff read of
every converted block for lost props, conditions, and key placement.Searchbun run type-check, biome check on every touched
file, and run the affected pages' tests. Diff each file against the base and
confirm the change is purely structural before shipping.