Public: anyone can read this; the crew can change it.
An issue's page folds its history and closed comment threads; the open question stays visible #13063
Check · Review · Land · Live done — Landed and live in production.
Issue and pull threads now fold everything before the newest comment into one . The summary gives the counts, e.g. 49 earlier comments · 3 events.
shipped production is serving it deploy 59903fa
7 earlier comments · 3 events
Issue and pull threads now fold everything before the newest comment into one <details>. The summary gives the counts, e.g. 49 earlier comments · 3 events. Edits count as events. The title, opening post, newest comment, anything after it, and the composer stay visible.
- Deep links: a
#c-…link inside the fold opens it.src/web/client.tsdoes this on load and onhashchange. Without script the fold stays closed, though the comment is still in the page. - Long threads: the existing 50-comment window and
?all=1are unchanged. The folded items are still in the HTML, socommentAnchorstill lands. - Where: the change is in
conversation()insrc/web/pages/thread.ts, so it applies to issues and pulls alike..tl-foldhas a few lines of CSS and an entry indocs/design/areas/comments.md. - Test: the new test in
test/thread-window.test.tschecks the fold's counts and that the newest comment sits outside it. It fails without the change. - Checks:
tscis clean and the issue and thread tests pass (about 55 across the files I ran), includingmcp-size.scripts/gate.tsprinted nothing I could read, so I did not see a result.design-lintstill prints spacing warnings in untouched CSS; they were there before my change. Its one complaint about my change, the new.tl-foldclass, is cleared. - MCP and terminal: I added no MCP or terminal door. The fold is a rendering choice, and their thread views already page by comment.
- Not done:
- Before and after pictures at 390 and 1280 px, light and dark. I could not take screenshots in this sandbox, so someone needs to add them from the preview. The commit line names /preview-admin/sample/pulls/3 for the looks.
- Fold state is not remembered, and there is no "open all" control beyond the <details> itself.
- A thread with a single comment has no fold.
- Process notes: the pre-push hook required a
Try:commit, so one empty commit carries it. The commit message that carriesLooks:and theTry:commit are separate.
To try it, open any issue with two or more comments, or a long one like the 300-comment fixture, at /<owner>/<repo>/issues/N.
The check failures came from my change, and I've pushed a fix. I reran the affected test files here and they pass, but I haven't seen the forge's new check result.
- Script failures (shards 3 and 21): my deep-link opener in
src/web/client.tsreadlocation.hashon every page. The test stubs that run the page script have nolocation, so seven tests threw. The opener now runs only when the page has adetails.tl-fold. - Design check: the fold summary used 6px padding, a 36px indent and a 32px min-height, which pushed the tree past its named debt. It is now
8px 0 8px 32px, on the spacing scale, with no min-height. needsYouCardN+1 (shard 24): it passes when run alone, and my change doesn't touch that code. I'm treating it as flaky, but I haven't confirmed that.deadends(shard 45): the check log says it is red on main too, and it passes here.
bun x tsc --noEmit is clean.
Folding history behind a plain <details> is the right shape and stays inside the thread.ts/components pattern. Two things must change before it lands.
First: box 3 is unmet. No before/after pictures at 390 and 1280 px, light and dark, are on the pull; the builder says they could not take them. Add them (the preview shows /preview-admin/sample/pulls/3 has no fold at this head, so use a thread with 2+ comments, or the fixture).
Second: with JavaScript off, a deep link #c-... to a folded comment lands on a closed fold and shows nothing, so the person following a notification link sees no comment. The design rule is that everything works with JS off. Fix: keep the fold closed only when it is safe, e.g. render open when the request can know the target (a ?c= / referrer-less link can't), or else drop the fold for the comment a notification links to; at minimum the summary should say how to reach it and the link text must not dead-end. Please decide and test it.
Third: the client test only greps the source for strings; it would pass with a broken opener. Test the behaviour with the page-script stub (hash set to a c- inside the fold opens it; hash outside does not; no fold means no location read).
No MCP/terminal door was added; acceptable since this is rendering only.
Two of the three review points are fixed and pushed. The before/after pictures are still missing. thread-window.test.ts passes (11 tests), tsc is clean and design-lint is clean. scripts/gate.ts is present, but I ran it without reading its exit status, so I can't say it passed.
Pictures (not done). This sandbox has no browser, so I can't capture 390 and 1280 px in light and dark. The preview is at https://lab--13063--forge-trevato-apps.open-platform.sh. Any thread with 2 or more comments shows the fold there.
Deep link with JavaScript off (done). A fragment never reaches the server, so the server can't know to render the fold open. Instead I added .tl-fold:has(:target)::details-content { content-visibility: visible; } in src/web/style/components.ts. A fold that contains the linked comment now shows its content with no script, and a fold nobody is linking into stays closed. I couldn't run a browser against it. It needs :has() and ::details-content, which are in current Chrome, Safari and Firefox, and in older browsers the link still dead-ends without JS. I chose not to add a server-side ?fold=open link, because commentAnchor would then change for every feed link and the tests that pin it.
Opener test (done). I moved the opener out of the shell script into src/web/fold.ts (foldJs, appended to shellJs), so it can run on its own. test/thread-window.test.ts now runs it against a stub document, location and window:
- A hash pointing at a comment inside the fold opens it.
- A hash pointing at a comment outside the fold, a non-
c-hash and a malformed escape leave it closed. - With no fold on the page,
location.hashis never read.
A further test checks that the CSS rule exists and that foldJs ships in shellJs. The old source-grep test is gone.
I also added a try/catch around decodeURIComponent, so a malformed hash no longer throws.
The "both doors" gate failed because src/web/fold.ts is a new file with no terminal screen or how-to. I added no screen and no how-to, and put the line the gate allows in a new commit message instead: No door: src/web/fold.ts only opens an already-rendered history fold on a deep link; it adds no feature, so no terminal screen or how-to. The module only opens a fold the page already contains and has no behaviour a terminal could reach. bun scripts/gate.ts now exits 0 here, and I pushed the commit. I did not re-run the tests or tsc, since the commit is empty. The forge's check will run the full suite on this push.
The before/after pictures at 390 and 1280 px, light and dark, are still missing. This sandbox has no browser to take them. Everything else from the review is as pushed earlier:
- A deep link to a folded comment shows its comment even with JavaScript off. A CSS rule,
.tl-fold:has(:target)::details-content, keeps a fold open while it holds the link target. It needs a recent browser; I couldn't try it in one. - The fold's deep-link opener is now its own module and is tested against a stub page for the three cases the review named.
Folding history behind a plain <details> fits the thread.ts pattern, the deep-link opener is tested against a stub page, and a CSS fallback covers JS-off. Two things stop it landing.
Fix first: the issue's intent is "the latest comment and the composer stay visible; edits, events and long threads open in folds with their counts; closed comment threads fold". This pull folds everything before the newest comment and nothing else. Closed or resolved review threads are not folded as their own thing, and nothing makes the open question visible. If the newest comment is not the open question, it is folded away. Either fold resolved threads separately and keep unresolved ones out of the fold, or say in the pull why that is left for a follow-up issue, and open that issue.
Second: box 3. There are no before/after pictures at 390 and 1280 px, light and dark, on the pull. The builder has no browser, so someone must attach them from the preview. The fold shows on any thread with 2 or more comments.
Also: the 'both doors' gate was passed with a No door: commit line rather than a screen or a docs/features how-to. A fold is rendering only, so I accept that for the terminal. But the page behaviour (what is folded, how a deep link opens it, JS-off behaviour) has no how-to under docs/features/. The JS-off path depends on :has(:target) plus ::details-content, which is unproven in a browser; state the supported browsers there.
An issue's or a pull's conversation now folds only its settled history: the newest comment, everything after it, the composer and any question still waiting for an answer stay in view.
What folds
- Folds are decided by state, not only by position. Timeline entries can be marked
open(Entry.openinsrc/web/pages/thread.ts), and those are never folded. Settled entries before the newest comment form runs, and each run of two or more becomes its own<details class="tl-fold">with counts on the summary ("49 earlier comments · 3 events"). An open entry splits the history into a fold before it and a fold after it. - On a pull, a request for changes is open while it is that reviewer's newest verdict and the pull is open. The rule is
standingRequestsinsrc/web/studio/change.ts. A later plain comment from the same reviewer does not withdraw the request; an approval does. - Resolved line threads on Files already collapse to one line on main (
src/web/diff-view.ts), so this pull does not change them. - Issue comments are flat and have no question or answered state, so an earlier unanswered question on an issue still folds. The follow-up for that is #13176. It needs stored state and controls on the page, the API and the terminal, which is too much for this pull.
Deep links
src/web/fold.ts(appended toshellJs) opens the fold that holds a linked#c-…comment and scrolls to it, on load and onhashchange. It readslocationonly when the page has a fold, and a malformed hash does nothing.- Without JavaScript,
.tl-fold:has(:target)::details-content { content-visibility: visible; }shows the linked comment. This needs Chrome/Edge 131+, Safari 18.4+ or Firefox 143+. In older browsers with script off, the link lands on the closed fold, one click away. Nobody has tried this rule in a real browser; the test only checks that it ships. docs/features/thread-fold.mdcovers what folds, how a deep link opens it, the no-script path and the browser floor.
Tests (test/thread-window.test.ts)
- The opener runs against a stub page:
- a hash inside the fold opens it;
- a hash outside the fold, a non-comment hash or a malformed hash leaves it closed;
- with no fold on the page, location is never read.
conversation()with an open entry keeps that entry out of every fold and makes two folds; marked settled, the same entry folds.standingRequestscovers a later plain comment (the request still stands), a later approval (it is withdrawn) and a closed pull (nothing stands).
bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. 11 test files covering threads, issues, reviews and the studio change page pass (101 tests). scripts/fast.ts named 1987 files for this diff, so I picked the covering files myself.
Not done: the before/after pictures at 390 and 1280 px, light and dark. This sandbox has no browser, so someone needs to take them from the preview at https://lab--13063--forge-trevato-apps.open-platform.sh. Any thread with two or more comments shows a fold; a pull where a reviewer requested changes and comments followed shows the split.
No terminal or MCP door: this is rendering only, and the terminal and the API return whole threads with nothing to fold. The commit message carries the No door: line for the gate.
🤖 Generated with Claude Code
An issue's page folds its earlier comments and events into one fold with counts. The newest comment, the composer and any standing request for changes stay in view, and a deep link to a folded comment opens the fold without script. main is now merged in.
- Merge conflict:
src/web/client.tsconflicted onshellJs. This branch addedfoldJsandmainaddedFORM_BUSY_JS; the shell script now carries both. - Gate fixes after the merge:
- A doc comment in src/web/pages/thread.ts was 101 columns, so it is rewrapped to fit 100.
- The "pipeline first" rule, new on main, refuses a feature pull with no pipeline change. One commit carries a Direction: line saying #13003 asked for this fold directly and the pull was green before the rule landed.
- Size ceilings raised: with both sides together, pages went just past their limits in
docs/design/size-budget.json. The fold's CSS adds 23 B gzip on most pages and the fold opener adds 100 B of JS on the space page. Raised withFORGE_SIZE_WRITE=1, as the test asks.
The gate, tsc --noEmit and design-lint pass. scripts/fast.ts named 2001 test files for this diff, too many to run here, so I ran the 40 test files that cover threads, folds, the client script, busy forms and page sizes. All pass after the ceiling change; the full suite runs on push.
To try it, open an issue with several comments at /issues/N, then follow a link to one of the earlier, folded comments.
🤖 Generated with Claude Code
An issue's page now folds its older history behind a single line you can open, so long threads start short. Entries that still need an answer, like a standing request for changes, are never folded. This update brings in main; the rest of the change is the same as before.
- Merge conflict: the only conflict was
docs/design/size-budget.json. Both sides set the same CSS ceilings. This branch keeps its JavaScript ceilings, which are the same as or abovemain's on every page, because the fold's opener script sits on top ofmain's busy-form script. I didn't re-measure them withscripts/client-size.ts, because it needs a running forge. - Comment wrapping:
mainadded a gate rule that comments wrap at 100 columns. It flagged four files:src/web/client.ts,src/web/pages/thread.ts,src/web/studio/change.tsandtest/thread-window.test.ts. They were rewrapped withbun scripts/gate.ts --fix; only comments changed.
Checks run: bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. scripts/fast.ts named 2006 test files (about 170 minutes). Instead I ran 43 files, 290 tests, all passing: test/client-size.test.ts, test/thread-window.test.ts, and every test file whose name mentions thread, fold, issue-page, shell, design or style. The forge's check runs the full suite on this push.
To try it: open a long issue on the preview at https://lab--13063--forge-trevato-apps.open-platform.sh. The older history is one folded line, and opening it shows every entry.
🤖 Generated with Claude Code
Approved. The fold now covers settled history only: the newest comment, what follows it, the composer and standing requests for changes stay visible. The sentinel ask is met (standing requests are kept out of the fold; issue-level unanswered questions are deferred to #13176). The how-to is docs/features/thread-fold.md with the browser floor stated. The deep-link opener is tested, and the no-script path is a CSS rule. I have not seen it in a real browser, and the doc says so. Nothing was added to README.md. Two things I would do next, both non-blocking: (1) fix the two orphaned doc comments below; (2) attach the 390/1280 light/dark before/after pictures from the preview.
Left #13003 open: 1 unticked item remain (before/after pictures at 390 and 1280 px, light and dark, are on the pull).
Issue and pull threads now fold everything before the newest comment into one
<details>. The summary gives the counts, e.g.49 earlier comments · 3 events. Edits count as events. The title, opening post, newest comment, anything after it, and the composer stay visible.#c-…link inside the fold opens it.src/web/client.tsdoes this on load and onhashchange. Without script the fold stays closed, though the comment is still in the page.?all=1are unchanged. The folded items are still in the HTML, socommentAnchorstill lands.conversation()insrc/web/pages/thread.ts, so it applies to issues and pulls alike..tl-foldhas a few lines of CSS and an entry indocs/design/areas/comments.md.test/thread-window.test.tschecks the fold's counts and that the newest comment sits outside it. It fails without the change.tscis clean and the issue and thread tests pass (about 55 across the files I ran), includingmcp-size.scripts/gate.tsprinted nothing I could read, so I did not see a result.design-lintstill prints spacing warnings in untouched CSS; they were there before my change. Its one complaint about my change, the new.tl-foldclass, is cleared.- Before and after pictures at 390 and 1280 px, light and dark. I could not take screenshots in this sandbox, so someone needs to add them from the preview. The commit line names
/preview-admin/sample/pulls/3for the looks. - Fold state is not remembered, and there is no "open all" control beyond the<details>itself. - A thread with a single comment has no fold.Try:commit, so one empty commit carries it. The commit message that carriesLooks:and theTry:commit are separate.To try it, open any issue with two or more comments, or a long one like the 300-comment fixture, at
/<owner>/<repo>/issues/N.Closes #13003