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

opened this

Parked 44d 2h ago

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

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
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.

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

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.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs