refactor(clues): browse and pack rows use the shared row/state components

The pack shelf and the browse results each carried their own row shell, their
own empty state and their own error+retry line. They now share ListRow,
EmptyState and ErrorBlock, and the local copies are gone.

ListRow grew the two contracts those callers actually need:
- titleLabel so the accessible name can be "Manage pack: X" while the visible
  title stays "X";
- primary so the roving-focus marker (data-list-primary + its tab stop) lands
  on the title button, which is what useListNavigation focuses;
- a navigating row keeps name + subtitle inside that button, so the whole
  two-line caption is one click target and one accessible name.

Removed from clues-tab.module.css: the .packRow/.packOpen/.packGlyph/
.packName/.packMeta/.packCount/.packReference family plus the two coarse-
pointer orphans left behind. tests/clues-tab-css.spec.ts now asserts that
contract against the shared patterns sheet, where the rules actually live.
This commit is contained in:
Menghuan1918 committed 2026-11-24 16:43:26 +08:00
1 parent 9056ea2c7c
commit 0edd9e9e81
7 files changed
+194 -212

No files matched your search

+19 -6
View File
@@ -98,21 +98,33 @@
gap: 1px;
}
/* The title is a real button when the row navigates: keyboard operation and a
visible focus ring come for free, and the row's own padding stays intact. */
/* The title text. Truncation lives here, so a caller's locator can land on the
element that actually clips — a wrapper would inherit the ellipsis but not
the measured overflow. */
.listRowName {
min-width: 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/* A navigating row makes the whole caption (name + subtitle) one button:
keyboard operation and a visible focus ring come for free, and the row's own
padding stays intact. */
.listRowTitle {
appearance: none;
display: block;
display: flex;
flex-direction: column;
align-items: stretch;
gap: 1px;
min-width: 0;
flex: 1 1 auto;
padding: 0;
border: 0;
background: none;
color: inherit;
font: inherit;
text-align: start;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
}
@@ -123,6 +135,7 @@
}
.listRowSubtitle {
min-width: 0;
color: var(--dsw-alias-label-tertiary);
font: var(--dsw-font-xxxs-11);
white-space: nowrap;