Repository navigation
feat(cli): add --title flag for a custom browser tab title - #464
Open
ariel-greenfeld wants to merge 1 commit into
Open
ariel-greenfeld wants to merge 1 commit into
ariel-greenfeld wants to merge 1 commit into
Conversation
Every difit instance renders the same hardcoded tab title, so with several review servers open the tabs are indistinguishable. Pass the title through the CLI -> server -> /api/diff response, and set document.title on the client when present. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
6 tasks done
This branch has not been deployed
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.
Motivation
When several difit instances are open at once (e.g. reviewing multiple branches across worktrees), every browser tab shows the same hardcoded title, so the tabs are indistinguishable. The port isn't a reliable identifier either, since difit silently auto-bumps to the next port when the preferred one is busy.
This adds an opt-in
--title <title>flag so each review session can name its own tab (e.g. a ticket id or branch name). Without the flag, behavior is unchanged.Implementation notes
src/cli/index.ts: new--title <title>option, passed tostartServer()in both the stdin/PR path and the Git revision path.src/server/server.ts:titleadded toServerOptionsand included in the/api/diffresponse.src/types/diff.ts: optionaltitlefield onDiffResponse.src/client/App.tsx: setsdocument.titlewhen the diff response carries a title; the static<title>stays the fallback.Manual verification
Tabs from three instances — no
--title(default),--title 'DEV-5678 hub review', and--title 'DEV-6687 workspace review'(active tab, showing this PR's own diff):Tests
/api/diffincludestitlewhen the option is set (src/server/server.test.ts).document.titleis set from the diff response (src/client/App.test.tsx).pnpm check,pnpm test, andpnpm buildpass locally.🤖 Generated with Claude Code