Skip to content

feat(dashboard): add NAME column with CJK-aware padding#15

Open
MuLinForest wants to merge 3 commits into
kayhaowu:mainfrom
MuLinForest:feat/dashboard-name-column
Open

feat(dashboard): add NAME column with CJK-aware padding#15
MuLinForest wants to merge 3 commits into
kayhaowu:mainfrom
MuLinForest:feat/dashboard-name-column

Conversation

@MuLinForest
Copy link
Copy Markdown

Summary

Add a NAME column to the dashboard showing the session slug (e.g. atomic-leaping-moth), with correct handling of CJK wide characters.

Changes

  • pad_wide() helper — CJK-aware column padding using byte/char count difference; each CJK character occupies 2 display columns, so wc -c (bytes) vs wc -m (chars) detects multi-byte characters and calculates the correct padding
  • NAME column (22 chars) — displays the conversation slug per session
  • NAME lookup priority:
    1. session_title field from session JSON (written by statusline when it reads customTitle from the JSONL — no extra I/O per render cycle)
    2. Epoch-mtime JSONL match — finds the JSONL whose mtime is closest to the session epoch, correctly identifying the session even when multiple sessions share the same project directory
  • Column width adjustments to accommodate NAME: PROJECT 18→14, MODEL 14→12, STATUS 9→8, bar 24→22, OUTPUT 8→7; fix CTX% format %-5s→%-6s to match header

Test plan

  • Start one or more Claude Code sessions, verify NAME column shows the session slug
  • Rename a session (/rename), verify NAME updates on next dashboard refresh
  • Test with CJK project names or slugs, verify columns stay aligned
  • Verify fallback works when session_title is absent from JSON (epoch-mtime JSONL match)

🤖 Generated with Claude Code

MuLinForest and others added 3 commits March 25, 2026 22:00
- Add session NAME column showing the conversation slug (e.g. atomic-leaping-moth)
- Add pad_wide() helper for CJK/wide character column alignment:
  calculates display width from byte/char count difference so CJK
  characters (each 2 display columns) align correctly
- NAME lookup priority:
  1. session_title field from session JSON (written by statusline when
     it reads customTitle from the JSONL; no extra I/O per render)
  2. Epoch-mtime JSONL match: find the JSONL whose mtime is closest
     to the session epoch to correctly identify the session even when
     multiple sessions share the same project directory
- Adjust column widths to accommodate NAME (22 chars): trim PROJECT
  from 18→14, MODEL from 14→12, STATUS from 9→8, bar from 24→22,
  OUTPUT from 8→7; fix CTX% format from %-5s to %-6s to match header

Co-Authored-By: Claude Code <claude-core@mulin.date>
session_title from JSON is often null since statusline-command.sh does
not write it. When falling back to JSONL lookup, check for a
custom-title entry first (written by /rename) before using the
auto-generated slug, so user-set names are shown when available.

Co-authored-by: Claude Sonnet 4.6 <claude-code@mulin.date>
The separator string used N-2 dashes + 2 spaces per column instead of
N dashes + 1 space, causing a 1-char misalignment per column vs the
%-Ns format specifiers in the header printf.

Co-authored-by: Claude Sonnet 4.6 <claude-code@mulin.date>
MuLinForest added a commit to MuLinForest/claude-code-toolkit that referenced this pull request Mar 26, 2026
…session_title in single jq call

Resolve dashboard.sh conflict: add session_title to PR kayhaowu#17's consolidated
jq read, removing the redundant individual jq calls from PR kayhaowu#15.

Co-Authored-By: Claude Sonnet 4.6 <claude-code@mulin.date>
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