CodeNomad/packages
Pascal André 87639f0275
Some checks failed
Publish help / build (push) Has been cancelled
Publish help / deploy (push) Has been cancelled
fix(transcript): reveal display-truncated text in place instead of a copy-only suffix (#1000)
## Summary
#890 replaced the copy-only footer for **omitted message parts**. A
second display bound from #648 remained: every rendered text block was
cut at 10,000 characters with "[Output truncated for rendering; copy to
access the full output]". Long subagent reports, assistant prose and
tool outputs could only be read by copying, even though the model
received everything.

**Now:** a truncated block shows its prefix, then at the exact cut a
localized line, "N more characters hidden to keep this message
responsive", with **Show all**. Above a ¼ MB remainder the button reads
**Show 250,000 more**. It reveals the rest in place.
- **Reveal state** sits next to #890's part reveals
(`record-display-cache`), keyed by instance/message/part/section. It
survives virtualization and session switches and resets with the
instance.
- **Reading position** is held while the text grows. Tool outputs grow
inside their own pane, and focus moves to the revealed text.
- **Copy, search and speech** keep reading native content.

## Bounds (from measured Chromium render cost)
| Content | Shown before reveal |
|---|---|
| Prose: text parts, compaction summaries, subagent prompts/reports,
skills | 50,000 chars (was 10,000) |
| Tool output: shell, read, write, diffs, edit/patch, execute, webfetch,
inputs, errors | 10,000 chars (unchanged) |
| Each reveal step | up to 250,000 chars |
| Syntax highlighting | off above 100,000 chars |

## Implementation
- **Where bounding happens:** it moved from each renderer into the
rendering components: `renderMarkdown` (with a `codeLanguage` option),
`renderDiff` and a new `BoundedText`. They use a pure window helper
(`lib/render-text-window.ts`) that cuts on nearby line breaks and never
splits a surrogate pair.
- **New pieces:**
  - `components/hidden-text.tsx`;
  - shared `reveal-focus.ts` (also used by #890's reveal);
- `transcript-alignment.ts`, which holds the reveal point through the
list's existing `alignElement`.
- **Removed:** the dead `renderAnsi` path and the copy-only Markdown
source button (with its now-unused i18n key).
- **Docs:** `dev-docs/TEXT_DISPLAY_BOUNDS.md`; `AGENTS.md` extends the
hidden-parts bullet.

## Validation
- Unit tests:
  - `render-text-window`;
  - `record-display-cache` / instance store.
- New `reveal-truncated-text` browser suite:
  - reveal in place;
  - anchor held while following the bottom;
  - tool pane reveal;
  - persistence across scrolling and session switches.
- Updated suites: `full-source-copy`, `markdown-latest-request`,
`mission-primitives`, `render-cost`.
- 31 relevant browser files, run one at a time: 459 pass, 1 opt-in skip.
UI typecheck clean.
- Known follow-up: reasoning text keeps its own silent 10,000-character
cut.

Oversized files touched: `message-block.tsx` (~1,963 lines),
`tool-call.tsx` (~998), `message-item.tsx` (~828),
`tool-call/renderers/task.tsx` (~581).

An independent gatekeeper review will be published before the admin
merge.
2026-10-18 05:01:03 +02:00
..
cloudflare chore(release): prepare stable 0.20.1 (#842) 2026-10-03 15:47:14 +02:00
electron-app feat(stats): display service-wide activity statistics (#968) 2026-10-15 15:04:58 +02:00
remote-tunnel fix(remote-control): keep a connected tunnel open past the start deadline (#931) 2026-10-13 02:12:22 +02:00
server fix(usage): explain the ChatGPT token-sharing quota limitation (#999) 2026-10-18 04:27:19 +02:00
tauri-app fix(tauri): prevent Windows event-loop refcount corruption (#996) 2026-10-18 02:07:17 +02:00
ui fix(transcript): reveal display-truncated text in place instead of a copy-only suffix (#1000) 2026-10-18 05:01:03 +02:00