feat(dev): show the source branch on dev windows - #52
Merged
Conversation
Code Coverage OverviewLanguages: TypeScript TypeScript / code-coverage/unitThe overall coverage in commit 5906512 in the TypeScript / code-coverage/componentThe overall coverage in commit 5906512 in the Show a code coverage summary of the most impacted files.
Updated |
Parallel `npm run dev` instances from different worktrees are indistinguishable. Dev builds now resolve the checkout's branch (worktree-aware .git pointer + HEAD parse, IO-free in dev-window.ts), brand the window title "Cockpit — <branch>", and pass the branch to the renderer as a ?devBranch= query param on the dev-server URL — no IPC surface for a dev-only affordance. The sidebar shows it as a branch-blue mono chip next to the zoom chip, namespace prefix receded, full name in the tooltip. Packaged apps never carry the param.
The chip was easy to miss in a busy tree-top. The branch now renders as a 28px branch-tinted banner row spanning the window top — impossible to confuse two worktree windows. The banner doubles as a drag region and absorbs the traffic-light clearance, so .tree-top sheds its 40px pad under it. Packaged apps never render it.
titan-ron
force-pushed
the
titan/local-dev-branch-indicator-f84abc
branch
from
August 12, 2026 21:39
9c3a57d to
5906512
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
Running
npm run devfrom several worktrees at once gives you identical Cockpit windows — there is no way to tell which window belongs to which branch.What
Dev builds now surface the source checkout's branch in two places:
no-drag) and absorbs the macOS traffic-light clearance, so.tree-topsheds its 40px pad underneath it.Cockpit — <branch>, so Mission Control / ⌘-Tab / the Dock disambiguate too (the renderer re-applies it becauseindex.html's<title>would otherwise reset it on load).How
.gitpointer file (gitdir: …) when present, then parseHEAD(ref: refs/heads/…, or an abbreviated hash when detached). The pure parsers live indev-window.ts— the module is deliberately IO-free and unit-tested; the IO glue stays inindex.ts.?devBranch=query param appended to the dev-server URL — no IPC surface growth for a dev-only affordance. Packaged apps never read the repo, never set the param, and keep the plainCockpittitle..appgrid: the row spans both columns viagrid-column: 1 / -1, activated with.app:has(.dev-banner)so the packaged layout is untouched.design-system/cockpit/MASTER.mdandpages/sidebar.mddocument the new element.Validation
npm run typecheckclean;npm test198/198 (unit tests for the two parsers, component tests for banner presence/absence).