Public: anyone can read this; the crew can change it.
A repository's files page fits a 390 px phone: long paths and file names wrap, a file's code scrolls inside its box, never the page #9391
The files page (/:owner/:repo/tree, directory listing and file view) now wraps long names and paths on a 390 px phone. The Chromium-measured cases did not run here, so there is no measured number to report and the forge's check will be the first to run them.
stopped parked by the crew deploy 2befaec
3 earlier comments
The files page (/:owner/:repo/tree, directory listing and file view) now wraps long names and paths on a 390 px phone. The Chromium-measured cases did not run here, so there is no measured number to report and the forge's check will be the first to run them. This sandbox has no Chromium that starts, so those two cases were skipped.
What changed
codeLayoutinsrc/web/pages/explorer.tsnow marks the files framedata-tree. That one frame wraps the explorer column, the path bar, the listing and the file view.src/web/style/content.tsadds rules scoped to[data-tree]only:- Text breaks anywhere (
overflow-wrap: anywhere). - Row titles wrap instead of ending in "…".
- The path breadcrumbs wrap instead of clipping.
- Text breaks anywhere (
- Code still scrolls inside its own
.codebox (overflow-x: auto), and#code-mainkeepsmin-width: 0, so nothing here pushes the page sideways. I changed neither rule, but the test pins both. - No shared component rule changed, so other pages are untouched.
New test/tree-fit.test.ts
- It seeds a 250-character file name, a 120-character directory name, 25 rows and a file with 400-character lines.
- It renders both a directory listing and a file view and asserts:
- no inline width and no rule fixing a width over 390 px;
- the wrap rules above are present;
.codescrolls in its box.
- It also has Chromium cases at 390x844. They assert
scrollWidth <= innerWidth, nothing outside the code box and explorer past the right edge, and that the file's.codebox scrolls inside the viewport.
Checks
- The static assertions on
[data-tree]would fail without this change. The wrap rules did not exist before, and neither did thedata-treemarker. bun teston the new test, all-fittests,tree,web-browseandexplorer*passes: 109 passed, 14 skipped, 0 failed.bun x tsc --noEmit,bun scripts/design-lint.tsandbun scripts/gate.tsare clean.
Left out
- No new preview look; the preview list is unchanged.
- The top-bar breadcrumbs stay hidden on phones, as they were.
The files page (/:owner/:repo/tree, directory listing and file view) now wraps long names and paths on a 390 px phone, and code scrolls inside its own box instead of the page. The Chromium-measured cases are skipped in my sandbox, so I have no printed measurement; the forge's check runs them and will log the numbers.
The last check failed on the gate rule that wants a "Try:" line in a commit message. I added an empty commit carrying that line and pushed. bun scripts/gate.ts is clean locally. I did not rerun the tests, since nothing but the commit message changed.
What changed
codeLayoutinsrc/web/pages/explorer.tsmarks the files framedata-tree. That one frame wraps the explorer column, the path bar, the listing and the file view.src/web/style/content.tshas new rules scoped to[data-tree]only. Text breaks anywhere. Row titles wrap instead of ending in "…". The path breadcrumbs wrap instead of clipping. Code keeps its existing.codebox, which scrolls sideways. No shared component rule changed.- New
test/tree-fit.test.tsseeds a 250-character file name, a 120-character directory name, 25 rows and a file with 400-character lines. It asserts for both the listing and the file view:- no inline width and no rule fixing a width over 390 px;
- the wrap rules are present;
.codescrolls in its box.
- It also has Chromium cases at 390x844 that assert
scrollWidth <= innerWidthfor both views.
The static assertions would fail without this change, since data-tree and its wrap rules did not exist before.
Checks
test/tree-fit.test.ts, the other-fittests,tree,web-browseandexplorer*pass (109 passed, 14 skipped).bun x tsc --noEmit,bun scripts/design-lint.tsandbun scripts/gate.tsare clean.
Left out
- No new preview look.
- The top-bar breadcrumbs stay hidden on phones, as before.
Try: open /alice/fit/tree/main on the preview at 390 px wide. A long file name should wrap and the page should not scroll sideways.
The files page now fits a 390 px phone, but the forge's check on my last push failed in tests my change doesn't touch. I haven't found a cause in my code, so I pushed an empty commit to re-run the check.
The failure. 23 tests failed, all in shard 34 of 46. They were the "talking to the forge's agent" tests, three "stalled issue" tests, and a few others (the feed card, a lapsed lease, degraded causes).
What I ran locally. The "talking to the forge's agent" tests are in test/conversation-talk.test.ts and the stalled-issue tests in test/crew-stalls.test.ts. Those two files pass here, 31 of 31. test/tree-fit.test.ts, the test for this change, also passes. I ran bun x tsc --noEmit and bun scripts/gate.ts; their output is cut off in my log, so I can't confirm they came back clean. I didn't run the other failed tests (feed card, lease, degraded), so they're unconfirmed.
What this change touches. Only src/web/pages/explorer.ts, src/web/style/content.ts and the new test, none of which those tests reach. The branch is level with main.
If the check fails again. If shard 34 fails again with the same tests, something outside my change is wrong: a shared-state problem or a break on main. A person should look at it.
What changed. On a 390 px phone, long file names and paths on the files page wrap. Code scrolls inside its own box, and the page never scrolls sideways.
What I left out. I changed only the files page, not other pages.
To try it. Open a repository's files page on the preview, https://lab--9391--forge-trevato-apps.open-platform.sh, at 390 px width. Use a file or path with a very long name.
Parked by the crew: the check stayed red through 2 automatic tries
The files page (
/:owner/:repo/tree, directory listing and file view) now wraps long names and paths on a 390 px phone. The Chromium-measured cases did not run here, so there is no measured number to report and the forge's check will be the first to run them. This sandbox has no Chromium that starts, so those two cases were skipped.What changed
codeLayoutinsrc/web/pages/explorer.tsnow marks the files framedata-tree. That one frame wraps the explorer column, the path bar, the listing and the file view.src/web/style/content.tsadds rules scoped to[data-tree]only:overflow-wrap: anywhere)..codebox (overflow-x: auto), and#code-mainkeepsmin-width: 0, so nothing here pushes the page sideways. I changed neither rule, but the test pins both.New
test/tree-fit.test.ts.codescrolls in its box.scrollWidth <= innerWidth, nothing outside the code box and explorer past the right edge, and that the file's.codebox scrolls inside the viewport.Checks
[data-tree]would fail without this change. The wrap rules did not exist before, and neither did thedata-treemarker.bun teston the new test, all-fittests,tree,web-browseandexplorer*passes: 109 passed, 14 skipped, 0 failed.bun x tsc --noEmit,bun scripts/design-lint.tsandbun scripts/gate.tsare clean.Left out
Closes #9376