Skip to content

feat(client): per-section saves beside H2 section headings, collapsed advanced options, defaults in hover hints - #132

Merged
btspoony merged 4 commits into
mainfrom
feat/fallbacks-card-section-ux
Sep 27, 2026
Merged

btspoony merged 4 commits into
mainfrom
feat/fallbacks-card-section-ux

Conversation

@btspoony

Copy link
Copy Markdown
Member

Summary

Applies the maintainer's live-host feedback on the flat Fallbacks card shipped in #130: the three big sections (主代理 / 子代理 / 高级选项) regain their own Discard + Save beside semantic H2 titles, the advanced options section is collapsed by default again, and the numeric fields' default values move into the hover hints so long labels stop wrapping.

Changes

  • Per-section saves restored: each section carries its own 放弃修改 / 保存 pair (the pre-flat machinery from the df77316 reference, ported onto the current flat markup — not reinvented). A section's Save writes ONLY its own fields over the last accepted config (ride-along protection), gated by that section's dirty term and validation bucket; store write failures render under the section whose Save was clicked. Disabled terms per KD-U1: save !sectionDirty || saving || !writable, discard !sectionDirty || saving. The single bottom footer is removed.
  • H2 section headings: 主代理 / 子代理 / 高级选项 are semantic <h2> elements (14px/600, ids fallbacks-main-agent / fallbacks-subagents / fallbacks-advanced preserved, aria-label = section title so heading navigation stays clean).
  • 高级选项 collapsed by default: content-level disclosure (same pattern as the time-slot/role rows) with aria-expanded/aria-controls, forced open when read-only; the section's Discard/Save live inside the expanded body.
  • Defaults into hover hints: the three standalone 默认值 note spans are gone; each numeric field's info hint (tooltip + aria-label) carries the schema default as its final sentence (300000 ms / 8 / 5) — strictly more correct than the old span, which mislabeled a changed accepted value as the default.
  • Data path untouched (store / gateway / remotes / invalidations / slot seats — presentation round only); locales zh/en extended additively; changelog fragment card-section-save-ux.md.

Testing

  • pnpm typecheck exit 0; pnpm build exit 0 (verify-dist host + client OK)
  • Targeted vitest: card spec 93 passed (section dirty isolation both directions, ride-along patch, advanced collapse/expand a11y, h2 ids, zero defaultNote, defaults in tooltips, zh/en parity); neighbors 204 + 148 passed; QA spot re-run 97 passed
  • QC single review: Approve (3 nits fixed in 8e6721a); QA targeted acceptance: pass, all criteria mapped
  • Live-host visual re-check (127.0.0.1:3080 after reinstall) — manual step, pending

Note: the section action pairs sit inside the disabled fieldset, so a real browser makes them inert when settings are read-only — pre-flat parity (df77316 did the same), documented in-code; saves still carry !writable regardless.

…ced, default-value tooltips

Restore the pre-flat per-section save model on the flat card (maintainer
live-host feedback): each section heading (主代理 / 子代理 / 高级选项)
becomes a semantic h2 carrying its own Discard + Save pair, a section's
Save writes only its own fields over the last accepted config (ride-along
protection), and its validation bucket plus store write failures render
under that section. The single bottom footer pair is removed.

高级选项 is a content-level disclosure collapsed by default (aria-expanded
toggle inside its h2, forced open in read-only), with its actions inside
the expanded body. The three numeric fields' default values move into
their info-hint tooltips (aria-label + data-tip), replacing the
standalone label-row note that wrapped long labels.
… tooltip defaults

Section-scoped save/discard helpers anchor on the section ids (the
advanced pair inside its expanded body). The flat-chrome block becomes a
section-saves block pinning: three h2 section headings with their
fallbacks-* ids, one action pair per section with KD-U1 disabled terms,
section dirty isolation in both directions, per-section discard, the
ride-along protection (a section save carries the last accepted config
for the other sections), store write failures under the last-saved
section, the advanced disclosure collapsed by default with
aria-expanded/aria-controls and the read-only forced-open contract, the
field defaults inside the info-hint tooltips with zero defaultNote
spans, and the bilingual advanced.expand/collapse keys.
@btspoony
btspoony merged commit 346fd0a into main Sep 27, 2026
1 check passed
@btspoony
btspoony deleted the feat/fallbacks-card-section-ux branch September 27, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant