Repository navigation
Resume dialog: show workspace names, not internal ids, while workspaces load #33038
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
Merged
brennanb2025
merged 6 commits into
main
from
brennanb2025/resume-dialog-workspace-names
Oct 24, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2d33f7d
fix(native-chat): name workspaces by folder in the resume dialog whil…
brennanb2025 fc7727a
fix: distinguish unknown resume workspaces with matching folder names
brennanb2025 5e4e212
Merge remote-tracking branch 'origin/main' into brennanb2025/resume-d…
brennanb2025 11102e3
refactor: extract resume workspace display derivation
brennanb2025 ebca5d4
Merge origin/main (picks up #33046 main lint fix)
brennanb2025 10c4450
fix: distinguish resume workspace control names
brennanb2025 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
48 changes: 48 additions & 0 deletions
48
src/renderer/src/components/native-chat-resume-workspace-display.ts
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,48 @@ | ||
| import { dirname } from '@/lib/path' | ||
| import { resolveWorktreeDisplayName } from '@/lib/worktree-default-display-name' | ||
| import { | ||
| getWorktreePathBasenameFromId, | ||
| splitWorktreeIdForFilesystem | ||
| } from '../../../shared/worktree/id' | ||
| import type { | ||
| ResumeRepoGroup, | ||
| ResumeWorkspaceGroup | ||
| } from './native-chat-resume-on-restart-grouping' | ||
|
|
||
| type WorkspaceFallback = { name: string; parentPath: string } | ||
| export type WorkspaceFallbacks = ReadonlyMap<ResumeWorkspaceGroup, WorkspaceFallback> | ||
|
|
||
| export function deriveFallbacks(repoGroup: ResumeRepoGroup): WorkspaceFallbacks { | ||
| const fallbackDisplays = new Map<ResumeWorkspaceGroup, WorkspaceFallback>() | ||
| if (repoGroup.repoId === null) { | ||
| const countByName = new Map<string, number>() | ||
| for (const group of repoGroup.workspaces) { | ||
| const name = getWorktreePathBasenameFromId(group.workspaceId) || group.workspaceId | ||
| const path = splitWorktreeIdForFilesystem(group.workspaceId)?.worktreePath | ||
| fallbackDisplays.set(group, { name, parentPath: path ? dirname(path) : '' }) | ||
| countByName.set(name, (countByName.get(name) ?? 0) + 1) | ||
| } | ||
| for (const display of fallbackDisplays.values()) { | ||
| if (countByName.get(display.name) === 1) { | ||
| display.parentPath = '' | ||
| } | ||
| } | ||
| } | ||
| return fallbackDisplays | ||
| } | ||
|
|
||
| export function resolveNames( | ||
| worktree: Parameters<typeof resolveWorktreeDisplayName>[0] | undefined, | ||
| fallback: WorkspaceFallback | undefined, | ||
| workspaceId: string | ||
| ): { name: string; controlName: string } { | ||
| const name = | ||
| (worktree && resolveWorktreeDisplayName(worktree)) || | ||
| fallback?.name || | ||
| getWorktreePathBasenameFromId(workspaceId) || | ||
| workspaceId | ||
| return { | ||
| name, | ||
| controlName: !worktree && fallback?.parentPath ? `${name} (${fallback.parentPath})` : name | ||
| } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.