fix(github): stop fork remotes from claiming the local branch's PR badge
PR-status source candidates were every configured remote, so a checkout carrying contributor forks matched a fork's closed PR whose head merely shared the branch name — a fork's 'main' surfaced on the local main in the git and work-status panels. Only the ranked-first remote (the one the branch pushes to) and its fork network are PR sources now; other remotes remain search targets but their owner:branch heads no longer count.
This commit is contained in:
@@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
|
||||
- **Session tabs (opt-in):** the web/desktop header can show your open sessions as browser-style tabs — turn them on in Settings → General → Navigation → Session tabs. Every session you open joins the strip, clicking a tab switches the whole workspace (chat, project, panels), and closing one (its × button, middle-click, or Alt+W — rebindable in Shortcuts) never touches the session itself. Tabs reorder by drag, scroll behind the header buttons when there are many and carry the sidebar's running/unread dot. Each tab has the full session menu — on the "..." button or right-click — plus Close other tabs; renaming works right in the tab.
|
||||
- **Keyboard shortcuts learned sequences** (thanks @ChangeHow): shortcuts can now be two steps — press Cmd/Ctrl+S, then a letter: P opens the draft's project picker, G its branch picker, L the session list. A held sequence shows no menu but forgives you: Escape or three quiet seconds cancel it, and typing into a text field never triggers one armed elsewhere. Dropdown menus and pickers now also answer Ctrl+N/Ctrl+P for down/up, the session switcher opens focused on your current session, and every tooltip and menu label shows the binding you actually have set, not the default.
|
||||
- **Keyboard shortcuts redesigned.** Defaults now follow one model: single chords for everyday actions, a two-step Cmd/Ctrl+K leader for open/go actions (K then P/G/L — project picker, branch picker, session list; T timeline, N prompt navigator, I services, H shortcut help, C theme), held Cmd/Ctrl+digit for header session tabs and held Cmd/Ctrl+Option+digit for context panel surfaces. Cmd/Ctrl+B now toggles the sidebar; when it's already open, the session-list shortcut jumps into its search. Rare actions moved into the command palette instead of carrying obscure default bindings, and custom bindings recorded under the old layout are reset once. Shortcuts also stopped requiring an English keyboard layout — bindings follow the physical key on non-Latin layouts (and Option-modified digits on macOS), including when recording custom ones.
|
||||
- Git: the branch's PR badge no longer picks up a stranger's pull request. With contributor forks added as git remotes, a fork's closed PR whose head branch merely shared a name (a fork's "main") could show up on the local branch in the git panel and the work-status panel; only the repo a branch actually pushes to counts as its PR source now.
|
||||
- Desktop: two windows on different projects no longer hijack each other — switching sessions in one window could make the other adopt its project and jump to the same session mid-typing (the shared settings file round-tripped the active project between windows). Notification clicks and openchamber:// session links now open in one window instead of switching every window.
|
||||
- **Session expiry is announced, not discovered.** When the OpenChamber login expires (a browser on the LAN, a paired device, a tunnel), a frosted banner appears under the header within seconds — before anything is clicked — saying the session expired, with a Log in button that opens the usual unlock screen. Work on screen stays visible and interactive; sending is paused until login instead of failing into a toast. A 401 is confirmed against the server first, so an expired model-provider key can't fake a logout, and returning to the app after a long absence re-checks the session once. If a conversation failed to load while logged out, it explains that and reloads itself right after login.
|
||||
- **Permission cards answer to the keyboard:** Alt+Enter allows once, Alt+Shift+Enter allows always, Alt+Backspace denies — the keys are printed on the buttons, and the newest pending card is the one that listens. The auto-accept toggle also got a shortcut (Cmd/Ctrl+K, A).
|
||||
|
||||
@@ -674,7 +674,16 @@ export async function resolveGitHubPrStatus({ octokit, directory, branch, remote
|
||||
};
|
||||
}
|
||||
|
||||
const sourceCandidates = resolvedTargets.slice();
|
||||
// Only the repo this branch actually pushes to (the ranked-first remote)
|
||||
// and its fork network can be the SOURCE of the branch's PRs. Other
|
||||
// configured remotes — a maintainer's checkout often carries contributor
|
||||
// forks — are places to look for an open PR, but their `owner:branch`
|
||||
// heads are unrelated branches that merely share a name; treating them as
|
||||
// sources made a fork's closed `main` PR show up on the local main.
|
||||
const primaryRemoteName = resolvedTargets[0]?.remoteName ?? null;
|
||||
const sourceCandidates = resolvedTargets.filter(
|
||||
(target) => target.remoteName === primaryRemoteName,
|
||||
);
|
||||
// When every consulted repo list was complete, a no-PR result is
|
||||
// authoritative and the expensive Search API fallback is pointless.
|
||||
const coverage = { authoritative: true };
|
||||
|
||||
Reference in New Issue
Block a user