Skip to content

feat(desktop): name a session's location in the rail hover card - #5271

Merged
orangeCatDeveloper merged 2 commits into
apache:mainfrom
jiang1997:feat/session-location-hover
Sep 28, 2026
Merged

orangeCatDeveloper merged 2 commits into
apache:mainfrom
jiang1997:feat/session-location-hover

Conversation

@jiang1997

Copy link
Copy Markdown
Contributor

Summary

Linked worktrees share one Project identity, so the project row can show a preferred location that does not match the session's actual working directory.

When a local project has multiple locations, resolve the session's cwd against its project locations and show the matched path in the session hover card. Single-location projects remain unchanged, and Runtime Host sessions do not use local project locations.

The location is displayed as muted supporting text with the full path preserved in the tooltip.

Verification

  • npm run build:test
  • npm run format:check
  • npm --workspace @maka/ui run typecheck
  • npm --workspace @maka/desktop run typecheck
  • Biome lint on changed files
  • Desktop session-navigation tests: 8 passed
  • UI session hover/row tests: 13 passed
  • git diff --check

AI use

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope:

Codex contributed to the implementation review, session-location wiring, styling, tests, and validation.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — session hover cards now identify the session's location for multi-location projects
  • No

@github-actions github-actions Bot added the effort/M Under 500 readable lines label Sep 13, 2026

@hqhq1025 hqhq1025 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.

Reviewed exact head 95ea260fea99b2bb235332e6aca84532f465e05b. I found no P0-P3 issues in this change.

The implementation resolves a local Session's cwd against the Project catalog only when that Project has multiple registered locations, handles canonical IDs and aliases, and excludes Runtime Host workspaces from the local catalog. The production create/relocate path stores the catalog's exact selected location in the Session header, while relink updates affected Session paths transactionally. The UI carries the matched catalog path into the hover card, keeps long paths bounded with an ellipsis and full title, and includes it in the accessible description.

Validation completed:

  • npm run build:test
  • full workspace typecheck, lint, format check, ASF headers, renderer architecture (112/112), E2E budget, and git diff --check
  • UI tests: 442/442; Desktop tests: 2460/2460
  • focused Session navigation: 8/8; focused hover-card rows: 12/12
  • Storybook production build and browser smoke: 357 stories / 386 theme renders, including the Project Groups hover-card location interaction
  • clean merge-tree with current main at 0d4a6ba5f48de6807ab96d6b5aad3635cc6a1f57

GitHub currently reports only the successful label check for this head; no hosted test check is present. I did not exercise a packaged native Windows/macOS build or a real multi-worktree Desktop installation. Since this is a user-facing feature, the merge decision remains with a human maintainer.

Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.

@me2seeks me2seeks 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.

Automated review notice: This comment was posted by an automated review agent operated by me2seeks make. It is not an independent human review and does not replace one.

Summary

Resolves a session's cwd against its project's locations and names the matched location in the rail hover card, only for multi-location projects and never for Host-workspace (remote) sessions. The issue is real: linked worktrees share one Project identity, so the hover card could show a location that isn't the session's working directory. The fix is minimal and at the right layer — it reuses the worktree mark's Host boundary (runtimeHostProfileUsesHostWorkspace), returns the project's canonical path rather than the raw cwd, and is covered by POSIX, Windows mixed-separator/case, drive-root, and remote-exclusion tests that would fail on revert.

Findings

  1. [P3] samePath is shared with deriveWorktreeSessionIds, so the new Windows case-folding (apps/desktop/src/renderer/features/session-navigation/model/session-project-grouping.ts:108-113) silently changes the worktree mark's semantics too — previously c:/repo never matched C:\Repo. It is a fix and it is tested, but it is a second behavior change riding in a display PR and deserves a line in the description.
  2. [P3] isWindowsPath treats any //-prefixed path as UNC (line 131); POSIX explicitly permits //-leading paths, which would now be case-folded. Vanishingly rare on real sessions.

Verdict

merge-ready — well-scoped display change with honest tests; only the shared samePath side effect is worth a mention.

A repository and its linked worktrees resolve to one Project identity, so
the rail showed the worktree path as the project's preferred path and gave
no way to tell which location a task actually runs in.

When a project has more than one location, resolve the session's own
location by matching cwd against project.locations and show it on the
hover card, with the full path in the tooltip. Single-location projects
stay quiet. The selector mirrors sessionProjectName so the memoized
SessionRailData keeps its identity (apache#4109).

Generated-by: Codex
Only treat an explicit backslash UNC prefix or drive-absolute path as Windows for case-insensitive comparison. Keep the worktree mark and session location matched by the same rule, with regression tests for POSIX and UNC paths.

Generated-by: Codex
@jiang1997
jiang1997 force-pushed the feat/session-location-hover branch from c98caa4 to 360b149 Compare September 27, 2026 22:27

@hqhq1025 hqhq1025 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.

Reviewed exact head 360b149cb1920f933255817fda41ee6b988fc31c. I found no P0-P3 issues in the current change.

The implementation resolves a Session's location from the Runtime-Host-scoped Project catalog, exposes a path only for local Projects with multiple registered locations, and returns the catalog's canonical path (use-session-navigation-controller.ts:155-193, session-project-grouping.ts:47-54). The hover card renders that path with bounded display, a full title, and the same value in its accessible description (session-history-list.tsx:1116-1129,1169-1178).

The new head also fixes the previous double-slash ambiguity in the shared location/worktree comparison. It folds case only for drive-absolute paths or an explicit backslash UNC source while keeping // POSIX paths case-sensitive (session-project-grouping.ts:57-90). The added regression is discriminating: transplanted onto parent e96bb8f217879b8a0ad026123c4af33f141ece69 while retaining the old comparison, it failed because //repo-feature incorrectly matched //Repo-Feature; the current head passes both that POSIX case and the explicit UNC mixed-separator case.

Validation completed on Node 24.18.1 after a clean npm ci:

  • npm run build:test
  • focused Session navigation and hover-card tests: 32/32
  • UI tests: 682/682; Desktop tests: 2844/2844
  • full workspace typecheck, lint, format check, ASF headers, git diff --check
  • renderer architecture: 112/112; E2E budget: 34 tests in 20 files
  • Storybook production build and browser smoke: 439 stories / 476 theme renders
  • clean merge-tree against current main 542f04a4f328de7a49b96e5146f391fb923fa369; the PR is 2 commits ahead and 0 behind

GitHub currently reports no hosted checks for this head. I did not exercise a packaged native Windows/macOS build or a real multi-worktree Desktop installation. Since this is a user-facing feature, the merge decision remains with a human maintainer.

Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.

@orangeCatDeveloper

Copy link
Copy Markdown
Contributor

LGTM

@orangeCatDeveloper
orangeCatDeveloper merged commit f298d70 into apache:main Sep 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/M Under 500 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants