Skip to content

Web terminal: orphaned dotted-underline file-path decorations litter the screen after TUI repaints #1217

Open

Description

@amrmelsayed

Symptom

The web dashboard terminal shows faint dotted-underline fragments floating over blank areas and unrelated text (screenshot from a Claude Code session, 2026-07-22, mid-screen band). Web-only — the VS Code extension uses the native Pseudoterminal and has no decoration layer.

Root cause (confirmed in source)

The clickable-file-path feature (Spec 0101): FilePathDecorationManager in apps/web/src/lib/filePathLinkProvider.ts scans terminal lines on onWriteParsed and registers persistent xterm.js decorations — DOM overlays anchored to buffer-line markers at fixed column/width — styled as the dotted underline (.file-path-decoration, apps/web/src/index.css:319: border-bottom: 1px dotted rgba(255,255,255,0.3)).

Two defects:

  1. Decorations are never invalidated when line content changes. The design assumes decorated lines stay put (true for a scrolling log). Claude Code is a full-screen TUI that redraws in place — cursor-up + rewrite, constantly. When the line that contained a path is erased/overwritten, the marker and overlay survive (xterm markers only die when the line scrolls off scrollback or on dispose()). The dotted underline stays pinned at coordinates where a path used to be — now over blank space or unrelated text. That's the screenshot.
  2. Unbounded duplicate accumulation. scanNewLines() tracks progress by cursor position (lastScannedLine = buffer.baseY + buffer.cursorY). A TUI bounces the cursor, so the same lines get rescanned and re-decorated repeatedly; entries[] and disposables[] grow for the life of the terminal with no pruning of stale/duplicate entries. Long sessions accumulate DOM overlays without bound (possible contributor to renderer memory pressure; not confirmed).

Why it's suddenly prominent

The feature is old, but #1198 (PR #1204, merged 2026-07-21) amplified it: reconnect/adoption now seeds up to 1MB of replay history (dense with file paths — all scanned and decorated in one burst), then the resize nudge triggers a full TUI repaint that shifts everything, orphaning the entire batch at once. Every Tower restart or web reload now mass-produces the artifacts.

Fix shape

  • Invalidate decorations whose line content changed — cheapest robust version: on repaint-heavy signals (replay seed, resize, clear), dispose all entries and rescan the viewport; incremental version: re-verify entry.marker.line's text still matches the decorated path before keeping it.
  • Prune entries[] when markers auto-dispose (marker onDispose hook) and dedupe per (line, x) so rescans replace rather than stack.
  • Keep the link-provider behavior (hover/click) unchanged — this is purely decoration lifecycle.

Contained to filePathLinkProvider.ts + tests; BUGFIX/AIR-scoped.

Origin

User report (screenshot) 2026-07-22, root-caused same day by main architect. Related: Spec 0101 (feature origin), #1198/PR #1204 (amplifier), #1215 (sibling fallout from the same replay/repaint changes).

Activity

  1. added
    area/dashboard
    on Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/dashboard

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions