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

Parked opened this
Closed without merging

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.

Notes

stopped parked by the crew

opened this

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.ts uses selectField for the forge on/off/default choice and field() for users, roles and percent. Each control now has a visible label, and its id carries the flag name (f-<flag>-users and so on), so ids stay unique across rows. The form keeps .row-fields and the Save, Clear and "Make … the default" buttons are unchanged. The form's field names are unchanged, so the POST handler is untouched; only its field import is aliased to formField to free the name.
  • Styles: The .flag-form rules and their phone media block are removed from src/web/style/content.ts. I added one rule, .row-fields .field, to src/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.ts now asserts that the flags page has no flag-form, renders <div class="field", and labels the users input (for="f-alpha-users").
  • Baseline: docs/design/baseline.json needed 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.

Closes #4614

4 earlier comments · 2 events
commented

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.ts uses selectField for the forge on/off/default choice and field() for users, roles and percent. Each control now has a visible label, and its id carries the flag name (f-<flag>-users and so on), so ids stay unique across rows. The form keeps .row-fields and the Save, Clear and "Make … the default" buttons are unchanged. The form's field names are unchanged, so the POST handler is untouched; only its field import is aliased to formField to free the name.
  • Styles: The .flag-form rules and their phone media block are removed from src/web/style/content.ts. I added one rule, .row-fields .field, to src/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.ts now asserts that the flags page has no flag-form, renders <div class="field", and labels the users input (for="f-alpha-users").
  • Baseline: docs/design/baseline.json needed 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.
commented

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.

Changes requested — before the latest push

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.

commented

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; } in src/web/style/components.ts, right after the .row-fields .check rule. 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 .field keep center. This also affects every other .row-fields form that contains a .field, not only the flags page.
  • Percent test: test/flags-settings.test.ts now posts percent=30, reloads /settings/flags, and asserts the percent input renders with value="30". The existing assertion that the POST stores percent: 30 stays.
  • Checks: test/flags-settings.test.ts passes (7 tests), tsc --noEmit is clean, and design-lint reports 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-fields wraps and each .field is capped at max-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 — before the latest push

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.

commented

I merged main into the branch, resolved both conflicts, and pushed (1a7016cc).

  • src/web/style/content.ts: main had added phone-width wrapping rules for .flag-form. This pull no longer uses that class, because the flags forms now use .row-fields and §5's .field and buttons. I dropped those rules rather than carry a class nothing renders.
  • docs/DESIGN.md: I took main's class list for the page-furniture section, which no longer includes the .backups-*, .app-shelf and .front-pin-any entries. I removed .flag-form from 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.

commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs