Skip to content

Titlebar navigation, persistent list controls, and branch/PR fixes - #82

Open
peterjthomson wants to merge 1 commit into
masterfrom
feature/navigation-and-list-upgrades
Open

peterjthomson wants to merge 1 commit into
masterfrom
feature/navigation-and-list-upgrades

Conversation

@peterjthomson

@peterjthomson peterjthomson commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

A batch of small upgrades from daily use:

  • Back/forward in the titlebar – VS Code-style arrows for editor history (⌘[ / ⌘] already worked). Back/forward now also restores repo and mailmap views, and worktree/mailmap links are recorded in history.
  • List controls persist across panel switches – new app/stores/list-controls-store.ts holds search/filter/sort per list type. Radar columns and matching Focus sidebar sections share it. Filter, sort, and sidebar section expansion persist across restarts; search is session-only.
  • "All" sidebar filter controls – SectionHeader/SectionFilter were declared inside Sidebar's render, so every background refresh remounted them (stealing focus, closing native <select> popups). Hoisted to module scope.
  • Remote lists – show feature/x instead of remotes/origin/feature/x (remote badge only when there are several remotes); commit hashes removed.
  • Commit counts – count commits since the fork from origin/master → origin/main → master → main, not the whole history. main/master keep their full count.
  • Remote branch rename – previously ran git branch -m remotes/origin/x …, giving "branch not found". Now GitHub remotes use gh api …/branches/{branch}/rename, so open PRs follow the rename (a failure is reported; there is no silent push+delete fallback that would close PRs). Other remotes push the new name and delete the old one. Local tracking branches are retargeted. A Rename button is added to the remote branch card.
  • PR rename – Rename button on the PR detail card (open PRs) runs gh pr edit --title, via a new edit-pr-title conveyor channel.
  • Line staging review – staging selected lines of an untracked file always failed (does not exist in index); partial patches now create the file. Untracked diffs no longer include a phantom trailing empty line (which also made whole-file hunk staging add a blank line). The three duplicate untracked-diff builders now share buildUntrackedFileDiff.

Test plan

  • npm run typecheck and eslint clean
  • npm test – full Playwright suite green, including new tests:
    • untracked-file whole and partial line staging (with/without trailing newline)
    • fork-based commit counts
    • remote branch rename against a local bare remote (incl. upstream retargeting)
    • remote display-name helpers
    • list sort persists across canvas switches and is shared with the radar column
    • titlebar back/forward walk the editor history
  • Manual: rename a throwaway remote branch with an open PR on GitHub and confirm the PR follows
  • Manual: rename a PR title from the PR card

Generated with Devin


Note

Medium Risk
Touches git remotes (rename, commit ranges), GitHub CLI/API for PR and branch renames, and staging patch generation—real repo mutation paths though scoped to explicit user actions.

Overview
Adds VS Code-style back/forward in the titlebar (alongside existing ⌘[ / ⌘]) and wires editor history to restore repo and mailmap views when navigating.

Introduces a shared list-controls-store so search, filter, sort, and sidebar section expansion stay aligned between Radar columns and Focus sidebar sections, survive canvas/panel switches, and persist filter/sort/section state across restarts. Sidebar filter UI is hoisted to module scope so list refreshes no longer remount controls and steal focus from inputs/dropdowns.

Remote branches show short names (remote badge only when multiple remotes); commit counts count commits since fork from main/master. Rename remote branches from the detail card via GitHub’s branch-rename API on origin (or push+delete elsewhere), with tracking branches updated. Rename open PR titles from the PR card through a new edit-pr-title IPC path.

Staging fixes line-level staging for untracked files and removes phantom trailing blank lines in untracked diffs via shared buildUntrackedFileDiff and newFile partial patches.

Reviewed by Cursor Bugbot for commit 863f775. Bugbot is set up for automated code reviews on this repo. Configure here.

Addresses a batch of small upgrades from daily use:

- Titlebar back/forward buttons for editor history (VS Code style); back/forward
  now also restores repo and mailmap views.
- List search/filter/sort live in a shared store, so they survive canvas and
  panel switches and stay in step between radar columns and Focus sidebar
  sections. Filter, sort, and section expansion persist across restarts.
- Focus sidebar section controls are hoisted to module scope; they were being
  remounted on every refresh, which stole focus and closed open dropdowns.
- Remote branch lists drop the remotes/<remote>/ prefix and commit hashes.
- Branch commit counts start at the fork point from main/master rather than
  counting the whole history.
- Renaming a remote branch no longer runs `git branch -m` on a remote ref.
  GitHub remotes use the branch-rename API so open PRs follow; other remotes
  push the new name and delete the old one. Tracking branches are retargeted.
- PR detail card can rename (retitle) the PR via `gh pr edit`.
- Line staging works for untracked files, and untracked diffs no longer
  include a phantom trailing empty line.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 863f775. Configure here.

Comment thread lib/main/git-service.ts
}
} else {
await git.raw(['push', remote, `refs/remotes/${remote}/${oldName}:refs/heads/${newName}`])
await git.raw(['push', remote, '--delete', oldName])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale tip can drop remote commits

Medium Severity

The non-GitHub rename pushes refs/remotes/&lt;remote&gt;/&lt;oldName&gt; as the new head and then deletes the live remote branch, without fetching first. A stale tracking ref can publish an old tip and drop commits that only existed on the remote.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 863f775. Configure here.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant