fix(tui): show worktree names in session list (#42108)

This commit is contained in:
James Long 2026-08-12 14:44:48 -04:00 committed by GitHub
parent 3251bff6ff
commit dff6eb631b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -141,11 +141,11 @@ export function DialogSessionList() {
const option = (session: SessionInfo, category: string) => {
const directory = session.location.directory
const project = data.project.get(session.projectID)
const relative = path.relative(project?.canonical ?? directory, directory)
const footer = allProjects()
? Locale.truncate(projectName(project, directory) ?? "", 20)
: relative.startsWith("..") || path.isAbsolute(relative)
? Locale.truncate(path.basename(directory), 20)
const root = session.subpath ? path.resolve(directory, ...session.subpath.split("/").map(() => "..")) : directory
const relative = path.relative(project?.canonical ?? root, root)
const footer =
relative.startsWith("..") || path.isAbsolute(relative)
? Locale.truncate(path.basename(relative), 25)
: undefined
const slot = sessionTabs.enabled() ? undefined : slotByID.get(session.id)
const deleting = toDelete() === session.id