Skip to content

feat(source-control): branch switcher in the Source Control panel - #5416

Open
Devin345458 wants to merge 15 commits into
stablyai:mainfrom
Devin345458:Devin345458/git-branch-changing
Open

Devin345458 wants to merge 15 commits into
stablyai:mainfrom
Devin345458:Devin345458/git-branch-changing

Conversation

@Devin345458

@Devin345458 Devin345458 commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a PhpStorm-style branch picker to the right-sidebar Source Control panel that switches the active worktree's branch in place via git switch.

  • Switch in place — click the branch chip in the panel header to open a searchable picker (Local / Remote sections) and switch the current worktree's branch.
  • Smart checkout — if local changes would be overwritten, offers a stash → switch → re-apply flow; auto-restores your work if the switch fails, and on a pop conflict it warns and leaves the changes safely in git stash.
  • Create branch — create-and-switch from the picker; selecting a remote-only branch creates a tracking branch (git DWIM).
  • Worktree-aware — a branch checked out in another worktree is shown disabled with an "in «workspace»" hint, and clicking jumps to that workspace instead of attempting a switch git would reject.

Architecture

  • A single pure orchestrator (switchGitBranch) drives all three modes (plain / stash / create) through an injected exec function, so it's unit-testable and shared by both entry points — the local preload IPC handler and the runtime RPC — preventing the local and SSH paths from drifting.
  • Branch-name flag-injection is guarded on both entry points (IPC handler + Zod RPC schema).
  • Renderer reuses the existing SSH-aware ref search for the branch list, annotates candidates (current / local vs remote / checked-out-elsewhere) in a pure module, and renders a chip + popover backed by a thin useBranchSwitch orchestration hook.
  • Provider-agnostic (no GitHub-only assumptions) and works across local and SSH-backed worktrees; cross-platform.

Test plan

  • pnpm typecheck — clean
  • pnpm lint — clean (oxlint, switch-exhaustiveness, styled-scrollbars, localization catalog + coverage)
  • Automated tests: pure orchestrator (incl. SSH exec path and no-op-stash safety), candidate annotation, useBranchSwitch hook (dirty-conflict→stash recursion, pop-conflict toast, double-submit guard), and the BranchSwitcher component
  • Manual: clean local switch · remote→tracking switch · stash-on-conflict dialog · checked-out-elsewhere jump · create branch · SSH-backed switch

ELI5

Source Control gains a branch picker: click the branch chip, search local/remote branches, and switch the active worktree in place. If local changes would be overwritten, it can stash, switch, and re-apply.

Copilot AI review requested due to automatic review settings June 15, 2026 21:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds an in-app Git branch switcher (desktop + web runtime) with support for stashing local changes during checkout, plus shared typings and runtime/IPC plumbing.

Changes:

  • Introduces branch switching UX (BranchSwitcher component + hook) and candidate annotation for local/remote refs + worktree awareness.
  • Implements git switch orchestration (plain/stash/create) in main process with runtime RPC + preload IPC entry points.
  • Adds i18n strings and tests covering switching behavior, candidate annotation, and main/IPC routing.

Reviewed changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/shared/git-branch-switch.ts Adds shared types/results/options and a standardized stash label for branch switching.
src/renderer/src/web/web-preload-api.ts Exposes git.switchBranch for web runtime via runtime dispatch.
src/renderer/src/runtime/runtime-git-client.ts Adds switchRuntimeGitBranch to route branch switching via local IPC or runtime RPC.
src/renderer/src/i18n/locales/zh.json Adds branchSwitch i18n keys (currently English text).
src/renderer/src/i18n/locales/ko.json Adds branchSwitch i18n keys (currently English text).
src/renderer/src/i18n/locales/ja.json Adds branchSwitch i18n keys (currently English text).
src/renderer/src/i18n/locales/es.json Adds branchSwitch i18n keys (currently English text).
src/renderer/src/i18n/locales/en.json Adds English branchSwitch i18n keys.
src/renderer/src/components/right-sidebar/useBranchSwitch.ts Implements branch search + switch orchestration with confirm/toast flows and overlap guard.
src/renderer/src/components/right-sidebar/useBranchSwitch.test.ts Adds hook tests for dirty-conflict confirm flow, pop-conflict warning, failure surfacing, and overlap guard.
src/renderer/src/components/right-sidebar/branch-switch-candidates.ts Adds candidate annotation/deduping and “checked out elsewhere” detection.
src/renderer/src/components/right-sidebar/branch-switch-candidates.test.ts Tests candidate annotation rules and remote/local dedupe.
src/renderer/src/components/right-sidebar/SourceControl.tsx Integrates the BranchSwitcher into the SourceControl sidebar and triggers refreshes on switch.
src/renderer/src/components/right-sidebar/BranchSwitcher.tsx Adds BranchSwitcher UI (popover + searchable list + create branch flow).
src/renderer/src/components/right-sidebar/BranchSwitcher.test.tsx Adds basic UI tests for selection and “checked out elsewhere” hint rendering.
src/preload/index.ts Adds preload IPC method git.switchBranch returning SwitchBranchResult.
src/preload/api-types.ts Extends PreloadApi.git with switchBranch signature.
src/main/runtime/runtime-rpc.ts Allowlists git.switchBranch for mobile/runtime RPC.
src/main/runtime/rpc/methods/git.ts Adds runtime RPC method handler for git.switchBranch.
src/main/runtime/rpc/methods/git-params.ts Adds zod validation for git.switchBranch params.
src/main/runtime/orca-runtime.ts Exposes switchRuntimeGitBranch on runtime service.
src/main/runtime/orca-runtime-git.ts Adds runtime command implementation delegating to runSwitchBranch.
src/main/runtime/orca-runtime-git.test.ts Tests delegation of switchRuntimeGitBranch to runSwitchBranch.
src/main/ipc/filesystem.ts Adds git:switchBranch IPC handler with validation and local/SSH routing to runSwitchBranch.
src/main/ipc/filesystem.test.ts Tests IPC routing and validation for git:switchBranch.
src/main/git/switch-branch.ts Implements switch orchestration (plain/stash/create), error normalization, and local/SSH exec wiring.
src/main/git/switch-branch.test.ts Adds unit tests for orchestration, normalization, and local/SSH execution paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +54 to +57
if (!repoId) {
setRefs([])
return
}
Comment on lines +71 to +90
const stashed = await exec([
'stash',
'push',
'--include-untracked',
'-m',
SWITCH_BRANCH_STASH_LABEL
])
if (stashed.exitCode !== 0) {
return { ok: false, reason: 'failed', message: stashed.stderr.trim() }
}
const createdStash = !isNothingToStash(stashed)
const switched = await exec(['switch', options.branch])
if (switched.exitCode !== 0) {
// Why: only restore if we actually stashed — otherwise `pop` would apply an
// unrelated pre-existing stash and strand foreign changes here.
if (createdStash) {
await exec(['stash', 'pop'])
}
return { ok: false, reason: 'failed', message: switched.stderr.trim() }
}
Comment on lines +96 to +99
const popped = await exec(['stash', 'pop'])
if (popped.exitCode !== 0) {
return { ok: false, reason: 'stash_pop_conflict' }
}
Comment thread src/preload/api-types.ts
Comment on lines +2216 to +2221
switchBranch: (args: {
worktreePath: string
branch: string
mode: 'plain' | 'stash' | 'create'
connectionId?: string
}) => Promise<SwitchBranchResult>
Comment on lines +10915 to 10932
"branchSwitch": {
"search": "Search branches…",
"searching": "Searching…",
"none": "No matching branches.",
"local": "Local",
"remote": "Remote",
"newName": "New branch name",
"create": "Create",
"createNew": "Create new branch…",
"inWorkspace": "in {{value0}}",
"current": "current",
"noBranch": "No branch",
"stashTitle": "Stash changes and switch?",
"stashBody": "Your local changes would be overwritten. Stash them, switch, and re-apply?",
"stashConfirm": "Stash & switch",
"popConflict": "Switched, but re-applying your changes conflicted — they are saved in git stash.",
"failed": "Could not switch branch."
}
@coderabbitai

coderabbitai Bot commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a complete git branch-switching feature. A new shared module defines SwitchBranchMode, SwitchBranchResult, and SwitchBranchOptions types. The main-process switch-branch.ts module implements three execution modes (plain, create, stash) with dirty-overwrite detection, stash-no-op detection, and error normalization, routing through either a local git runner or an SSH provider. An Electron IPC handler (git:switchBranch) and a runtime RPC method (git.switchBranch) are registered, the latter added to the mobile allowlist. The preload bridge and a renderer switchRuntimeGitBranch function expose the operation to the UI. A useBranchSwitch hook manages debounced ref search, candidate annotation (local/remote deduplication, checked-out-elsewhere detection), concurrency gating, and conflict retry/toast logic. BranchSwitcher renders a searchable popover integrated into SourceControl, and locale strings are added for all five supported languages.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description is detailed but missing required template sections for Screenshots, AI Review Report, Security Audit, and Notes. Add the missing template sections, including a screenshot note, review findings, security audit, and platform-specific notes.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(source-control): branch switcher in the Source Control panel' clearly and specifically describes the main user-visible feature being added.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

🧹 Nitpick comments (3)
src/renderer/src/components/right-sidebar/branch-switch-candidates.test.ts (1)

32-44: ⚡ Quick win

Add a remote-first dedupe regression case.

Current coverage only checks local-then-remote ordering. Add the inverse ordering (origin/x before x) to lock dedupe behavior regardless of ref order.

src/main/ipc/filesystem.test.ts (1)

1909-1937: ⚡ Quick win

Add a dedicated invalid-mode test for the new IPC guard.

The handler validates mode at runtime, but these tests only cover branch validation. Add one case with an invalid mode to lock this boundary behavior.

src/preload/api-types.ts (1)

2216-2221: ⚡ Quick win

Use the shared SwitchBranchMode type to prevent contract drift.

This API surface already depends on shared branch-switch types; reusing SwitchBranchMode here avoids literal-union drift across IPC/runtime/preload boundaries.

Suggested patch
-import type { SwitchBranchResult } from '../shared/git-branch-switch'
+import type { SwitchBranchMode, SwitchBranchResult } from '../shared/git-branch-switch'
...
     switchBranch: (args: {
       worktreePath: string
       branch: string
-      mode: 'plain' | 'stash' | 'create'
+      mode: SwitchBranchMode
       connectionId?: string
     }) => Promise<SwitchBranchResult>

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 336cb2fc-3238-42b2-b6d2-e2f2cce6e615

📥 Commits

Reviewing files that changed from the base of the PR and between 26121a4 and 2ba6506.

📒 Files selected for processing (27)
  • src/main/git/switch-branch.test.ts
  • src/main/git/switch-branch.ts
  • src/main/ipc/filesystem.test.ts
  • src/main/ipc/filesystem.ts
  • src/main/runtime/orca-runtime-git.test.ts
  • src/main/runtime/orca-runtime-git.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/git-params.ts
  • src/main/runtime/rpc/methods/git.ts
  • src/main/runtime/runtime-rpc.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/components/right-sidebar/BranchSwitcher.test.tsx
  • src/renderer/src/components/right-sidebar/BranchSwitcher.tsx
  • src/renderer/src/components/right-sidebar/SourceControl.tsx
  • src/renderer/src/components/right-sidebar/branch-switch-candidates.test.ts
  • src/renderer/src/components/right-sidebar/branch-switch-candidates.ts
  • src/renderer/src/components/right-sidebar/useBranchSwitch.test.ts
  • src/renderer/src/components/right-sidebar/useBranchSwitch.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/runtime/runtime-git-client.ts
  • src/renderer/src/web/web-preload-api.ts
  • src/shared/git-branch-switch.ts

Comment on lines +83 to +89
if (switched.exitCode !== 0) {
// Why: only restore if we actually stashed — otherwise `pop` would apply an
// unrelated pre-existing stash and strand foreign changes here.
if (createdStash) {
await exec(['stash', 'pop'])
}
return { ok: false, reason: 'failed', message: switched.stderr.trim() }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Handle restore-pop failure after a failed switch.

On Line 83-Line 89, the recovery stash pop result is ignored. If restoration conflicts, the function still returns only reason: 'failed', so pop-conflict handling is skipped even though the worktree may now be in conflict state.

Proposed fix
   if (switched.exitCode !== 0) {
     // Why: only restore if we actually stashed — otherwise `pop` would apply an
     // unrelated pre-existing stash and strand foreign changes here.
     if (createdStash) {
-      await exec(['stash', 'pop'])
+      const restored = await exec(['stash', 'pop'])
+      if (restored.exitCode !== 0) {
+        return { ok: false, reason: 'stash_pop_conflict' }
+      }
     }
     return { ok: false, reason: 'failed', message: switched.stderr.trim() }
   }

Comment on lines +1554 to +1560
// Why: reject ref names that could be parsed as `git switch` flags (e.g.
// "--orphan") before they reach the shell-free exec.
if (!args.branch || args.branch.startsWith('-')) {
throw new Error('Invalid branch name')
}
if (args.mode !== 'plain' && args.mode !== 'stash' && args.mode !== 'create') {
throw new Error('Invalid switch mode')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Tighten IPC branch validation to reject whitespace-only names.

Line 1556 allows values like ' ' through; they fail later in git with a less actionable error. Validate a trimmed branch string at the boundary.

Suggested patch
-      if (!args.branch || args.branch.startsWith('-')) {
+      const branch = typeof args.branch === 'string' ? args.branch.trim() : ''
+      if (!branch || branch.startsWith('-')) {
         throw new Error('Invalid branch name')
       }
@@
       return runSwitchBranch({
         cwd: worktreePath,
         connectionId: args.connectionId,
-        options: { branch: args.branch, mode: args.mode }
+        options: { branch, mode: args.mode }
       })

Comment on lines +20 to 21
runSwitchBranch: vi.fn()
}))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Reset runSwitchBranch between tests to avoid state leakage.

mocks.runSwitchBranch is added but not reset in beforeEach (Line 77 onward), so call history/stubs can bleed between tests.

Suggested patch
   beforeEach(() => {
     mocks.abortMerge.mockReset()
     mocks.abortRebase.mockReset()
     mocks.getStagedCommitContext.mockReset()
     mocks.getPullRequestDraftContext.mockReset()
     mocks.generateCommitMessageFromContext.mockReset()
     mocks.generatePullRequestFieldsFromContext.mockReset()
     mocks.resolveCommitMessageSettings.mockReset()
     mocks.getSshGitProvider.mockReset()
+    mocks.runSwitchBranch.mockReset()
   })

Comment on lines +34 to +47
const seenLocal = new Set<string>()
const candidates: BranchSwitchCandidate[] = []
for (const ref of input.refs) {
// Why: the ref search strips the remote prefix into localBranchName, so a
// remote ref differs from its local name while a local ref matches it.
const kind = ref.refName === ref.localBranchName ? 'local' : 'remote'
// Why: a remote ref and an already-tracked local branch resolve to the same
// switch target; collapse to the local entry to avoid a duplicate row.
if (kind === 'remote' && seenLocal.has(ref.localBranchName)) {
continue
}
if (kind === 'local') {
seenLocal.add(ref.localBranchName)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Order-dependent dedupe can emit duplicate entries for the same switch target.

A remote ref is only skipped after its local branch has already been seen. If the remote appears first, both remote and local candidates are emitted, which breaks the one-row-per-target behavior.

Proposed fix
-  const seenLocal = new Set<string>()
+  const localBranchNames = new Set(
+    input.refs
+      .filter((ref) => ref.refName === ref.localBranchName)
+      .map((ref) => ref.localBranchName)
+  )
   const candidates: BranchSwitchCandidate[] = []
   for (const ref of input.refs) {
     // Why: the ref search strips the remote prefix into localBranchName, so a
     // remote ref differs from its local name while a local ref matches it.
     const kind = ref.refName === ref.localBranchName ? 'local' : 'remote'
     // Why: a remote ref and an already-tracked local branch resolve to the same
     // switch target; collapse to the local entry to avoid a duplicate row.
-    if (kind === 'remote' && seenLocal.has(ref.localBranchName)) {
+    if (kind === 'remote' && localBranchNames.has(ref.localBranchName)) {
       continue
     }
-    if (kind === 'local') {
-      seenLocal.add(ref.localBranchName)
-    }

Comment on lines +111 to +123
<button
type="button"
onClick={() => setCreating(true)}
disabled={disabled}
className={cn(
'flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm hover:bg-accent',
disabled && 'pointer-events-none opacity-50'
)}
>
<Plus className="size-3.5 shrink-0" aria-hidden="true" />
{translate('auto.branchSwitch.createNew', 'Create new branch…')}
</button>
)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use the shared Button primitive for interactive controls.

Line 111, Line 159, and Line 225 render raw <button> elements in UI flows where this layer is expected to use shadcn primitives. Please migrate these to @/components/ui/button variants to keep interaction styling and states consistent.

As per coding guidelines, “All UI work … must follow docs/STYLEGUIDE.md and use tokens defined in src/renderer/src/assets/main.css and shadcn primitives in src/renderer/src/components/ui/.”

Also applies to: 159-190, 225-233

Source: Coding guidelines

Comment on lines +10914 to +10915
},
"branchSwitch": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

branchSwitch appears attached to the wrong namespace.

branchSwitch is added as a sibling of i18n at Line 10915, while this PR’s stated i18n contract places it under i18n.hostedReview.copy. If lookup code expects the nested path, these keys won’t resolve.

Comment on lines +10916 to +10931
"search": "Search branches…",
"searching": "Searching…",
"none": "No matching branches.",
"local": "Local",
"remote": "Remote",
"newName": "New branch name",
"create": "Create",
"createNew": "Create new branch…",
"inWorkspace": "in {{value0}}",
"current": "current",
"noBranch": "No branch",
"stashTitle": "Stash changes and switch?",
"stashBody": "Your local changes would be overwritten. Stash them, switch, and re-apply?",
"stashConfirm": "Stash & switch",
"popConflict": "Switched, but re-applying your changes conflicted — they are saved in git stash.",
"failed": "Could not switch branch."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Spanish locale strings are still in English.

The new branchSwitch entries are English text in es.json (for example Line 10916 "Search branches…" and Line 10929 "Stash & switch"), which will surface untranslated UI in Spanish.

Comment on lines +10915 to 10932
"branchSwitch": {
"search": "Search branches…",
"searching": "Searching…",
"none": "No matching branches.",
"local": "Local",
"remote": "Remote",
"newName": "New branch name",
"create": "Create",
"createNew": "Create new branch…",
"inWorkspace": "in {{value0}}",
"current": "current",
"noBranch": "No branch",
"stashTitle": "Stash changes and switch?",
"stashBody": "Your local changes would be overwritten. Stash them, switch, and re-apply?",
"stashConfirm": "Stash & switch",
"popConflict": "Switched, but re-applying your changes conflicted — they are saved in git stash.",
"failed": "Could not switch branch."
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize the new branchSwitch copy.

Several labels in this Japanese locale are still English, so the branch picker will show mixed-language UI. Please translate the whole block.

Suggested translations
-      "search": "Search branches…",
-      "searching": "Searching…",
-      "none": "No matching branches.",
-      "local": "Local",
-      "remote": "Remote",
-      "newName": "New branch name",
-      "create": "Create",
-      "createNew": "Create new branch…",
-      "inWorkspace": "in {{value0}}",
-      "current": "current",
-      "noBranch": "No branch",
-      "stashTitle": "Stash changes and switch?",
-      "stashBody": "Your local changes would be overwritten. Stash them, switch, and re-apply?",
-      "stashConfirm": "Stash & switch",
-      "popConflict": "Switched, but re-applying your changes conflicted — they are saved in git stash.",
-      "failed": "Could not switch branch."
+      "search": "ブランチを検索…",
+      "searching": "検索中…",
+      "none": "一致するブランチがありません。",
+      "local": "ローカル",
+      "remote": "リモート",
+      "newName": "新しいブランチ名",
+      "create": "作成",
+      "createNew": "新規ブランチを作成…",
+      "inWorkspace": "({{value0}} で使用中)",
+      "current": "現在",
+      "noBranch": "ブランチなし",
+      "stashTitle": "変更をスタッシュして切り替えますか?",
+      "stashBody": "ローカル変更が上書きされます。スタッシュして切り替え、再適用しますか?",
+      "stashConfirm": "スタッシュして切り替え",
+      "popConflict": "切り替え後の再適用で競合しました。変更は git stash に保存されています。",
+      "failed": "ブランチを切り替えられませんでした。"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"branchSwitch": {
"search": "Search branches…",
"searching": "Searching…",
"none": "No matching branches.",
"local": "Local",
"remote": "Remote",
"newName": "New branch name",
"create": "Create",
"createNew": "Create new branch…",
"inWorkspace": "in {{value0}}",
"current": "current",
"noBranch": "No branch",
"stashTitle": "Stash changes and switch?",
"stashBody": "Your local changes would be overwritten. Stash them, switch, and re-apply?",
"stashConfirm": "Stash & switch",
"popConflict": "Switched, but re-applying your changes conflicted — they are saved in git stash.",
"failed": "Could not switch branch."
}
"branchSwitch": {
"search": "ブランチを検索…",
"searching": "検索中…",
"none": "一致するブランチがありません。",
"local": "ローカル",
"remote": "リモート",
"newName": "新しいブランチ名",
"create": "作成",
"createNew": "新規ブランチを作成…",
"inWorkspace": "({{value0}} で使用中)",
"current": "現在",
"noBranch": "ブランチなし",
"stashTitle": "変更をスタッシュして切り替えますか?",
"stashBody": "ローカル変更が上書きされます。スタッシュして切り替え、再適用しますか?",
"stashConfirm": "スタッシュして切り替え",
"popConflict": "切り替え後の再適用で競合しました。変更は git stash に保存されています。",
"failed": "ブランチを切り替えられませんでした。"
}

Comment on lines +10915 to +10931
"branchSwitch": {
"search": "Search branches…",
"searching": "Searching…",
"none": "No matching branches.",
"local": "Local",
"remote": "Remote",
"newName": "New branch name",
"create": "Create",
"createNew": "Create new branch…",
"inWorkspace": "in {{value0}}",
"current": "current",
"noBranch": "No branch",
"stashTitle": "Stash changes and switch?",
"stashBody": "Your local changes would be overwritten. Stash them, switch, and re-apply?",
"stashConfirm": "Stash & switch",
"popConflict": "Switched, but re-applying your changes conflicted — they are saved in git stash.",
"failed": "Could not switch branch."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Translate branchSwitch strings to Korean in the Korean locale file.

The new branchSwitch entries are still English, so Korean users will see mixed-language UI.

Suggested localization patch
     "branchSwitch": {
-      "search": "Search branches…",
-      "searching": "Searching…",
-      "none": "No matching branches.",
-      "local": "Local",
-      "remote": "Remote",
-      "newName": "New branch name",
-      "create": "Create",
-      "createNew": "Create new branch…",
-      "inWorkspace": "in {{value0}}",
-      "current": "current",
-      "noBranch": "No branch",
-      "stashTitle": "Stash changes and switch?",
-      "stashBody": "Your local changes would be overwritten. Stash them, switch, and re-apply?",
-      "stashConfirm": "Stash & switch",
-      "popConflict": "Switched, but re-applying your changes conflicted — they are saved in git stash.",
-      "failed": "Could not switch branch."
+      "search": "브랜치 검색…",
+      "searching": "검색 중…",
+      "none": "일치하는 브랜치가 없습니다.",
+      "local": "로컬",
+      "remote": "원격",
+      "newName": "새 브랜치 이름",
+      "create": "생성",
+      "createNew": "새 브랜치 생성…",
+      "inWorkspace": "{{value0}}에서",
+      "current": "현재",
+      "noBranch": "브랜치 없음",
+      "stashTitle": "변경 사항을 스태시하고 전환할까요?",
+      "stashBody": "로컬 변경 사항이 덮어써집니다. 스태시한 뒤 전환하고 다시 적용할까요?",
+      "stashConfirm": "스태시 후 전환",
+      "popConflict": "브랜치를 전환했지만 변경 사항 재적용 중 충돌이 발생했습니다 — 변경 사항은 git stash에 저장되었습니다.",
+      "failed": "브랜치를 전환할 수 없습니다."
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"branchSwitch": {
"search": "Search branches…",
"searching": "Searching…",
"none": "No matching branches.",
"local": "Local",
"remote": "Remote",
"newName": "New branch name",
"create": "Create",
"createNew": "Create new branch…",
"inWorkspace": "in {{value0}}",
"current": "current",
"noBranch": "No branch",
"stashTitle": "Stash changes and switch?",
"stashBody": "Your local changes would be overwritten. Stash them, switch, and re-apply?",
"stashConfirm": "Stash & switch",
"popConflict": "Switched, but re-applying your changes conflicted — they are saved in git stash.",
"failed": "Could not switch branch."
"branchSwitch": {
"search": "브랜치 검색…",
"searching": "검색 중…",
"none": "일치하는 브랜치가 없습니다.",
"local": "로컬",
"remote": "원격",
"newName": "새 브랜치 이름",
"create": "생성",
"createNew": "새 브랜치 생성…",
"inWorkspace": "{{value0}}에서",
"current": "현재",
"noBranch": "브랜치 없음",
"stashTitle": "변경 사항을 스태시하고 전환할까요?",
"stashBody": "로컬 변경 사항이 덮어써집니다. 스태시한 뒤 전환하고 다시 적용할까요?",
"stashConfirm": "스태시 후 전환",
"popConflict": "브랜치를 전환했지만 변경 사항 재적용 중 충돌이 발생했습니다 — 변경 사항은 git stash에 저장되었습니다.",
"failed": "브랜치를 전환할 수 없습니다."
}

Comment on lines +10915 to +10931
"branchSwitch": {
"search": "Search branches…",
"searching": "Searching…",
"none": "No matching branches.",
"local": "Local",
"remote": "Remote",
"newName": "New branch name",
"create": "Create",
"createNew": "Create new branch…",
"inWorkspace": "in {{value0}}",
"current": "current",
"noBranch": "No branch",
"stashTitle": "Stash changes and switch?",
"stashBody": "Your local changes would be overwritten. Stash them, switch, and re-apply?",
"stashConfirm": "Stash & switch",
"popConflict": "Switched, but re-applying your changes conflicted — they are saved in git stash.",
"failed": "Could not switch branch."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Localize branchSwitch strings for zh.json instead of shipping English text.

All newly added branchSwitch values are English, so Chinese users will see untranslated UI in this flow. Please provide Chinese translations for this block to match the locale file and PR i18n goal.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants