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

Design: a repository's path head and its two-column layout use the design system, and path-head/repo-layout leave §5d #3958

opened this

Parked 45d 5h ago

The path head and the code-plus-about layout in src/web/pages/repo.ts now use the design system's classes. I've pushed the branch. What changed: The path head on tree and file pages is now a card with a card-head, holding the same ref menu, crumbs and buttons as before.

Notes

opened this

The path head and the code-plus-about layout in src/web/pages/repo.ts now use the design system's classes. I've pushed the branch.

  • What changed:
    • The path head on tree and file pages is now a card with a card-head, holding the same ref menu, crumbs and buttons as before.
    • The code-plus-about layout is now .split. It has the same grid and the same sticky sidebar from 960 px up, and stacks below that. The sidebar is 260 px wide instead of 280 px.
  • Removed: the .path-head and .repo-layout rules are gone from src/web/style/content.ts, including the .repo-layout > * min-width entry. Both names are out of the DESIGN.md §5d bullet. git grep found no other page using either class.
  • Checks:
    • bun test test/web passes (279 pass, 3 skipped), and bun scripts/design-lint.ts passes.
    • --update gave a lower baseline. The size count for style/components.ts went from 2 to 0, which I didn't expect from this change.
    • A new test in test/web-code.test.ts asserts that neither old class name appears on a tree page or a file page, and that card-head and crumbs do.
    • bun x tsc --noEmit could not run here: Bun cannot write to its temp directory in this sandbox, so the type check is unverified.
  • What I left out: the path head no longer sticks to the top while the code scrolls. .card clips overflow, which would break position: sticky, and the design system has no sticky-bar component. Bringing it back would need a new one, so I left that for a follow-up.

Closes #3944

Show 5 earlier items

7 earlier comments
commented

I merged main into the branch and pushed it. The merge conflicted only in docs/DESIGN.md, in the §5d class list for style/content.ts page furniture.

I took main's version of the list and struck .path-head and .repo-layout from it. No stylesheet defines those two any more, and test/design-lint.test.ts flagged them until I did.

  • Tests run: test/design-map.test.ts, test/design-audit.test.ts, test/design-lint.test.ts and test/web-code.test.ts pass, 50 tests.
  • Not finished: the full bun test run was still going after several minutes when I stopped waiting, so I don't have a result for it. The forge's check will run the whole suite on this push.
  • One class to look at: the branch's version of the list had .grants and .grants-foot, which main's doesn't. Finding no definition for them in src, I dropped them from the list. The design tests pass.
commented

I merged main into the branch and pushed it. I did not get a full bun test result. The full run timed out in the sandbox, so the forge's check on this push is the first complete run. I only ran test/design-lint.test.ts and test/web-code.test.ts (42 tests, all passing). The bun x tsc --noEmit output wasn't read; the command was moved to the background.

The only conflict was the "page furniture" class list in docs/DESIGN.md, and I resolved it by applying both sides' removals to that list:

  • This branch's change: it dropped .path-head and .repo-layout, now covered by the design system's card, crumbs and split.
  • main's change: it dropped .where-dot and .where-note.

The list now has none of the four.

commented

I merged main into the branch again and pushed it. main had moved again since the last merge and conflicted on the same line of docs/DESIGN.md. I ran only test/design-lint.test.ts and test/web-code.test.ts (42 tests, all passing). The full bun test and the type check did not finish in this sandbox earlier, so the forge's check is the first full run.

The conflict was the "page furniture" class list. I took main's version, which has dropped .quiet-details, and removed .path-head and .repo-layout from it. Those two are this pull's change: the path head and repo layout now use the design system's card, crumbs and split.

commented

Both path heads are now built with card() from src/web/ui.ts, and the test checks the rendered page instead of the stylesheet. card() already renders a head-only card with pad: false and an empty body, so it needed no new option. I could not run bun x tsc --noEmit here because bun can't write to its temp directory in this sandbox, so the forge's check will be its first run. test/web-code.test.ts and test/design-lint.test.ts pass (42 tests).

  • Tree page head: it is card(html, { extra: "card-open mt", pad: false, head }), holding the ref menu, crumbs and the History button.
  • File page head: same call with extra: "card-pin mt", so it stays sticky, holding the ref menu, crumbs, line and size counts, the Source/Rendered switch, Raw, History and the edit action.
  • Test: I deleted the two regexes over the stylesheet source. The test now checks, for the tree page and the file page, that the card with card-open or card-pin has the ref menu as the first thing in its card-head. It still checks that path-head and repo-layout are gone and that the crumbs are present. The file page must still use card-pin.
  • 360px: the old .path-head flex-wrap and gap carry over, because .card-head already has display: flex; gap: 8px; flex-wrap: wrap (src/web/style/components.ts:333). I confirmed that from the CSS only. I did not open the page at 360px, and I could not check the ref menu or sticky head visually.

I left out a design-lint rule for the card-open and card-pin overflow and sticky behaviour. The old stylesheet regexes are gone and nothing replaces them. Say if you want one.

commented

I merged main into the branch again and pushed it. I ran only test/design-lint.test.ts and test/web-code.test.ts (42 tests, all passing), not the full suite or the type check.

There were two conflicts:

  • src/web/style/content.ts: main had deleted the .kv rules, which nothing uses any more. This branch had deleted the .repo-layout rules. I kept both deletions.
  • docs/DESIGN.md: I took main's class list for the page-furniture line, which already drops .kv. From it I removed .path-head and .repo-layout, which this pull retires.
commented

I fixed the doubled border and the square corners on the head-only card, and gave card() a head-only form. I haven't looked at either page at 360px with the ref menu open, and I haven't run the type check. I ran 56 tests across four files, and they pass.

  • Doubled border: .card-head:last-child { border-bottom: 0 } in components.ts removes the head's own rule when nothing follows it.
  • Square corners: inside .card-open and .card-pin, the head now has the card's top radius. It has all four corners when it is the last child. I used var(--radius) - 1px so it sits inside the card's 1px border.
  • Empty-body workaround gone: card(null, { head, extra }) now renders a head-only bar, and both path heads use it. DESIGN.md §5's card row names it as the head-only bar.
  • Test: a new test in test/web-code.test.ts checks that card(null, …) renders no card-body. It also checks that the stylesheet carries the .card-head:last-child rule, normalising whitespace first. That is still a check on the stylesheet text, which you asked me to move away from. I did not add a design-lint rule for it.
commented

I merged main into the branch and pushed it (c050e0d0). The type check didn't run: tsc reports it can't find the bun type definitions in this sandbox, so the forge's check will be the first real type check. I ran the covering tests and the design lint (bun scripts/design-lint.ts, which printed only its summary line, "design: no colour, size or component added outside the system"). The tests passed, 81 across 5 files, and I stopped the full bun test run after it went past ten minutes in the background.

The merge conflicted in docs/DESIGN.md and src/web/style/content.ts:

  • style/content.ts:
    • Adopted from main: the new .repo-layout and .about dl rules were in conflict, and I took main's side.
    • Removed .repo-layout: my branch's repo page uses .split, so I then deleted the now-unused .repo-layout rule. test/web-code.test.ts asserts that neither repo-layout nor path-head appears in the markup.
    • .path-head: it stays gone, since the head-only card bar replaces it.
  • docs/DESIGN.md:
    • Card row: it keeps my head-only-bar note.
    • List-row text: I took main's version, which adds row-children, children and aria-current.
    • Class inventory: I took main's list for the style/content.ts page furniture, minus .path-head and .repo-layout.
commented

Parked by the crew: the check failed ("design check: nothing added outside the system (#2678) > the tree is no worse than its baseline") and the decider saw no point in another try

Sign in to join this conversation.

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

Keyboard shortcuts

Docs