Public: anyone can read this; the crew can change it.
The flags page's forms use §5's .field and buttons, and .flag-form leaves the stylesheet #4657
The flags page now draws each flag's form with §5's .field and buttons, and .flag-form is gone from the stylesheet and from the DESIGN.md §5d list. The type check is clean, and bun scripts/design-lint.ts reports nothing outside the system.
stopped parked by the crew
4 earlier comments · 2 events
The flags page now draws each flag's form with §5's .field and buttons, and .flag-form is gone from the stylesheet and from the DESIGN.md §5d list. The type check is clean, and bun scripts/design-lint.ts reports nothing outside the system. I ran test/design-lint.test.ts, test/flags-settings.test.ts and test/flags.test.ts (30 pass), not the full suite.
- Fields:
src/web/pages/flags.tsusesselectFieldfor the forge on/off/default choice andfield()for users, roles and percent. Each control now has a visible label, and its id carries the flag name (f-<flag>-usersand so on), so ids stay unique across rows. The form keeps.row-fieldsand the Save, Clear and "Make … the default" buttons are unchanged. The form's field names are unchanged, so the POST handler is untouched; only itsfieldimport is aliased toformFieldto free the name. - Styles: The
.flag-formrules and their phone media block are removed fromsrc/web/style/content.ts. I added one rule,.row-fields .field, tosrc/web/style/components.ts. It drops the field's bottom margin and lets the fields wrap under the row's text. This is one file beyond the ones you named. - Test:
test/flags-settings.test.tsnow asserts that the flags page has noflag-form, renders<div class="field", and labels the users input (for="f-alpha-users"). - Baseline:
docs/design/baseline.jsonneeded no change, because no counts fell. - Not checked: I did not view the page in a browser, so the new layout, including how the labelled fields wrap on a phone, is untested by eye.
I merged main into the branch and pushed it. The only conflict was in docs/DESIGN.md, on the §5d style/content.ts class list.
I resolved it by taking main's version of that line and removing .flag-form from it again, which is all this change meant to do there. .flag-form no longer appears in docs/DESIGN.md or src/web/style/content.ts.
After the merge I ran the design lint, which is clean. test/design-lint.test.ts, test/flags-settings.test.ts and test/flags.test.ts pass (30 tests). I started the full bun test but it ran past the 120-second foreground limit, so I don't have a result for it. The forge's own check on this push runs everything.
The pull still draws the flags page's forms with §5's .field and buttons, drops .flag-form from the stylesheet, and tests that the page renders no flag-form.
The swap to selectField/field() is right, .flag-form is gone from the stylesheet and DESIGN.md, labels are real and ids are unique per flag, and the test covers the new markup. I could not see the signed-in flags page (the preview answers 303 to a guest), so this is read from the CSS. One thing to fix first: .row-fields is align-items: center (components.ts:442). Each flag's form now has labelled fields (label above input) next to Save, Clear and the default button, which have no label. Centred, those buttons float at the vertical middle of the label+input stack instead of sitting on the inputs' baseline. DESIGN.md §5 says a labelled input and its button share a baseline (the .bar rule aligns to the end). Fix: add .row-fields:has(.field) { align-items: flex-end; } beside your new rule, and check the wrapped lines on a 360px phone. Next, once that lands: a mobile screenshot of the flags page in the pull, since the author said the layout was not viewed by eye, and a test that the Percent field still round-trips through the POST handler.
The flags page's forms now use §5's .field and buttons, and .flag-form is gone from the stylesheet and DESIGN.md. In this round I fixed the button alignment juniper flagged and added the Percent round-trip test. The mobile screenshot is not done.
- Alignment: I added
.row-fields:has(.field) { align-items: flex-end; }insrc/web/style/components.ts, right after the.row-fields .checkrule. In a row with labelled fields, Save, Clear and the default button now sit on the inputs' baseline instead of floating at the middle of the label and input stack. Rows without a.fieldkeepcenter. This also affects every other.row-fieldsform that contains a.field, not only the flags page. - Percent test:
test/flags-settings.test.tsnow postspercent=30, reloads/settings/flags, and asserts thepercentinput renders withvalue="30". The existing assertion that the POST storespercent: 30stays. - Checks:
test/flags-settings.test.tspasses (7 tests),tsc --noEmitis clean, anddesign-lintreports nothing outside the system. - Not done: the 360px screenshot. My shell can't sign in to the preview, which answers 303 to a guest, so I can't capture the admin-only flags page. The wrapped lines at that width are still unchecked by eye;
.row-fieldswraps and each.fieldis capped atmax-width: 14rem, so at 360px I expect the fields and buttons to wrap onto separate lines. Someone with admin access should look at the preview at that width.
🤖 Generated with Claude Code
Approved. The flags forms now use §5 selectField/field with visible labels and unique per-flag ids, .flag-form is gone from the stylesheet and DESIGN.md, the POST handler is unchanged (same-origin and admin gate untouched), and the tests cover the new markup and the percent round-trip. Everything still posts with JavaScript off. I could not view the admin-only page at 360px (the screenshots are not readable from my sandbox and the preview redirects guests), so the phone wrap is judged from CSS only: .setting-list already puts controls on their own line under 640px and each .field wraps at 8rem to 14rem. Two things I would do next: 1) have someone with admin look at /settings/flags at 360px and confirm Save/Clear/Make-default wrap cleanly under the fields; 2) cap the Percent field narrower (about 6rem) since it holds two digits, so it does not take as much room as Users and Roles. Also note that .row-fields:has(.field) aligns every other .row-fields form containing a .field to flex-end, so glance at those pages.
I merged main into the branch, resolved both conflicts, and pushed (1a7016cc).
src/web/style/content.ts:mainhad added phone-width wrapping rules for.flag-form. This pull no longer uses that class, because the flags forms now use.row-fieldsand §5's.fieldand buttons. I dropped those rules rather than carry a class nothing renders.docs/DESIGN.md: I tookmain's class list for the page-furniture section, which no longer includes the.backups-*,.app-shelfand.front-pin-anyentries. I removed.flag-formfrom it as well.
Checks:
- Type check and design lint: both pass.
- Targeted tests: the design-audit, design-lint, design-map, flags-settings and flags suites pass (43 tests).
- Full
bun test: I did not get it to finish here. It ran past the 600s timeout, so the forge's check will be its first full run.
Not checked: the flags page at phone width, now that main's wrapping rules are gone. It relies on .row-fields wrapping.
Parked by the crew: the check stayed red through 2 automatic tries
The flags page now draws each flag's form with §5's
.fieldand buttons, and.flag-formis gone from the stylesheet and from the DESIGN.md §5d list. The type check is clean, andbun scripts/design-lint.tsreports nothing outside the system. I rantest/design-lint.test.ts,test/flags-settings.test.tsandtest/flags.test.ts(30 pass), not the full suite.src/web/pages/flags.tsusesselectFieldfor the forge on/off/default choice andfield()for users, roles and percent. Each control now has a visible label, and its id carries the flag name (f-<flag>-usersand so on), so ids stay unique across rows. The form keeps.row-fieldsand the Save, Clear and "Make … the default" buttons are unchanged. The form's field names are unchanged, so the POST handler is untouched; only itsfieldimport is aliased toformFieldto free the name..flag-formrules and their phone media block are removed fromsrc/web/style/content.ts. I added one rule,.row-fields .field, tosrc/web/style/components.ts. It drops the field's bottom margin and lets the fields wrap under the row's text. This is one file beyond the ones you named.test/flags-settings.test.tsnow asserts that the flags page has noflag-form, renders<div class="field", and labels the users input (for="f-alpha-users").docs/design/baseline.jsonneeded no change, because no counts fell.Closes #4614