Repository navigation
feat(changelens): read main history when the checkout is off main - #414
Merged
Merged
Conversation
…branch Selection now carries where HEAD stands against the default branch (ahead, behind, origin/main or local main) and which history a time window read. A time window on a branch with no commits in it reads the default branch instead. history=head|main picks one explicitly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The status row names the checked-out branch and how far it is behind the default branch when HEAD is off it. Time windows get a History toggle between the branch and origin/main. An empty window offers main's history when main has commits there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The Changes view now works on a checkout that sits on an old branch. It says which branch you are on and how far behind
mainit is. The 24 hours, 7 days and Custom time windows can readorigin/main's history without checking anything out.What you'll see
codex/search-example-pages-2026-11-09 42 behind, 1 ahead of origin/main.git log,git diff,git showonorigin/main). It never switches the branch or touches the working tree.origin/mainand a note says so. Pick Branch to go back. The choice is kept in the URL (chist=head|main).origin/mainhas commits in the same time, the empty view says why and offers Show origin/main's history (N commits). For This branch, the button offersorigin/main's last 7 days.origin/mainis used when it exists and localmainis not ahead of it; otherwise localmain.Proof
Before, on explorEDA's stale checkout (7 days): the lens read only the branch and showed nothing.
After, same checkout and window: the status row names the branch and the gap, and the window reads
origin/main(11 commits, 335 chunks).After, with Branch picked: the empty view explains why and offers
origin/main's history.Checks on this branch:
scripts/check.sh client: 67 files, 492 tests pass, typecheck clean.scripts/check.sh server: 624 tests pass. Two new tests pin the off-main window:test_a_time_window_off_main_reads_main_history_when_head_has_none(auto switch, ahead/behind,origin/mainpreferred over a stale localmain, the branch window unchanged) andtest_head_history_off_main_is_empty_and_counts_main_commits.pnpm e2e: 21 passed, 1 skipped.Limits
git rev-list --since/--untilonorigin/main, so it can differ a little from the window's own first-parent run.git fetch:origin/mainis only as new as the last fetch.srcly changes) gets the automatic switch but has no--historyflag.Survey moves: corpus only. This PR adds code to
client/andserver/, which the survey samples (the newBranchdataclass and branch helpers inchangelens/window.py, andBranchNotice.tsx). That adds one server trace (partial) and moves its frontier and boundary stops (+16 external-code, +2 budget-exhausted, -1 unproven-handoff in each repo). No analysis code changed.🤖 Generated with Claude Code