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

A pull's page fits a 390 px phone: its title, branch names and conversation wrap instead of scrolling sideways #9356

Merged opened this

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

Merged

A pull's conversation page should now wrap its title, branch names and comments on a 390 px phone. I can't confirm that it doesn't scroll sideways. This sandbox has no Chromium, so the two measured tests were skipped. The preview's phone look of `/preview-admin/sample/pulls/3` is the place to check; it's the only measurement of the sideways scroll.

shipped production is serving it deploy cc21c84

opened this

A pull's conversation page should now wrap its title, branch names and comments on a 390 px phone. I can't confirm that it doesn't scroll sideways. This sandbox has no Chromium, so the two measured tests were skipped. The preview's phone look of /preview-admin/sample/pulls/3 is the place to check; it's the only measurement of the sideways scroll.

I don't know why the check stayed red on the earlier tries, so that is my guess at a fix. The branch was behind main, so I merged main in (clean). I also changed the measured test, which I think may have been the red one.

What changed

  • CSS: the long title, the branch names (.mono) and the comment text (.prose) use overflow-wrap: anywhere. Timeline items can shrink, so a 300-character word can't widen the page. The edits are in src/web/style/base.ts, components.ts and content.ts.
  • Docs: docs/design/areas/pull.md notes the wrapping. No new class was added.
  • Test: test/pull-phone-fit.test.ts seeds the sample pull with a long title, a 200-character branch, and 12 comments holding a 300-character word and a long URL. It asserts that:

- the page ships no inline or CSS width over 390 px; - the three containers above carry overflow-wrap.

  • Measured part: where a Chromium runs, it also loads the page at 390×844 and 1280×800 and requires no horizontal scroll.
  • This push: the measured part now ignores elements inside a pre, a diff box or other scroll containers, since those may scroll in their own box. I think the earlier red check came from that.

Checks

  • Passed here: gate.ts, tsc --noEmit, design-lint.ts, and the 58 test files that fast.ts names (811 pass, 0 fail).
  • Skipped: the two measured tests in test/pull-phone-fit.test.ts.

Not done

  • No route, data read or src/http/api.ts change.

To try it

  • Open /preview-admin/sample/pulls/3 on the preview at 390 px wide, and look for a sideways scroll.
  • If the check goes red again, its log will show which element the measured test reports as overflowing.

🤖 Generated with Claude Code

Closes #9327

commented

A pull's conversation page should now wrap its title, branch names and comments on a 390 px phone. I can't confirm that it doesn't scroll sideways. This sandbox has no Chromium, so the two measured tests were skipped. The preview's phone look of /preview-admin/sample/pulls/3 is the place to check; it's the only measurement of the sideways scroll.

I don't know why the check stayed red on the earlier tries, so that is my guess at a fix. The branch was behind main, so I merged main in (clean). I also changed the measured test, which I think may have been the red one.

What changed

  • CSS: the long title, the branch names (.mono) and the comment text (.prose) use overflow-wrap: anywhere. Timeline items can shrink, so a 300-character word can't widen the page. The edits are in src/web/style/base.ts, components.ts and content.ts.
  • Docs: docs/design/areas/pull.md notes the wrapping. No new class was added.
  • Test: test/pull-phone-fit.test.ts seeds the sample pull with a long title, a 200-character branch, and 12 comments holding a 300-character word and a long URL. It asserts that:

- the page ships no inline or CSS width over 390 px; - the three containers above carry overflow-wrap.

  • Measured part: where a Chromium runs, it also loads the page at 390×844 and 1280×800 and requires no horizontal scroll.
  • This push: the measured part now ignores elements inside a pre, a diff box or other scroll containers, since those may scroll in their own box. I think the earlier red check came from that.

Checks

  • Passed here: gate.ts, tsc --noEmit, design-lint.ts, and the 58 test files that fast.ts names (811 pass, 0 fail).
  • Skipped: the two measured tests in test/pull-phone-fit.test.ts.

Not done

  • No route, data read or src/http/api.ts change.

To try it

  • Open /preview-admin/sample/pulls/3 on the preview at 390 px wide, and look for a sideways scroll.
  • If the check goes red again, its log will show which element the measured test reports as overflowing.

🤖 Generated with Claude Code

commented

I pushed a second fix attempt, but I can't confirm it clears the failing phone test. This sandbox has no Chromium, so I can't run "phone, 390x844: no sideways scroll". The check log didn't say which element overflowed, so both changes below come from reading the CSS and the preview's HTML.

What changed

  • src/web/style/content.ts: .split (the conversation page's content-plus-sidebar grid) now has one minmax(0, 1fr) column below 960 px. Before, it had no column template, so a long unbreakable line in a comment could widen that column and the page. At 960 px and wider the two-column rule still applies.
  • test/pull-phone-fit.test.ts: the measured look listed every element in main whose right edge passed the viewport. That includes the repository tab links inside .tabs, which scrolls sideways inside its own box by design, so the test could have failed on them. It now skips elements inside any ancestor with non-visible overflow-x, clip-path elements, and fixed-position elements. The scrollWidth <= viewportWidth assertion is unchanged, and it is the real criterion.

Checks

  • Passed here: tsc --noEmit, design-lint.ts, gate.ts, and the 59 test files fast.ts names (815 pass, 0 fail).
  • If the forge check fails again, the measured test prints pull look 390x844: {…} with the overflowing element names. That line is the next thing to read.

The earlier pull description still applies: the preview's phone look of /preview-admin/sample/pulls/3 is the thing to check.

🤖 Generated with Claude Code

commented

I pushed another fix attempt, but I can't confirm it clears the failing test ("phone, 390x844: no sideways scroll"). This sandbox has no Chromium, so I can't run it. The check log also doesn't show which assertion failed or which element overflowed, so this is a best guess.

What changed

  • test/pull-phone-fit.test.ts: the overflow list now covers only .page-head and .split (the title block and the conversation grid), not the whole of main. Layout chrome such as the tab strip and menus sits outside those two. The comment in test/bets-card-fit.test.ts says test/web-phone.test.ts holds that chrome. I'm assuming the earlier list tripped on it.
  • The scrollWidth <= viewportWidth assertion is unchanged.

What I haven't ruled out

  • If scrollWidth itself is over 390 px, this change won't fix it.
  • The measured test prints pull look 390x844: {…} with scrollWidth, viewportWidth and the overflowing element names. Read that line in the next check log for the real cause.

Checks

  • Passed here: tsc --noEmit and test/pull-phone-fit.test.ts.
  • Skipped here: the two measured tests in that file.

The earlier fixes still stand: the CSS wraps the title, branch names and comments, and .split has a single shrinkable column on a phone. To check by hand, open /preview-admin/sample/pulls/3 at 390 px wide and look for a sideways scroll.

🤖 Generated with Claude Code

Changes requested — before the latest push

Fix first: the pull description must do what box 3 of #9327 asks. Link the preview's phone look of /preview-admin/sample/pulls/3 and say in one line whether it scrolls sideways. Today the description says the author could not measure it, and the two measured tests are skipped where Mason ran them. Run the measured test on the forge check or a preview and report its pull look 390x844 line. The unmeasured claim is the pull's whole point.

Also:

  1. The .split { grid-template-columns: minmax(0, 1fr) } rule in content.ts is global, so it changes every page that uses .split, not only the pull page. The cascade is probably safe (the 960px and data-rail rules come later), but say so in docs/design/areas/pull.md, or scope it. The .split > * {min-width:0} rule above it already exists.
  2. In the test, row is only used for a toBeGreaterThan(0) sanity check and the query is redundant. Drop it. The two near-duplicate width regexes can be one helper.
  3. The preview currently shows the seed's short content, so it cannot show the wrap. The measured test seeds the long content, so it needs to actually run somewhere.

The CSS direction (overflow-wrap: anywhere on h1, .mono and .prose, min-width:0 on .tl-item) is sound, there is no new class, and the docs note is in the area file, not DESIGN.md or README.

commented

A pull's conversation page should wrap its title, branch names and comments on a 390 px phone instead of scrolling sideways. I can't see the pull look 390x844 line myself, and the preview still can't show the wrap. The measured test ran only on the forge check (this sandbox has no Chromium).

What I can say about the phone look

  • On the previous push, d860d874, the forge reported the pull's check as green. The two measured tests (390×844 and 1280×800) had failed on earlier pushes, so they ran on the forge and passed, which means no sideways scroll at 390 px. I haven't read the log line itself, so I'm not quoting its numbers.
  • The preview is at https://lab--9356--forge-trevato-apps.open-platform.sh/preview-admin/sample/pulls/3. It shows only the seed's short content, so it can't show the wrap. The seeded long title, 200-character branch and 300-character word exist only inside the measured test, and that test cannot add them to the preview.
  • This push adds only docs and test cleanup, so I expect the same check result; the new check on 3e31e006 will confirm it.

What changed this push

  • test/pull-phone-fit.test.ts:

- I dropped the redundant row query and its sanity check. - The two near-duplicate width regexes are now one helper, widthsOver390. - The test still asserts the same things.

  • docs/design/areas/pull.md:

- I kept the global .split { grid-template-columns: minmax(0, 1fr) } rule and documented it instead of scoping it. - The min-width: 960px and data-rail="wide" rules come after it in the same file and still set their two columns, so desk layouts don't change.

Checks

  • Passed here: tsc --noEmit, design-lint.ts, gate.ts, and test/pull-phone-fit.test.ts.
  • Skipped here: the two measured tests in that file, for lack of Chromium.

🤖 Generated with Claude Code

Approved

The head wraps the title, branch names (.mono) and comments (.prose) with overflow-wrap: anywhere. .split is a single minmax(0,1fr) column below 960px, and the desk rules still come after it. The check was green on the earlier head, so the measured 390px and 1280px tests ran and passed on the forge. The preview answers 200 for /preview-admin/sample/pulls/3. I could not read the diff since d860d874 (commit not in my clone), so I read the whole change. Earlier asks: the .split rule is now documented in docs/design/areas/pull.md, and the duplicate regex is merged into one helper. Both are met. Next two things: (1) Non-blocking: .split and .mono are global, so check one other split page on a phone. (2) Non-blocking: put the measured look numbers (pull look 390x844) in the pull description, since the preview itself shows only short seed content. No new class; the fix is in the style modules, not pages/pull.ts.

commented

Left #9327 open: 1 unticked item remain (The pull description links the preview's phone look of /preview-admin/sample/pulls/3, and says in one line whether it scrolls sideways.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs