# Transcript cards guide
Typed display cards, bounded visual windows and source-text copy mapping.
## Where to look
| Facade/display limits | `../transcript_cards.rs` |
| Types/transcript/activity conversion | `projection.rs` |
| Cached spans/child grouping/tool adapters | `projection/`, `projection/tool_adapters/` |
| Code Mode evidence/live progress | `projection/code_mode.rs` |
| Wrapped lines/history windows/bodies | `visual_lines.rs`, `visual_lines/{scrollback,card,body}.rs` |
| Text/width/streaming cursors | `visual_lines/{user_prompt,assistant,subagent,width,streaming}.rs` |
| Display-to-source copy positions/ranges | `copy_mapping.rs`, `visual_lines/{types,copy_ranges}.rs` |
| Selection-aware orchestration | `../transcript_projection.rs` |
## Local contracts
- Card types belong in `projection.rs`; facade reexports shared surface and children stay private. Preserve source/activity IDs for navigation/cache identity, not session records.
- Wrapping respects grapheme boundaries and terminal columns; copy mapping agrees even in narrow panes. Window visible history and reuse projections rather than rebuilding all cards/frame.
- Multiline streaming uses bounded sparse cursors; unbroken text keeps full formatting. Sanitize complete source and compare completed prefixes exactly before reusing checkpoints. Measure non-ASCII generated rows with Ratatui; grapheme width alone undercounts. Copy/navigation share measured heights.
- Reuse rendering roles/tool adapters. Visible/copied text is sanitized/redacted; copy cannot expose hidden metadata/control sequences. Projection never mutates source rows; final events rebuild content after dropped previews.
- Main images reserve fixed non-copyable rows after text. Clipping preserves source row indices and never resizes remaining fragment when top scrolls away; activity/child viewers stay text-only.
- Code Mode final counts come from host-owned evidence, live progress from child activities. Script success differs from inner failures. Model-response token estimate comes from display metadata, not compact-card estimation/nested result sums.
- Keep selection orchestration outside primitives and runtime/provider/storage decisions outside cards.