Fix History tab lane focus and destructive git safety#349
Closed
cursor[bot] wants to merge 1 commit into
Closed
Conversation
Opening History with both laneId and commitSha cleared the selected commit because setFocusLaneId ran after setSelectedCommitSha. Sync focus lane with the globally selected lane when returning to History (unless URL drives state), and gate commit/lane git actions on an actual worktree path. Co-authored-by: Arul Sharma <arul28@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This was referenced May 23, 2026
Owner
|
Consolidated into #356. |
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.
Bug and impact
Broken commit deeplinks — Navigating to
/history?surface=commits&laneId=…&commitSha=…(e.g. Activity “View commit”) calledsetSelectedCommitShaand thensetFocusLaneId, which always clears commit selection. Users landed on the lane with no commit focused; shareable links were unreliable.Destructive git on the wrong lane — History keeps its own
focusLaneId, independent of the globally selected lane. After switching lanes on Lanes/Work and returning to History, hard reset / force-push / lane delete could target the previously focused lane while the user believed they were on the current selection.Destructive git with missing worktree — Commit and lane git menus treated
hasWorktree/hasLaneasBoolean(laneId)even when the lane record had no worktree path or commit history failed with “worktree is missing”, leaving destructive actions enabled in the UI.Root cause
setFocusLaneIdafter commit URL hydration inHistoryPage.Fix
commitShafrom the URL (lane is already set earlier in hydration).focusLaneIdwithselectedLaneId.laneHasWorktreefrom lane metadata; disable commit context actions when worktree is missing or load reports it.Validation
npm run test -- --run src/renderer/components/history/historyGitActions.test.ts src/renderer/components/history/historyUrlHydration.test.ts src/renderer/components/history/historyLaneActions.test.ts(28 passed)Related open PRs (not duplicated)
commitOnLaneHistorygating for cross-lane commits