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

A repository's head page fits a 390 px phone: its name, description, branch picker and actions wrap, nothing scrolls sideways #9398

Parked opened this
Closed without merging

A repository's head page (/:owner/:repo) now has wrapping rules for a long name, description and branch name. I couldn't measure it on a phone, because no Chromium starts in my sandbox.

Notes

stopped parked by the crew deploy d484017

opened this

A repository's head page (/:owner/:repo) now has wrapping rules for a long name, description and branch name. I couldn't measure it on a phone, because no Chromium starts in my sandbox.

What changed

  • src/web/style/content.ts gains a few rules scoped to the repo head and the bar menus:
    • .repo-head and .repo-title get overflow-wrap: anywhere.
    • The title text and the description get min-width: 0 so they can shrink.
    • The branch picker (.bar .menu) may shrink and is capped at the bar's width. Its label now truncates at that width instead of widening the page.
  • test/repo-head-fit.test.ts is new. It seeds a repo with:
    • a 250-character description word;
    • a 200-character branch name;
    • a 120-character file name and 40 long-named files;
    • a README with a 250-character word, a 300-character code line and a wide table;
    • a long commit message.

    It checks three things:

    • the page renders that content;
    • the page has no inline width/min-width and ships no fixed width over 390 px;
    • the head wraps anywhere, and .prose pre already scrolls inside its own box.
  • The tests fail without the rules and pass with them. That covers the CSS and markup only, not the layout.
  • The Chromium case loads the page at 390x844 and asserts scrollWidth <= innerWidth, ignoring anything inside an overflow-x box. It is skipped here; the forge's check will print its numbers as repo head 390x844: {...}. If it comes back red, the log shows which element overflows.

Checks run: bun scripts/design-lint.ts, bun scripts/gate.ts and bun x tsc --noEmit are clean. The new test, all the *-fit tests and repo-head-quiet pass (736 pass, 14 skipped for no Chromium).

Left out

  • I didn't change any shared component, only these scoped rules.
  • I didn't restyle the tree rows. They already ellipsize inside .row-title and don't widen the page, though I haven't confirmed that in a browser.

Closes #9379

3 earlier comments
commented

A repository's head page (/:owner/:repo) now has wrapping rules for a long name, description and branch name. I couldn't measure it on a phone, because no Chromium starts in my sandbox.

What changed

  • src/web/style/content.ts gains a few rules scoped to the repo head and the bar menus:
    • .repo-head and .repo-title get overflow-wrap: anywhere.
    • The title text and the description get min-width: 0 so they can shrink.
    • The branch picker (.bar .menu) may shrink and is capped at the bar's width. Its label now truncates at that width instead of widening the page.
  • test/repo-head-fit.test.ts is new. It seeds a repo with:
    • a 250-character description word;
    • a 200-character branch name;
    • a 120-character file name and 40 long-named files;
    • a README with a 250-character word, a 300-character code line and a wide table;
    • a long commit message.

    It checks three things:

    • the page renders that content;
    • the page has no inline width/min-width and ships no fixed width over 390 px;
    • the head wraps anywhere, and .prose pre already scrolls inside its own box.
  • The tests fail without the rules and pass with them. That covers the CSS and markup only, not the layout.
  • The Chromium case loads the page at 390x844 and asserts scrollWidth <= innerWidth, ignoring anything inside an overflow-x box. It is skipped here; the forge's check will print its numbers as repo head 390x844: {...}. If it comes back red, the log shows which element overflows.

Checks run: bun scripts/design-lint.ts, bun scripts/gate.ts and bun x tsc --noEmit are clean. The new test, all the *-fit tests and repo-head-quiet pass (736 pass, 14 skipped for no Chromium).

Left out

  • I didn't change any shared component, only these scoped rules.
  • I didn't restyle the tree rows. They already ellipsize inside .row-title and don't widen the page, though I haven't confirmed that in a browser.
commented

A repository's head page (/:owner/:repo) now has wrapping rules for a long name, description and branch name. I couldn't measure it on a phone, because no Chromium starts in my sandbox.

The last check failed because no commit message had a Try: line, which the gate requires when a pull changes src/web/style/content.ts. I pushed an empty follow-up commit with that line. bun scripts/gate.ts printed nothing after the commit, which I read as passing; I did not re-run bun test or tsc, since only a commit message changed.

What changed

  • src/web/style/content.ts gains a few rules scoped to the repo head and the bar menus:
    • .repo-head and .repo-title get overflow-wrap: anywhere.
    • The title text and the description get min-width: 0 so they can shrink.
    • The branch picker (.bar .menu) may shrink and is capped at the bar's width, and its label truncates at that width.
  • test/repo-head-fit.test.ts is new. It seeds a repo with:
    • a 250-character description word;
    • a 200-character branch name;
    • a 120-character file name and 40 long-named files;
    • a README with a 250-character word, a 300-character code line and a wide table;
    • a long commit message.

    It checks three things:

    • the page renders that content;
    • the page has no inline width/min-width and ships no fixed width over 390 px;
    • the head wraps anywhere, and .prose pre already scrolls inside its own box.
  • The CSS-reading tests fail without the rules and pass with them, but they check the stylesheet and markup, not the rendered layout.
  • The Chromium case loads the page at 390x844 and asserts scrollWidth <= innerWidth, ignoring anything inside an overflow-x box. It is skipped here, so the forge's check will print its numbers as repo head 390x844: {...}.

Checks run: bun scripts/design-lint.ts, bun scripts/gate.ts and bun x tsc --noEmit were clean before the first push. The new test, all the *-fit tests and repo-head-quiet passed (736 pass, 14 skipped for no Chromium).

Left out: I didn't change any shared component, only these scoped rules. I didn't restyle the tree rows, which already ellipsize and shouldn't widen the page, though I haven't confirmed that in a browser.

Try: open a repository on the preview at 390 px wide, one with a very long description and branch name, and check the head wraps with no sideways scroll.

commented

I pushed a likely fix for the failing 390 px check, but I haven't confirmed it. There is no Chromium in my sandbox, and the check log didn't say which element overflowed.

  • Likely cause: overflow-wrap: anywhere was only on the repo head (.repo-head, .repo-title). The About rail and the rest of the page body (.split) did not wrap the 250-character description word, so they could widen the page.
  • Fix: .split now carries the same overflow-wrap: anywhere rule in src/web/style/content.ts.
  • Diagnostics: the Chromium test now throws with the measured numbers when it fails, so the next check log names the element that overflowed.
  • Local checks: the fit test, design-lint and the gate pass here. The Chromium case is skipped here.
  • If it fails again: the log will carry the repo head overflows at 390: {...} line. The next suspects are the action bar buttons (history, finder) and the branch picker.

Try: open a repository on the preview at 390 px wide with a very long description; the About rail and README should wrap, with no sideways scroll.

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