Review local git diffs with optional tool mode - #100
Merged
Conversation
Site: add @aptabase/web to the shared Base layout with a pageview
event per load. Uses app key A-EU-1996018704 (separate from the
Electron app's key so site and app traffic stay distinct).
App: move initialize() to module scope so it runs BEFORE
app.whenReady() — the Aptabase Electron README requires this, and
with init inside the whenReady handler we were silently dropping
every event including app_started. Reads prefs early (safe — only
touches app.getPath('userData') which works pre-ready) and skips
init if analytics is off. The existing enableAnalyticsIfAllowed
fallback is kept so users who opt in mid-session still get tracked.
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Squirrel fires update-downloaded on a timer that routinely beats the renderer to its IPC subscription, so the "will install on next restart" banner was being lost — users had no idea an update was waiting. Cache the ready version in the main process and expose it via a pull IPC so the banner can replay it on mount. Also add GNOSIS_FAKE_UPDATE_READY env var that seeds the cache at startup, letting the banner be tested in dev without a real download. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add a DiffSource abstraction so the review pipeline can run against either a GitHub PR or a local git repository. Local reviews take a repo path and two refs (any sha/branch/tag/HEAD~n), produce a three-dot diff matching GitHub PR semantics, and feed the existing slideshow pipeline. When the reviewer opts in to tool mode, the CLI runs with cwd = repo so Claude auto-discovers the project's own .mcp.json, .claude/settings.json, and skills. Allowed tools expand to Bash/Read/Grep/Glob for running tests and searching the tree, while Edit/Write stay off to keep the working tree clean. The Claude project context is served unfiltered in this mode since the agent can reach every entry via tools anyway. Key pieces: - lib/diffSource.ts: DiffSource interface + createDiffSource factory. - lib/localGit.ts: LocalGitDiffSource backed by git subprocesses. - lib/claude-context.ts: shared .claude/** probe used by both sources. - components/LocalRepoDialog.tsx: repo picker with branch datalist, default-base detection (prefers origin/main over stale local main), live file-count preview, humanized validation errors, tool-mode opt-in checkbox, and last-used path recall. - src/main.ts: routes runBackgroundGeneration through the factory; gates GitHub-only IPC handlers (submit-review, freshness, CI) on local URLs; adds pick-repo-dir / list-repo-refs / validate-local-repo IPCs; wires cwd + read-only tool allow-list when local tools are on. - Renderer gating: hides submit dialog, freshness poll, and PR status calls for local reviews; PRSummaryBanner shows the base→head range inline instead of a github.com link. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Rework the unauthenticated welcome into two equal paths: sign in with GitHub, or review any local git repo with no account needed. Choosing the local path flips a new `guestMode` preference so the home screen unlocks and returning visits skip the gate. The masthead surfaces a "Guest · connect GitHub" affordance for a one-click upgrade when the user is ready. Guest-mode renderer gating: - Compose-form prose hides "browse your pull requests" (requires a token); "review a local git diff" stays. - OnboardingRepoSetup gains a line pointing users at local review as an alternative to repo-watching. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 tasks
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.
Summary
DiffSourceabstraction so the review pipeline runs against either a GitHub PR or a local git repository (any sha/branch/tag/HEAD~n, three-dot diff semantics matching GitHub's PR view).LocalRepoDialogwith repo picker, branch datalist, default base that prefersorigin/mainover stale local refs, live file-count preview, humanized validation errors, and last-used path recall.cwd = reposo it auto-discovers the project's own.mcp.json,.claude/settings.json, and skills. Read-only + test tools (Bash,Read,Grep,Glob) are allowed;Edit/Writestay off to protect the working tree. Project context is served unfiltered in this mode since the agent can reach every entry via tools anyway.{ supported: false }forlocal:URLs.PRSummaryBannershows the actualbase → headrange inline instead of an "Open on GitHub" link for local reviews.Test plan
git:messages leak.origin/main(or whateverorigin/HEADpoints at) rather than stale localmain.HEADas a ref → "Working tree has uncommitted changes" phase message appears..mcp.json/ skills are available, and the phase banner surfaces the tool-mode notice.base → head.pnpm tsc --noEmitclean;pnpm eslint .introduces zero new errors (pre-existing warnings onsrc/main.ts/src/pages/HomePage.tsxuntouched).🤖 Generated with Claude Code