-
Notifications
You must be signed in to change notification settings - Fork 2
dev-dashboard: async tmux core (sub-20ms endpoints), unified tmux/ttyd naming, tools update marketplace fix #307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
genesiscz
wants to merge
6
commits into
master
Choose a base branch
from
feat/fixes-2026-08-03
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7cc78dd
feat(dev-dashboard): one tmux/ttyd identity: Claude /rename pane-titl…
genesiscz b81c056
fix(update): keep the directory marketplace (add only when missing), …
genesiscz e6445dc
perf(tmux,dev-dashboard): async tmux core with batched round-trips, u…
genesiscz 74e7b08
fix(dev-dashboard): sanitize dots in Claude pane titles (tmux target …
genesiscz c2035c8
feat(dev-dashboard): surface tmux active-pane command/cwd/title/activ…
genesiscz 7c3c7f0
fix(dev-dashboard): separate session name from Claude title, stop the…
genesiscz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import { describe, expect, test } from "bun:test"; | ||
| import { isClaudeForegroundCommand, parseClaudePaneTitle } from "@app/dev-dashboard/lib/tmux/claude-pane-title"; | ||
|
|
||
| describe("parseClaudePaneTitle", () => { | ||
| test("strips working and idle markers", () => { | ||
| expect(parseClaudePaneTitle("✳ testt")).toBe("testt"); | ||
| expect(parseClaudePaneTitle("⠐ templates-todo")).toBe("templates-todo"); | ||
| expect(parseClaudePaneTitle("* testt")).toBe("testt"); | ||
| }); | ||
|
|
||
| test("accepts every animated braille spinner frame, not just U+2810", () => { | ||
| // Observed live: a running session's title read `⠂ ttyd-naming` (U+2802) and parsed as null, | ||
| // so the sync silently succeeded or failed depending on poll timing. | ||
| for (const marker of ["⠂", "⠈", "⠠", "⣾", "⠋", "⠿", "⠀"]) { | ||
| expect(parseClaudePaneTitle(`${marker} ttyd-naming`)).toBe("ttyd-naming"); | ||
| } | ||
| }); | ||
|
|
||
| test("keeps multi-word titles and sanitizes colons", () => { | ||
| expect(parseClaudePaneTitle("✳ Debug formatting: spacing")).toBe("Debug formatting- spacing"); | ||
| }); | ||
|
|
||
| test("sanitizes dots — tmux target-syntax separators that 3.6a silently munges to _ on rename", () => { | ||
| expect(parseClaudePaneTitle("✳ Fix v1.2 bug")).toBe("Fix v1-2 bug"); | ||
| // Unicode ellipsis is NOT a dot — Claude's truncated auto-topic titles keep it. | ||
| expect(parseClaudePaneTitle("✳ Analyze slow HAR file load…")).toBe("Analyze slow HAR file load…"); | ||
| }); | ||
|
|
||
| test("rejects non-Claude titles and the stock default", () => { | ||
| expect(parseClaudePaneTitle("zsh")).toBeNull(); | ||
| expect(parseClaudePaneTitle("/Users/me/proj")).toBeNull(); | ||
| expect(parseClaudePaneTitle("…/Projects/Foo")).toBeNull(); | ||
| expect(parseClaudePaneTitle("")).toBeNull(); | ||
| expect(parseClaudePaneTitle(undefined)).toBeNull(); | ||
| expect(parseClaudePaneTitle("✳ Claude Code")).toBeNull(); | ||
| expect(parseClaudePaneTitle("⠐ Claude Code")).toBeNull(); | ||
| }); | ||
| }); | ||
|
|
||
| describe("isClaudeForegroundCommand", () => { | ||
| test("matches claude binaries only", () => { | ||
| expect(isClaudeForegroundCommand("claude")).toBe(true); | ||
| expect(isClaudeForegroundCommand("/opt/homebrew/bin/claude")).toBe(true); | ||
| expect(isClaudeForegroundCommand("claude-code")).toBe(true); | ||
| expect(isClaudeForegroundCommand("bash")).toBe(false); | ||
| expect(isClaudeForegroundCommand("cursor")).toBe(false); | ||
| expect(isClaudeForegroundCommand(undefined)).toBe(false); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| /** | ||
| * Claude Code sets the tmux pane title via OSC to `<marker> <name>`. Strip the marker so we can | ||
| * mirror the name onto the tmux session + ttyd tab. | ||
| * | ||
| * The marker is `✳` while working, and otherwise an ANIMATED BRAILLE SPINNER FRAME — not a single | ||
| * fixed glyph. Matching only `⠐` (U+2810) made the sync succeed or fail depending on which frame | ||
| * happened to be current at poll time: a live session observed here read `⠂ ttyd-naming` (U+2802) | ||
| * and parsed as null. Accept the whole Braille Patterns block (U+2800–U+28FF). | ||
| * | ||
| * @see src/cmux/docs/Cmux.md — same title convention on cmux surfaces. | ||
| */ | ||
| const CLAUDE_PANE_TITLE_RE = /^[✳*⠀-⣿]\s*(.+)$/u; | ||
|
|
||
| /** Stock title before the user runs `/rename` — never promote this to a session name. */ | ||
| const CLAUDE_DEFAULT_TITLES = new Set(["claude code", "claude"]); | ||
|
|
||
| export function parseClaudePaneTitle(title: string | undefined | null): string | null { | ||
| if (!title) { | ||
| return null; | ||
| } | ||
|
|
||
| const trimmed = title.trim(); | ||
|
|
||
| if (!trimmed) { | ||
| return null; | ||
| } | ||
|
|
||
| const match = trimmed.match(CLAUDE_PANE_TITLE_RE); | ||
|
|
||
| if (!match?.[1]) { | ||
| return null; | ||
| } | ||
|
|
||
| // tmux session names cannot contain `:` or `.` — both are target-syntax separators. | ||
| // tmux 3.6a even silently munges a renamed session's dots to `_`, which would desync | ||
| // the stored binding name from the real session. Collapse whitespace; keep the rest. | ||
| const name = match[1].replace(/[:.]/g, "-").replace(/\s+/g, " ").trim(); | ||
|
|
||
| if (!name || CLAUDE_DEFAULT_TITLES.has(name.toLowerCase())) { | ||
| return null; | ||
| } | ||
|
|
||
| return name; | ||
| } | ||
|
|
||
| export function isClaudeForegroundCommand(command: string | undefined): boolean { | ||
| if (!command) { | ||
| return false; | ||
| } | ||
|
|
||
| const base = command.trim().split("/").pop()?.toLowerCase() ?? ""; | ||
| return base === "claude" || base === "claude-code"; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { describe, expect, test } from "bun:test"; | ||
| import { makeCmuxTmuxSessionName, makeTtydTmuxSessionName } from "@app/dev-dashboard/lib/tmux/naming"; | ||
|
|
||
| describe("tmux session naming", () => { | ||
| test("ttyd defaults to dd-<8hex>", () => { | ||
| expect(makeTtydTmuxSessionName("58bcf039-aaaa-bbbb-cccc-dddddddddddd")).toBe("dd-58bcf039"); | ||
| }); | ||
|
|
||
| test("cmux defaults to dd-cmux-<8hex>", () => { | ||
| expect(makeCmuxTmuxSessionName()).toMatch(/^dd-cmux-[0-9a-f]{8}$/); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,21 @@ | ||
| import { retargetTtydTmuxBindings } from "@app/dev-dashboard/lib/ttyd/manager"; | ||
| import { retargetTtydTmuxBindings, syncTtydDisplayNamesForTmux } from "@app/dev-dashboard/lib/ttyd/manager"; | ||
| import { renameTmuxSession } from "@genesiscz/utils/tmux/sessions"; | ||
|
|
||
| /** | ||
| * Rename a live tmux session and keep every dashboard surface in sync: | ||
| * relaunch bound ttyd processes so `attach-session -t` tracks the new name, and | ||
| * mirror the name onto ttyd display labels so tabs match Session Hub. | ||
| */ | ||
| export async function renameTmuxSessionInHub(fromName: string, toName: string): Promise<string> { | ||
| const trimmed = toName.trim(); | ||
|
|
||
| if (!trimmed) { | ||
| throw new Error("Destination tmux session name cannot be empty."); | ||
| } | ||
|
|
||
| renameTmuxSession(fromName, trimmed); | ||
| await renameTmuxSession(fromName, trimmed); | ||
| await retargetTtydTmuxBindings(fromName, trimmed); | ||
| await syncTtydDisplayNamesForTmux(trimmed, trimmed); | ||
|
|
||
| return trimmed; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,14 @@ | ||
| import type { TtydSession } from "./types"; | ||
| import { deriveTtydDisplayName, type TtydNameSource } from "@app/dev-dashboard/lib/ttyd/naming"; | ||
|
|
||
| /** | ||
| * Display label for a ttyd session. Pure — lives in its own module (not | ||
| * `manager.ts`) so the browser can import it without dragging the server-only | ||
| * manager (node:child_process, config → auth → node:crypto) into the client | ||
| * bundle. | ||
| * | ||
| * Delegates to {@link deriveTtydDisplayName} so tab chrome and Session Hub share | ||
| * the same identity (tmux session name), not `zsh :port`. | ||
| */ | ||
| export function ttydLabel(session: TtydSession): string { | ||
| const name = session.name?.trim(); | ||
| if (name) { | ||
| return name; | ||
| } | ||
|
|
||
| return `${session.command.split("/").pop()} :${session.port}`; | ||
| export function ttydLabel(session: TtydNameSource): string { | ||
| return deriveTtydDisplayName(session); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win
Define one named ttyd tab contract.
ttydTabsis declared separately in the contract, server, and UI API modules. These declarations can drift without a TypeScript error.Export a named
TtydHubTabDTO here. Import it insrc/dev-dashboard/lib/tmux/hub.tsandsrc/dev-dashboard/ui/src/lib/api.ts.🤖 Prompt for AI Agents