Skip to content

tui: playbook collaborator label paints over the document line above the caret #1093

Description

@edwin-zvs

A collaborator's label is drawn one row above their caret, at the caret's column, straight over whatever is already rendered there:

let rect = Rect::new(pos.x.saturating_add(1), pos.y - 1, label_w, 1);
f.render_widget(Paragraph::new(label).style(label_style), rect);

(crates/cli/src/ui.rs ~lines 16962–16968 @ ad47152)

There is no check for occupied cells — unlike the neighbouring agent-reveal tint, which is explicitly written to leave already-styled cells alone.

Repro

  1. Open the same session's Playbook in the TUI and the web UI.
  2. In the web UI, put the caret in the middle of a line that has a non-empty line above it.

Document text (TUI, 180 cols):

  • build the thing ZZZ
  • verify it!

Rendered while the web caret sits on verify it!:

  • build tWeb 1ing ZZZ
  • verify it!

Web 1 has replaced he th. The user's own document appears corrupted; there is no way to tell the badge from real text in a screenshot or a copied capture.

The web UI does this correctly — the peer's TUI 1 flag floats above the line without displacing characters.

Expected

The label should not destroy document glyphs. Options:

  • render it in the right margin / gutter of the caret's row,
  • render it only when the target cells are blank, falling back to a caret-colour tint plus a hover/status affordance,
  • reserve a one-row gap the way the web UI's floating flag does.

Acceptance criteria

  • A collaborator label never overwrites document text in the Playbook body.
  • The collaborator is still identifiable (label, or colour + another affordance) when the row above is occupied.
  • Test covering a peer caret on a line whose predecessor is non-blank.

Found during a hands-on UX audit of the Playbook in the TUI and web UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions