fix(settings-models): derive the add panels, lock the switch in flight, pair tabs with panels

The add card's panels are now derived from the shown mode and the modes
visited since it opened, and each renders only while its mode is still
offered, so a refresh that changes which modes are offered — every
configurable row gone, the pi-ai namespace unmounted, a route freed
after the catalog was exhausted — can neither leave the card without a
panel nor keep a form whose write the Host would refuse. The catalog
draft resolves to the chosen row while its namespace can take the
write, else to the first addable row; closing either panel forgets it,
so a later refresh cannot open a row editor unasked.

Both cards report a write or an endpoint interrogation in flight, and
the switch and the catalog select lock while one is, since a switch
underneath it would orphan the answer or the picker it opens. The
SegmentedControl takes the owner's id and pairs each tab with its panel
through `aria-controls` and `aria-labelledby`; a card offering one mode
carries that mode as its title instead of an orphan tabpanel, and a
locked segment names its reason as hover text. `fullWidth` goes: no
consumer asked for it.
This commit is contained in:
Yichen Jiang committed 2026-09-19 16:04:34 +08:00
1 parent 536a94b188
commit 7d06fcdc05
16 files changed
+368 -80

No files matched your search

@@ -4,8 +4,7 @@
* the soft elevation shadow (border: 0), the way every elevated surface draws
* its edge, so the elevation gate keeps it off the alias-border set.
*
* Segments are equal-width grid tracks — sized to the widest label when the
* control hugs its content, sharing the container when it spans it — which is
* Segments are equal-width grid tracks sized to the widest label, which is
* what lets one indicator be placed arithmetically: the tablist carries the
* segment count and the selected index as custom properties, and the indicator
* derives its width and offset from them instead of measuring the DOM. */
@@ -20,10 +19,6 @@
background: var(--dsw-alias-interactive-bg-hover);
}
.control[data-full-width='true'] {
display: grid;
}
.indicator {
position: absolute;
top: 3px;