Skip to content

Make user turns visually distinct (heading + 👤 marker, opt-in color)#242

Open
huangruizhe wants to merge 2 commits into
specstoryai:devfrom
huangruizhe:feat/distinct-user-turns
Open

Make user turns visually distinct (heading + 👤 marker, opt-in color)#242
huangruizhe wants to merge 2 commits into
specstoryai:devfrom
huangruizhe:feat/distinct-user-turns

Conversation

@huangruizhe

Copy link
Copy Markdown
Contributor

Problem

In long transcripts it's hard to tell user turns from agent turns while scrolling — both render as the same italic-bold header. Yet user turns are the natural boundary between conversation rounds, so they're what you actually scan for.

Change

Render each user turn as a level-3 heading with a 👤 marker:

### 👤 User (2026-06-19 05:04:33Z)
  • It pops visually and populates the document outline, so readers (VS Code, Obsidian, etc.) can jump between rounds.
  • Agent turns stay quiet (italic-bold) with a 🤖 marker, so user turns remain the anchors:
    _**🤖 Agent (claude-... 2026-06-19 05:04:40Z)**_
    
  • All plain Markdown — renders cleanly in every reader (GitHub, VS Code, Quick Look).

Opt-in color (off by default)

Markdown has no color of its own, and inline CSS is unreliable — VS Code's preview renders <span style="color:…">, but GitHub and macOS Quick Look strip/leak it. So color is opt-in via config, default off:

[markdown]
user_turn_color = "#2563eb"   # any CSS color; tints the user heading in readers that support inline HTML

When unset (default) the output is plain Markdown. When set, the user heading is wrapped in an inline-color <span>. This keeps the default portable while letting people who live in an HTML-capable reader opt into color.

Notes for downstream consumers

This changes the user/agent header format (_**User**_### 👤 User, and _**Agent**__**🤖 Agent**_). Anything that parses these headers to segment turns should match the new form (or both). Flagging explicitly since the .md is also consumed by tooling/indexers.

Tests

  • New renderRoleHeader tests: user heading + 👤 marker, plain-by-default (no inline HTML), opt-in color span, agent stays quiet with 🤖.
  • go build ./..., go test ./..., golangci-lint run ./... all clean.

huangruizhe and others added 2 commits June 19, 2026 23:26
In long transcripts it's hard to tell user turns from agent turns while
scrolling, even though user turns are the natural boundary between conversation
rounds.

Render each user turn as a level-3 heading with a 👤 marker. This makes them pop
visually and populates the document outline, so readers can jump between rounds.
Agent turns stay quiet (italic-bold) with a 🤖 marker so user turns remain the
anchors. All plain Markdown — renders cleanly in every reader (GitHub, VS Code,
Quick Look).

Color is opt-in and off by default: set `[markdown] user_turn_color = "#2563eb"`
(any CSS color) in config.toml to tint the user heading via an inline <span> for
readers that render inline HTML (e.g. VS Code preview). Off by default because
readers that don't support inline CSS (GitHub, Quick Look) can show the raw tag
rather than hiding it — so it's never imposed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ng contract

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant