Skip to content

refactor: Automatic Safe-Name Conversion at Naming Entry Points#441

Merged
sahil-noon merged 2 commits into
mainfrom
260722-ln4n-auto-safe-name-conversion
Jul 22, 2026
Merged

refactor: Automatic Safe-Name Conversion at Naming Entry Points#441
sahil-noon merged 2 commits into
mainfrom
260722-ln4n-auto-safe-name-conversion

Conversation

@sahil-noon

Copy link
Copy Markdown
Collaborator

Meta

Change ID Type Confidence Plan Review
ln4n refactor 3.6/5.0 12/12 tasks, 17/17 acceptance ✓ ✓ 1 cycle
Impact +/− Net
raw +990 / −66 +924
true +556 / −55 +501
└ impl +236 / −52 +184
└ tests +320 / −3 +317

excludes fab/, docs/ · generated by fab-kit v2.16.5

Pipeline: intake ✓ → apply ✓ → review ✓ → hydrate ✓ → ship → review-pr

Summary

run-kit's name validation was inconsistent and leaky: ValidateName allowed spaces in session/window names (which then broke tmux CLI targeting, session-group naming, and URL routing), while server names were rejected outright on a typed space. This change adds automatic, live, per-name-kind safe-name conversion in the frontend (e.g. "My problem" → "My_problem" as you type) and tightens the backend so new-name validation rejects spaces as a real contract, while existing-name lookups stay permissive for names created outside run-kit.

Changes

  • Shared frontend name-transform module — app/frontend/src/lib/names.ts (new), promoting toTmuxSafeName() out of create-session-dialog.tsx into one canonical transform per name kind (toSafeSessionName, toSafeWindowName, toSafeServerName, toSafeWorktreeName)
  • Live in-input conversion at every naming entry point: create-session/window dialog, session rename dialog, sidebar inline renames, top-bar WindowHeading inline rename, server-name input, worktree-name field
  • Backend: ValidateName tightens for NEW names (rejects spaces); existing-name lookups stay on the permissive validator so pre-existing spacey names remain operable
  • Tests and companion docs: Vitest coverage for each transform, Go table tests for the tightened validator, Playwright e2e updates (window-heading.spec.ts + .spec.md, sync-latency.spec.ts + .spec.md)

@sahil-noon
sahil-noon marked this pull request as ready for review July 22, 2026 12:01
@sahil-noon
sahil-noon merged commit 821e929 into main Jul 22, 2026
6 checks passed
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.

2 participants