feat(ui): the six native selects become the house controls
Owner's pick from the S7 mockups (2026-09-19): a short fixed set is a SegmentedToggle — the live search's result count, the table's rows per page, a download profile's mode (on its own row, so the three worded choices fit a phone) and audio format — and a longer set or the user's own list is a FilterSelect: the profile's quality (seven heights) and the download dialog's profile. A lint rule refuses a native <select> from now on (the canonical "FE control" row). The px-frozen size rules also caught up with a fraction: `text-[9.5px]` had slipped past the integer-only pattern in the Glass tuner, which is rem now.
This commit is contained in:
@@ -162,8 +162,9 @@ const localRules = {
|
||||
};
|
||||
|
||||
// A px-frozen BOX utility (the no-restricted-syntax block below): an esquery regex, as a string.
|
||||
// `[\d.]+`, not `\d+`: a fractional `text-[9.5px]` slipped past the integer-only pattern.
|
||||
const BOX_PX =
|
||||
"/(^|[\\s:])(min-|max-)?(w|h|size|left|right|top|bottom|inset|gap|p[xytrbl]?|m[xytrbl]?)-\\[\\d+px\\]/";
|
||||
"/(^|[\\s:])(min-|max-)?(w|h|size|left|right|top|bottom|inset|gap|p[xytrbl]?|m[xytrbl]?)-\\[[\\d.]+px\\]/";
|
||||
const BOX_PX_MESSAGE =
|
||||
"px-frozen box size doesn't scale with --font-scale: use the spacing scale (w-37.5, max-w-60), not w-[Npx].";
|
||||
|
||||
@@ -217,13 +218,21 @@ export default tseslint.config(
|
||||
// rem arbitraries (text-[0.75rem]) don't match (no "px").
|
||||
"no-restricted-syntax": [
|
||||
"error",
|
||||
// The canonical "FE control" row (CLAUDE.md): a short fixed set is a SegmentedToggle, a
|
||||
// longer one or a user's own list a FilterSelect. Six native selects had drifted in; the
|
||||
// 2026-09 debt burn replaced them, and this keeps the next one out.
|
||||
{
|
||||
selector: "Literal[value=/text-\\[\\d+px\\]/]",
|
||||
selector: "JSXOpeningElement[name.name='select']",
|
||||
message:
|
||||
"No native <select>: use ui/SegmentedToggle for a short fixed set, ui/FilterSelect for a longer one or a user's own list.",
|
||||
},
|
||||
{
|
||||
selector: "Literal[value=/text-\\[[\\d.]+px\\]/]",
|
||||
message:
|
||||
"px-frozen font size doesn't scale with --font-scale: use text-2xs/text-3xs or text-[Nrem], not text-[Npx] (R10 S2).",
|
||||
},
|
||||
{
|
||||
selector: "TemplateElement[value.raw=/text-\\[\\d+px\\]/]",
|
||||
selector: "TemplateElement[value.raw=/text-\\[[\\d.]+px\\]/]",
|
||||
message:
|
||||
"px-frozen font size doesn't scale with --font-scale: use text-2xs/text-3xs or text-[Nrem], not text-[Npx] (R10 S2).",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user