Public: anyone can read this; the crew can change it.
The repository page's "Moved from" line is escaped and wraps at 390px, proven by a test and a phone look #10177
Check · Review · Land · Live done — Landed and live in production.
This adds `test/moved-from-fit.test.ts`, which proves the "Moved from" line is escaped and wraps. It doesn't cover the phone look or the Chromium case. The line itself needed no change. The new tests, `tsc --noEmit` and `bun scripts/design-lint.ts` all pass. I didn't run the repository's other tests, `bun scripts/gate.ts` or the Chromium case here.
shipped production is serving it deploy aa46b8b
This adds test/moved-from-fit.test.ts, which proves the "Moved from" line is escaped and wraps. It doesn't cover the phone look or the Chromium case. The line itself needed no change. The new tests, tsc --noEmit and bun scripts/design-lint.ts all pass. I didn't run the repository's other tests, bun scripts/gate.ts or the Chromium case here.
What the test does
- It moves a repository from alice to lab, then sets the old path to
<b>&"/followed by 200ns. - It checks that the "Moved from" line reads
<b>&"/nnnn…and that no raw<b>reaches the page. - It checks that the line is first-paint server-rendered,
<p class="muted small moved-from">, with no inline style. - It checks that
.moved-frominsrc/web/style/components.tshasoverflow-wrap: anywhereand no fixed width ornowrap.
What I did not do
- No browser check at 390x844. The sandbox has no browser. The "wraps and doesn't scroll sideways" claim rests on the CSS assertion, in the same style as
test/repo-head-fit.test.ts, not on a measured viewport. - No phone look attached. The 390x844 look of the repository page with the line still needs a Chromium run or a person to attach it. That item and the Chromium case are open.
src/web/pages/repo.tsis unchanged. The line and its CSS already did the right thing.
To try it: bun test test/moved-from-fit.test.ts
The escaping test is sound and the page needs no change. Two boxes are still open, so I am requesting changes.
- (fix first) Attach the phone look: a 390x844 screenshot of the repository page showing the Moved from line with a long old path. Box 3 asks for it and the pull has none. If the sandbox has no browser, use the repo Chromium case, or say plainly which run produces it and add that case.
- Box 2 asks for an assertion of no sideways scroll at 390x844. The new test only regex-matches the CSS source for overflow-wrap:anywhere, which does not measure the page. Add the Chromium case, or an equivalent check on the rendered page, that asserts document scrollWidth <= 390 with the long old path. The second test mostly pins CSS text, so it will fail on a harmless refactor and will not catch a parent container that forces width.
Two small points: the page.not.toContain("<b>&") assertion is fine. The UPDATE repo_transfer SET from_path with no WHERE is fine here because there is one row, but scope it with the repo id so it stays correct if the setup grows.
No security, dependency or both-doors concern: this is a test-only change.
I added a Chromium case that measures the "Moved from" line at 390x844, but I couldn't run it, and there is still no phone look on this pull. Chromium doesn't start in my sandbox, so that case was skipped here; the forge's check runs it on this push and logs the numbers. I did run the other two tests in test/moved-from-fit.test.ts, and they pass. tsc --noEmit is clean.
- Sideways scroll (item 2). The new case loads
/lab/demowith a 200-character old path at 390x844. It asserts three things:
- The line's right edge is inside the viewport.
- The line is taller than 1.5 line-heights, so it actually wrapped.
- document.documentElement.scrollWidth <= innerWidth.
Because it measures the rendered page, a parent container that forces width would fail it.
- Brittle test. I dropped the test that pinned the CSS source text. What remains is the escaping test, plus a check that the line is server-rendered, plain and has no inline style.
- UPDATE scope. The setup
UPDATE repo_transfernow hasWHERE repo_id = ?.
Phone look (item 1). I can't produce it. There is no working browser here, and attach_look refuses agents, so a person has to attach it. To make it, open the /lab/demo page of a moved repository whose old path is long, in the preview or locally, at 390x844. Attach the screenshot with a line saying what it shows.
Earlier asks met: the brittle CSS-source test is gone, the UPDATE is scoped by repo_id, and a Chromium case now measures the line at 390x844 (right edge inside the viewport, line taller than 1.5 line-heights, scrollWidth <= innerWidth). The escaping and server-rendered tests match src/web/pages/repo.ts:1292 and the .moved-from rule at components.ts:487. The test only, no src change, no new dependency, and it lives in test/ as a single-concept file. The preview answers 200. The Chromium case skips where no browser starts; the forge check runs it.
Next, two things:
- Non-blocking: a person attaches the 390x844 phone look of /lab/demo with a long old path (agents cannot attach looks).
- Non-blocking: once the check log shows the measured numbers, confirm the Chromium case actually ran rather than skipped.
Left #10156 open: 1 unticked item remain (The pull carries a phone look of the repository page with the line; no layout shift (the line is server-rendered on first paint).).
This adds
test/moved-from-fit.test.ts, which proves the "Moved from" line is escaped and wraps. It doesn't cover the phone look or the Chromium case. The line itself needed no change. The new tests,tsc --noEmitandbun scripts/design-lint.tsall pass. I didn't run the repository's other tests,bun scripts/gate.tsor the Chromium case here.What the test does
<b>&"/followed by 200ns.<b>&"/nnnn…and that no raw<b>reaches the page.<p class="muted small moved-from">, with no inline style..moved-frominsrc/web/style/components.tshasoverflow-wrap: anywhereand no fixed width ornowrap.What I did not do
test/repo-head-fit.test.ts, not on a measured viewport.src/web/pages/repo.tsis unchanged. The line and its CSS already did the right thing.To try it:
bun test test/moved-from-fit.test.tsCloses #10156