Agent Skills › openchamber/openchamber › settings-ui-patterns

settings-ui-patterns

GitHub

提供OpenChamber设置页面的UI构建规范,涵盖布局、控件及响应式处理。指导Agent使用共享组件而非手写DOM,确保视觉一致性与可维护性,并规定页面结构组织原则。

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

触发场景

创建或修改设置页面 调整设置对话框布局 实现设置搜索行为

安装

npx skills add openchamber/openchamber --skill settings-ui-patterns -g -y
更多选项

非标准路径

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

不安装直接使用

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 openchamber-ui-guidance for depth, surfaces, layout stability, sizing and composition.
  • 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, and write the surface list from its Name The Surfaces Before Editing step before adding or moving a settings page: a page that exists on desktop and is unreachable on a phone is the common way this goes wrong.

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 boxed backgrounds or row chrome. Card grids are the one exception, for browse pages (see references/layout.md).
  • Secondary helper text is hidden behind an info icon (info prop) by default; 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.

Keep A Page From Turning Into A List

Pages grow one control at a time, and each addition looks fine alone; the mess shows up as a whole. When adding to a page, read the page, not only the spot you add to:

  • A section holds one topic a user would name ("Terminal", "Sending"). A new setting goes into the section it belongs to, or starts its own; never append it to whatever section is last or nearest.
  • One row kind per run: field rows together, checkboxes together. A field row (label + select, stepper, chips) between checkboxes is the clearest sign of a page that needs regrouping.
  • Same shape for the same kind of choice: a short enum is chips in a field row everywhere, never radios on one page and chips on the next.
  • A text line belongs to one option and sits under its label (description, footer), never loose between two rows.
  • When a page passes about four sections or a scroll of mixed topics, split it into tabs (references/layout.md, Pages With Tabs) rather than adding more.

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.

Description Policy (info hints)

  • Explanatory prose goes behind the info icon via the info prop by default.
  • An info hint is one or two short sentences that add what the label or summary does not say. It names no list of every action and carries no caveat that stopped being true.
  • When labels alone cannot explain the differences, consequences, or conditions needed to choose a setting, use a title, a visible description, then checkbox or radio controls. Option lists whose labels already read as complete choices (large-text paste modes, send shortcut) keep the explanation behind info even when it carries an exception. Having multiple options or a group title alone does not require a description; see references/controls.md for composition.
  • 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.

The OpenCode configuration pages autosave by their own contract (components/sections/DOCUMENTATION.md, Autosave) and never use this indicator.

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.
  • Description placement follows the policy above; warnings/syntax/status remain 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.
  • Search registry, anchor, page, localization, and availability agree.
  • Nearby Settings precedent and relevant tests remain consistent.

版本历史

  • 6cd8058 当前 2026-11-03 06:04

    统一文档所有权,消除重复与矛盾规则,精简上下文冗余,修复设置页自动保存指示器冲突等问题。

  • bf977d2 2026-10-19 13:05

    新增关于保持页面分组结构的指导,防止因控件添加导致页面结构混乱;更新配套技能列表以包含 openchamber-ui-guidance。

  • 1f0004f 2026-09-28 05:11

    新增对卡片网格(card grids)用于MCP和服务插件浏览页的指导,以及移动设备上紧凑模型行的展示规范。

  • 336e192 2026-09-22 17:58

    新增对 Settings API 解耦的依赖指引;更新参考文档加载策略;修正主题选择器与滚动条相关的具体实现细节。

  • 2471b29 2026-09-09 11:57

    优化了描述可见性指南,并统一了辅助文本的隐藏交互方式。

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

同 Skill 集合

.agents/skills/changelog-authoring/SKILL.md
.agents/skills/clack-cli-patterns/SKILL.md
.agents/skills/communication-style/SKILL.md
.agents/skills/desktop-shell/SKILL.md
.agents/skills/drag-to-reorder/SKILL.md
.agents/skills/enterprise-boundary/SKILL.md
.agents/skills/isolated-space-boundary/SKILL.md
.agents/skills/locale-ui-patterns/SKILL.md
.agents/skills/openchamber-change-discipline/SKILL.md
.agents/skills/opencode-v2/SKILL.md
.agents/skills/pr-review/SKILL.md
.agents/skills/relay-transport/SKILL.md
.agents/skills/rtl-layout/SKILL.md
.agents/skills/serve-sim/SKILL.md
.agents/skills/sync-state-invariants/SKILL.md
.agents/skills/theme-system/SKILL.md
.agents/skills/triage-issues/SKILL.md
.agents/skills/triage-prs/SKILL.md
.agents/skills/ui-api-decoupling/SKILL.md
.agents/skills/update-changelog/SKILL.md
.agents/skills/writing-for-agents/SKILL.md
.agents/skills/performance-engineering/SKILL.md

元信息

文件数
0
版本
6cd8058
Hash
9fcda5a3
收录时间
2026-07-25 10:37

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-11-06 02:07
浙ICP备14020137号-1