Agent Skillsopenchamber/openchamber › settings-ui-patterns

settings-ui-patterns

GitHub

指导创建或修改OpenChamber设置页面、对话框及控件的UI规范。要求使用共享组件原语,遵循扁平化层级、响应式容器查询及本地化策略,禁止手写样式。

.agents/skills/settings-ui-patterns/SKILL.md openchamber/openchamber

Trigger Scenarios

创建设置页面布局 修改设置控件样式 调整设置搜索行为

Install

npx skills add openchamber/openchamber --skill settings-ui-patterns -g -y
More Options

Non-standard path

npx skills add https://github.com/openchamber/openchamber/tree/main/.agents/skills/settings-ui-patterns -g -y

Use without installing

npx skills use openchamber/openchamber@settings-ui-patterns

指定 Agent (Claude Code)

npx skills add openchamber/openchamber --skill settings-ui-patterns -a claude-code -g -y

安装 repo 全部 skill

npx skills add openchamber/openchamber --all -g -y

预览 repo 内 skill

npx skills add openchamber/openchamber --list

SKILL.md

Frontmatter
{
    "name": "settings-ui-patterns",
    "description": "Use when creating or modifying OpenChamber Settings pages, dialogs, controls, configuration surfaces, responsive Settings layouts, or Settings search behavior."
}

Settings UI Patterns

Required Companion Skills

  • Load theme-system for colors, buttons, icons, and visual states.
  • Load locale-ui-patterns for every visible string, tooltip, placeholder, and accessible label.
  • Load ui-api-decoupling when a setting reads/writes runtime data or adds a capability.

When examples conflict, shared component/theme and localization contracts win. Stop on unresolved material conflicts.

Canonical Direction

Settings are built from the shared primitives in packages/ui/src/components/sections/shared/SettingsSection.tsx, SettingsPageLayout.tsx, and SettingsInfoHint.tsx. Never hand-roll page chrome, section headers, field rows, checkbox rows, or info tooltips with raw divs — use the primitives, and extend them (in the shared file) when a new shape is genuinely missing.

  • Flat hierarchy through spacing and typography; no cards, boxed backgrounds, or row chrome.
  • Secondary helper text is hidden behind an info icon (info prop); the default view stays quiet.
  • Controls have one standard size (h-9 / select size="settings") and capped widths — no full-bleed inputs.
  • Layouts respond to the settings pane width via container queries (@xl: / @3xl:), never viewport sm:/lg: breakpoints (the pane is much narrower than the viewport inside the dialog).
  • Checkbox/radio state comes before labels; selected states are subtle and never shift layout.

Load References By Task

Task Required reference
Page skeleton, sections, hierarchy, nav placement, spacing, columns, responsiveness references/layout.md
Field rows, checkboxes, radios, chips, selects, inputs, numeric steppers, info hints references/controls.md
Adding/moving controls, pages, availability, anchors, or search entries references/search.md

Load each reference whose task branch applies; reference loading is complete when layout, control, and search implications are each classified.

Quick Primitive Selection

Need Shared primitive
Page wrapper (title, description, save status, scrolling, @container) SettingsPageLayout
Titled block with divider SettingsSection (divider={false} for the first one)
Label left / control right SettingsFieldRow
Label above control (two-column cells, wide controls) SettingsStackedField
Boolean SettingsCheckboxRow
Mutually exclusive list SettingsRadioGroup + SettingsRadioOption
Short segmented options SettingsChipGroup
Sub-cluster with a quiet L3 title inside a section SettingsControlGroup
Two-column area on wide panes SettingsTwoColumn
Helper text on demand (hover + tap) info prop or SettingsInfoHint

Do not introduce raw <Tooltip>-based info icons, direct Remixicon components, hardcoded user-facing strings, or one-off color/button systems. New icons: reference a Remix icon name in code, then run bun run icons:generate to add it to the sprite.

Description Policy (info hints)

  • Explanatory prose (what a feature does, when it applies) goes behind the info icon via the info prop — never as always-visible description.
  • Stays visible: security/data-loss warnings, destructive consequences, required syntax/placeholder lists the user reads while typing, dynamic status, empty states, validation errors, active-flow wizard instructions.
  • Mixed text: keep the warning sentence visible, move the explanation to info.

Save Feedback

SettingsPageLayout showSaveStatus renders the shared quiet indicator: success is silent, "Saving…" appears only past ~500 ms, failures show "Save failed". Anything persisted through updateDesktopSettings reports automatically; page-specific APIs must call reportSettingsSaveState from @/lib/persistence. Never add per-page save badges or success toasts for ordinary setting writes.

Settings Search Contract

Every stable Settings control addition or move must consider search in the same change:

  • explicit registry item in packages/ui/src/lib/settings/search.ts when searchable;
  • matching data-settings-item anchor (primitives accept settingsItem);
  • localized title/description keys;
  • availability matching actual render conditions;
  • when a control moves to another page, update the item's page too.

Dynamic entity rows normally are not indexed. Load references/search.md for exact rules.

Completion Criteria

  • Built from shared primitives; no ad-hoc page/section/row markup.
  • Explanatory text hidden behind info; warnings/syntax/status still visible.
  • Container-query (@xl:/@3xl:) responsiveness — no viewport breakpoints in pane content.
  • Controls use the standard size and width caps; no stretched full-width inputs.
  • Localized visible and accessibility text everywhere.
  • Search registry, anchor, page, localization, and availability agree.
  • Nearby Settings precedent and relevant tests remain consistent.

Version History

  • 2db90f7 Current 2026-08-20 04:55
  • 74b1bd8 2026-07-25 10:37

Same Skill Collection

.agents/skills/changelog-authoring/SKILL.md
.agents/skills/clack-cli-patterns/SKILL.md
.agents/skills/desktop-shell/SKILL.md
.agents/skills/drag-to-reorder/SKILL.md
.agents/skills/locale-ui-patterns/SKILL.md
.agents/skills/openchamber-change-discipline/SKILL.md
.agents/skills/performance-engineering/SKILL.md
.agents/skills/relay-transport/SKILL.md
.agents/skills/serve-sim/SKILL.md
.agents/skills/sync-state-invariants/SKILL.md
.agents/skills/theme-system/SKILL.md
.agents/skills/ui-api-decoupling/SKILL.md
.agents/skills/writing-for-agents/SKILL.md

Metadata

Files
0
Version
2db90f7
Hash
ade7700d
Indexed
2026-07-25 10:37

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-20 14:55
浙ICP备14020137号-1 $Гость$