fix(ui): improve composer focus, keyboard navigation, and settings (#3376)
* fix(ui): make composer keyboard interactions consistent * docs(settings): refine description visibility guidance --------- Co-authored-by: Bohdan Triapitsyn <artmore@protonmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
Bohdan Triapitsyn
parent
1306b1124c
commit
5ae1a949c8
@@ -38,6 +38,9 @@ cells or when the control is wide; same `info` / `settingsItem` props.
|
||||
|
||||
## Boolean
|
||||
|
||||
For a self-explanatory enable/disable setting, use only a checkbox and label;
|
||||
no separate group title or description is needed.
|
||||
|
||||
```tsx
|
||||
<SettingsCheckboxRow
|
||||
checked={value}
|
||||
@@ -54,10 +57,21 @@ for text that must stay visible (warnings, dynamic status).
|
||||
|
||||
## Mutually Exclusive Options
|
||||
|
||||
Use radios for mutually exclusive modes, not independent checkboxes. Keep
|
||||
self-explanatory choices compact; a title or description is not mandatory.
|
||||
|
||||
When the skill's Description Policy calls for a visible explanation, wrap
|
||||
the controls in `SettingsControlGroup`: title, description, then options.
|
||||
Explain the choice once at group level. Use checkbox rows for independent
|
||||
choices and radio options for mutually exclusive choices. Group spacing is
|
||||
defined in `layout.md`.
|
||||
|
||||
```tsx
|
||||
<SettingsRadioGroup aria-label={t('...group')}>
|
||||
<SettingsRadioOption selected={…} onSelect={…} label={t('...')} ariaLabel={t('...')} />
|
||||
</SettingsRadioGroup>
|
||||
<SettingsControlGroup title={t('...group')} description={t('...description')}>
|
||||
<SettingsRadioGroup aria-label={t('...group')}>
|
||||
<SettingsRadioOption selected={…} onSelect={…} label={t('...')} ariaLabel={t('...')} />
|
||||
</SettingsRadioGroup>
|
||||
</SettingsControlGroup>
|
||||
```
|
||||
|
||||
Skip per-option descriptions when labels are self-explanatory. For short
|
||||
|
||||
@@ -29,7 +29,7 @@ All primitives and class constants below live in
|
||||
| L2 | `SettingsSection` title (`SETTINGS_SECTION_TITLE_CLASS`) | Section |
|
||||
| L3 | `SettingsControlGroup` title (`SETTINGS_GROUP_TITLE_CLASS`) | Sub-cluster inside a section |
|
||||
| L4 | `SETTINGS_FIELD_LABEL_CLASS` | Field / control labels |
|
||||
| Helper | `SETTINGS_HELPER_CLASS`, `SETTINGS_DESCRIPTION_CLASS` | Rare visible helper text (most goes behind `info`) |
|
||||
| Helper | `SETTINGS_HELPER_CLASS`, `SETTINGS_DESCRIPTION_CLASS` | Rare visible helper text (most goes behind `info`; see the skill's Description Policy) |
|
||||
|
||||
## Navigation Placement
|
||||
|
||||
@@ -63,5 +63,6 @@ pattern when touching nav.
|
||||
- Sections own vertical rhythm: divider + `py-8` come from `SettingsSection`.
|
||||
- Fields inside a column: `SETTINGS_FIELDS_STACK_CLASS` (`space-y-4`).
|
||||
- Checkbox/radio lists: `SETTINGS_OPTION_STACK_CLASS` (`space-y-1.5`).
|
||||
- Groups requiring a title and visible description: separate them from preceding controls with `space-y-6` on the parent. Keep simple checkbox/radio lists compact. The title sits closer to its own description and controls than to the preceding group; use `SettingsControlGroup`'s internal spacing.
|
||||
- Two-column areas: `SettingsTwoColumn` (`@3xl:grid-cols-2`); use `SettingsStackedField` inside cells (a `SettingsFieldRow` overflows half-width columns).
|
||||
- No elevated backgrounds, rounded rows, or hover fills without explicit UX value.
|
||||
|
||||
Reference in New Issue
Block a user