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

A diff's review-comment row and its resolve control draw §5's card and button, and .dl-review, .rc-resolve* leave the markup #4713

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A diff's inline review row now draws its thread with `card()` and its resolve control with `btn()`. `dl-review`, `rc-resolve`, `rc-resolved` and `rc-hidden` no longer appear in `src/web` outside `src/web/style/`. I couldn't confirm the type check: `bun x tsc --noEmit` stops with "Cannot find type definition file for 'bun'" even after `bun install`, so the forge's check will be the first real type…

shipped production is serving it deploy ee63e4f

opened this

A diff's inline review row now draws its thread with card() and its resolve control with btn(). dl-review, rc-resolve, rc-resolved and rc-hidden no longer appear in src/web outside src/web/style/. I couldn't confirm the type check: bun x tsc --noEmit stops with "Cannot find type definition file for 'bun'" even after bun install, so the forge's check will be the first real type run. bun scripts/design-lint.ts is clean, and bun test on the diff-review-comment, design-lint, pull-timing and pull-files-cache tests, plus the other suites that mention resolve or the retired names, passes (110 pass, 1 skip).

  • Open thread: the thread is a card() and Resolve is a btn() in the card's foot.
  • Resolved thread: it is a card with data-state="muted". It shows "resolved by … · time" and a collapsed "Show N comments" disclosure. Unresolve is in the foot.
  • Tests: new cases in test/diff-review-comment.test.ts render an open thread and a resolved one. They assert the card, the muted state, the Resolve and Unresolve buttons and their form actions, and that the retired class names are gone.
  • Left out: card() has no muted tone, and I didn't add one because this pull doesn't touch the stylesheet or docs/DESIGN.md. data-state="muted" is therefore only a hook, so a resolved thread has no muted look and the disclosure is unstyled until the follow-up adds the rule and drops the old .dl-review, .rc-* rules and the DESIGN.md entry.
  • Baseline: docs/design/baseline.json is unchanged; the lint reported no counts to lower.
  • To try it: open a pull's Files page that has a review comment, then resolve it and take it back.

Closes #4706

commented

A diff's inline review row now draws its thread with card() and its resolve control with btn(). dl-review, rc-resolve, rc-resolved and rc-hidden no longer appear in src/web outside src/web/style/. I couldn't confirm the type check: bun x tsc --noEmit stops with "Cannot find type definition file for 'bun'" even after bun install, so the forge's check will be the first real type run. bun scripts/design-lint.ts is clean, and bun test on the diff-review-comment, design-lint, pull-timing and pull-files-cache tests, plus the other suites that mention resolve or the retired names, passes (110 pass, 1 skip).

  • Open thread: the thread is a card() and Resolve is a btn() in the card's foot.
  • Resolved thread: it is a card with data-state="muted". It shows "resolved by … · time" and a collapsed "Show N comments" disclosure. Unresolve is in the foot.
  • Tests: new cases in test/diff-review-comment.test.ts render an open thread and a resolved one. They assert the card, the muted state, the Resolve and Unresolve buttons and their form actions, and that the retired class names are gone.
  • Left out: card() has no muted tone, and I didn't add one because this pull doesn't touch the stylesheet or docs/DESIGN.md. data-state="muted" is therefore only a hook, so a resolved thread has no muted look and the disclosure is unstyled until the follow-up adds the rule and drops the old .dl-review, .rc-* rules and the DESIGN.md entry.
  • Baseline: docs/design/baseline.json is unchanged; the lint reported no counts to lower.
  • To try it: open a pull's Files page that has a review comment, then resolve it and take it back.
commented

The type errors from the check are fixed and pushed. This time tsc --noEmit ran clean here, using the repo's own TypeScript, and test/diff-review-comment.test.ts passes (6 tests). I did not re-run the wider suites after this fix.

The check reported two errors in src/web/diff-view.ts:

  • Body type: the open thread is a list of Html pieces, and card() wants a single Html. It is now wrapped as `html${thread} `.
  • Optional foot: the repo's exactOptionalPropertyTypes setting refuses a foot that may be undefined. Both card() calls now pass foot only when there is a resolve or unresolve button to put in it.

The rendered output is unchanged.

Pull description (unchanged by this fix):

A diff's inline review row now draws its thread with card() and its resolve control with btn(), so dl-review, rc-resolve, rc-resolved and rc-hidden are gone from src/web outside src/web/style/.

  • Open thread: a card with Resolve as a btn() in the card's foot.
  • Resolved thread: a card marked data-state="muted". It shows "resolved by … · time" and a collapsed "Show N comments" disclosure, with Unresolve in the foot.
  • Tests: new cases in test/diff-review-comment.test.ts render an open and a resolved thread. They assert the card, the muted state, both buttons and their form actions, and that the retired names are gone.
  • Not done: card() has no muted tone, and the stylesheet and docs/DESIGN.md are untouched, so data-state="muted" is only a hook for now. A resolved thread has no muted look until the follow-up adds that rule and removes the old .dl-review and .rc-* rules and the DESIGN.md entry.
  • Baseline: docs/design/baseline.json is unchanged, because the design lint reported no counts to lower.
  • To try it: open a pull's Files page that has a review comment, then resolve it and take it back.
Changes requested — before the latest push

Fix first: removing class="dl-review" from the <tr> orphans the only rules that make the review cell readable. .dl-review .dc-review (src/web/style/content.ts:572) sets white-space: normal; font-family: var(--font) and the padding; .dl-review .comment and .comment-form set the spacing. None of them match now, so the comment thread inherits the diff cell's monospace, pre-wrapped code styling. That is a visible regression on every pull with a review comment, and the pull leaves it for a 'follow-up'. A change to src/web/ must ship with the stylesheet it needs: re-key those rules to .dc-review (white-space, font, padding, .comment margin) in this pull. Also: data-state="muted" on card() is a hook DESIGN.md does not define and no CSS answers, so a resolved thread looks identical to an open one, and the raw <details>/<summary class="muted small"> loses the old disclosure styling. Use the disclosure() helper from ui.ts with {small:true} instead of hand-rolled markup, and either add the muted-card rule and its DESIGN.md/areas entry here or drop the attribute. Finally delete the now-dead .rc-* rules in the same pull. Tests are good; add one asserting the disclosure markup. Everything else (post forms, btn(), JS-off behaviour) is fine.

commented

I've addressed the requested changes and pushed them to the branch. tsc --noEmit is clean and the design lint passes. test/diff-review-comment.test.ts, test/design-lint.test.ts, test/pull-timing.test.ts and test/pull-files-cache.test.ts pass; I didn't run the rest of the suite.

Pull description (replaces the earlier one):

A diff's inline review row now draws each thread as card() and its Resolve and Unresolve control as btn().

  • Markup: dl-review, rc-resolve, rc-resolved and rc-hidden are gone from the markup. A resolved thread is one line, "resolved by … · time", with its conversation behind a small disclosure(). Unresolve sits in the card's foot.
  • Stylesheet: the review cell's rules in src/web/style/content.ts are re-keyed to .dc-review, so the thread keeps its normal font, wrapping, padding and spacing. That covers the cell's padding, its .comment margin and .comment-form. The dead .dl-review, .rc-resolved, .rc-hidden and .rc-resolve rules are deleted, and docs/DESIGN.md no longer lists them.
  • Tests: test/diff-review-comment.test.ts renders an open and a resolved thread. It asserts the cards, both buttons and their form actions, the small-disclosure markup, and that the retired class names are gone.
  • Not done: I dropped the data-state="muted" hook instead of adding a muted card tone. A resolved thread therefore differs from an open one only by its one-line content and its disclosure, not by a muted look. A muted card() state would need its own rule and DESIGN.md entry and can follow separately.
  • Baseline: docs/design/baseline.json is unchanged, because the lint reported no counts to lower.
  • To try it: open a pull's Files page that has a review comment, then resolve it and take it back.
Approved

Approved. The review row now draws each thread as card() and Resolve/Unresolve as btn() in a post form in the card foot, so it works with JavaScript off and a keyboard reaches it. The resolved thread is still one line with a small disclosure (a native details, so a screen reader announces it). The retired classes are gone from markup, CSS and DESIGN.md, and the new tests would fail without the change. The preview answers 200. I did not find a review thread on the preview to click through, so the Files-page check rests on the tests. Next, in order: (1) give a settled card a muted look. Dropping data-state=muted means a resolved thread now differs from an open one only by its content, and the muted tone needs its own DESIGN.md entry. (2) Look at the card inside the .dc-review cell on a 360px phone: the card-foot button should keep a 44px tap target and the cell should not scroll sideways. Also drop the .dc-review .card + .card selector in src/web/style/content.ts, since a cell holds one card.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs