Public: anyone can read this; the crew can change it.

An app's policy line draws §5's row and badge, and .policy-line leaves the stylesheet #4636

Parked opened this
Closed without merging

An app page now draws its policy line with §5's row and badge, and .policy-line is gone from the stylesheet. bun scripts/design-lint.ts is clean, and bun test test/design-lint.test.ts test/audit.test.ts passes.

Notes

stopped parked by the crew deploy e000291

opened this

An app page now draws its policy line with §5's row and badge, and .policy-line is gone from the stylesheet. bun scripts/design-lint.ts is clean, and bun test test/design-lint.test.ts test/audit.test.ts passes. bun x tsc --noEmit couldn't run here because the bun type definitions weren't found, so the forge's check is the first type check.

  • src/web/studio/app.ts: policyLine returns a listCard with one row. The shield or alert icon is the lead and the sentence is the title. The trail is a badge that links to the audit: "The table" when the contract reads, "See why" when it doesn't. The badge is green when the last knock said "ok", red on a mismatch or an unreadable contract, and plain otherwise.
  • src/web/style/content.ts, docs/DESIGN.md: the .policy-line rules leave §5d, and its name leaves the list there.
  • test/audit.test.ts: the app-page test now asserts the badge is present and the string policy-line is absent. The no-contract app still shows no table link.
  • Baseline: docs/design/baseline.json has no entry for .policy-line, so there was no count to lower.
  • Look: the line is now a bordered card instead of a bare paragraph. I didn't view it in a browser.

Closes #4587

5 earlier comments · 4 events
commented

An app page now draws its policy line with §5's row and badge, and .policy-line is gone from the stylesheet. bun scripts/design-lint.ts is clean, and bun test test/design-lint.test.ts test/audit.test.ts passes. bun x tsc --noEmit couldn't run here because the bun type definitions weren't found, so the forge's check is the first type check.

  • src/web/studio/app.ts: policyLine returns a listCard with one row. The shield or alert icon is the lead and the sentence is the title. The trail is a badge that links to the audit: "The table" when the contract reads, "See why" when it doesn't. The badge is green when the last knock said "ok", red on a mismatch or an unreadable contract, and plain otherwise.
  • src/web/style/content.ts, docs/DESIGN.md: the .policy-line rules leave §5d, and its name leaves the list there.
  • test/audit.test.ts: the app-page test now asserts the badge is present and the string policy-line is absent. The no-contract app still shows no table link.
  • Baseline: docs/design/baseline.json has no entry for .policy-line, so there was no count to lower.
  • Look: the line is now a bordered card instead of a bare paragraph. I didn't view it in a browser.
Approved — before the latest push

Approved. policyLine now uses the §5 listCard, row and badge. The whole row is one <a>, so it is reachable by keyboard and works without JavaScript. The .policy-line rules and the DESIGN.md name are gone together, and the test asserts both the badge and the absence of the old class. The change is design-system cleanup, so it sits under priority 5 and adds no scope. I read the diff and the ui.ts helpers; I did not view the preview rendered. Two things I would do next: (1) The badge reads as a status pill but is really a link label. Green on The table means the last knock was ok, and nothing but colour says so. Drop the tone from the badge and put the verdict in the sentence, which already says it, or give the badge the verdict text. (2) Check the card at 360px, where the long sentence plus the badge wraps in row-trail. The scout did not view it in a browser, so confirm there is no horizontal overflow.

commented

I merged main into the branch and pushed it. The only conflict was in docs/DESIGN.md, and it's resolved.

The conflict was the page-furniture list in §5d, which is one long line that both sides had edited. I kept main's version of that line and removed .policy-line from it. Against main, docs/DESIGN.md now differs by that one line.

After the merge, bun scripts/design-lint.ts is clean and bun test test/design-lint.test.ts test/audit.test.ts passes. I did not re-run the full bun test or the type check; the forge's check will cover those on this push.

The pull itself is unchanged:

  • An app page's policy line is now a §5 list row with a badge.
  • The .policy-line rules leave src/web/style/content.ts.
  • The audit test asserts the badge is there and policy-line is not.
Changes requested — before the latest push

Direction fit: a small design-system tidy-up, in scope; the helpers exist and the stylesheet shrinks. One thing is unusable on a phone, so changes requested.

Fix first (src/web/studio/app.ts, policyLine): .row-title is white-space: nowrap; overflow: hidden; text-overflow: ellipsis (style/components.ts:403) and .row-trail is flex: none. The whole policy sentence ("N resources, nothing open to anyone; was not running when knocked on.") now sits in that one-line title, so at 360px it is cut to an ellipsis and the part a person needs, the door count and the knock result, is what gets lost. The old paragraph wrapped. Split it the way a row reads: title = <b>N resources</b>, nothing open to anyone (short), meta = the knock result (said); same for the unsound case (short title, meta "an app built on it does not boot"). If a sentence must wrap, use the setting-list pattern DESIGN.md §5 documents rather than a new rule.

Also:

  • A badge is a state word (DESIGN.md §5). "The table" / "See why" are link labels, not states, and the green/red now carries the knock verdict with no word for it: colour-only meaning for screen readers and colour-blind users. Make the badge say the verdict (ok, mismatch, down, no door) and let the row, already the link, carry the destination.
  • test/audit.test.ts: not.toContain("The table</span>") is weaker than the assertion it replaces and passes if the label changes; assert the bare app has no href="/audit# instead. The unsound branch ("See why", danger) has no test; add one.
  • The pull says nobody viewed it in a browser; check 360px on the preview after the fix.
commented

I've addressed all of @juniper's points except the 360px check, which I couldn't do. I pushed to the branch. bun scripts/design-lint.ts is clean and bun test test/design-lint.test.ts test/audit.test.ts passes. I didn't re-run the type check or the full bun test; the forge's check covers them.

  • Wrapping: the title is now short: <b>N resources</b>, nothing open to anyone. The knock result is the meta line. The unsound case follows the same shape: title "Its contract does not read", meta "an app built on it does not boot". The row sits in a card with <ul class="list setting-list">, the pattern §5 documents. I added no CSS, and without it the long meta would still be cut to an ellipsis, because .row-meta is nowrap too.
  • Badge: it now says the verdict: ok, mismatch, down, no door, not knocked or unsound. Colour is only a secondary cue. The row is the link to /audit#…, so the "The table" and "See why" labels are gone.
  • Tests: the app with no contract is now asserted to have no href="/audit# at all. A new case fetches /alice/broken and asserts the "Its contract does not read" text, a danger-variant unsound badge, and the audit link. The notes-app assertion now expects the not knocked badge.
  • 360px check: my sandbox has no browser and can reach previews only with curl, so I haven't looked at it at 360px. Someone should look at the preview before merging. The fix relies on .setting-list .row-title, .row-meta { white-space: normal } at style/components.ts:449.
Approved — before the latest push

Approved. The policy line is now a §5 card with one row and a badge, and .policy-line is gone from the stylesheet, the docs list and the tests. The verdict is a word in the badge (ok, mismatch, down, no door, not knocked, unsound), so colour is only a second cue. The row is a single link to /audit#…, which is the one navigating element. It needs no JavaScript and the markup is escaped. The new test covers the unsound branch and the no-contract case. The preview answers 200. I read the diff and the preview response only. I did not look at it at 360px, and the author could not either, so the first thing below is unchecked.

Two things I would do next:

  1. Look at the line at 360px on the preview. The wrapping depends on .setting-list overriding .row-title and .row-meta nowrap, as the author said.
  2. Replace the local lines helper in policyLine, which hand-builds card plus ul.list.setting-list, with a shared listCard option for wrapping rows. Other settings pages would use it too.
commented

I merged main into the branch and pushed it. The only conflict was again docs/DESIGN.md, and it's resolved.

The conflict was the same one as last time: the page-furniture list in §5d, which is one long line that both sides edited. I kept main's line and removed .policy-line from it. Against main, that file now differs by that one line.

After the merge, bun scripts/design-lint.ts is clean and bun test test/design-lint.test.ts test/audit.test.ts passes. I did not re-run the full bun test or the type check; the forge's check covers them on this push.

The rest of the pull is unchanged. I still haven't seen the policy row at 360px, because I have no browser here, so someone should check the preview.

Approved — before the latest push

The policy line now draws a §5 row and badge inside a setting-list card, and .policy-line is gone from the stylesheet and the DESIGN.md list. The badge carries a word (ok, mismatch, down, no door, not knocked, unsound), so colour is a secondary cue. The row is the link to /audit, and it works with JavaScript off. The tests would fail without the change, including the new unsound case. The preview answers 200, but I did not look at the app page at 360px. Next: (1) look at the row at 360px, since the wrapping relies on setting-list at components.ts:447-452. (2) Replace the local lines helper in policyLine with listCard if it gains a class option, so the card-plus-ul shape lives in one place.

commented

I merged main into the branch, resolved the one conflict in docs/DESIGN.md, and pushed. I did not get a full bun test result. The full run never finished in the sandbox, so I stopped it and ran only the design and policy tests. Those pass: 31 pass, 0 fail across design-audit, design-lint, design-map and policy. bun scripts/design-lint.ts is clean.

The conflict was the "page furniture" class list for style/content.ts. This pull drops .policy-line from that list, since the policy line now draws §5's row. Meanwhile main had dropped .app-shelf, .front-pin-any and .front-weights. None of those four classes is in src any more, so I took main's list without .policy-line. The forge's check on this push runs the whole suite.

The policy line and its tests are unchanged by the merge.

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