GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Guard git quick actions for diverged or stale branch status by juliusmarminge · Pull Request #47 · pingdotgg/t3code Conversation
|
WalkthroughAdds branch divergence detection that disables the "Sync branch" quick action when a branch is both ahead and behind upstream. Introduces a null-safe git status proxy in the UI while resynchronizing and starts upstream refresh in the background on checkout; tests updated to handle asynchronous refresh/fetch behavior. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as Web UI (GitActionsControl)
participant API as Server API (checkout)
participant Core as GitCoreService
UI->>API: request checkoutBranch
API->>Core: perform checkout
Core-->>API: checkout result
API-->>UI: return checkout result (immediate)
API->>Core: start refreshCheckedOutBranchUpstream (async)
Note right of Core: background fetch may be delayed/long-running
Core-->>API: (background) fetch complete
API->>UI: subsequent status invalidation/notification
UI->>UI: set gitStatusForActions = null while resyncing
UI-->>UI: show "Refreshing git status..."
UI->>API: refetch git status
API->>Core: query status
Core-->>API: latest status
API->>UI: deliver updated git status (gitStatusForActions populated)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Guard GitActionsControl quick actions for diverged or stale git status and run
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Greptile SummaryImproved git status synchronization and diverged branch handling by preventing quick actions when branches have both ahead and behind commits. The PR adds stale status detection that triggers automatic query refresh when Key changes:
Critical Issue: The Confidence Score: 3/5
Important Files Changed
Flowchartflowchart TD
A[Git Status Query] --> B{isGitStatusOutOfSync?}
B -->|Yes| C[Invalidate Git Queries]
B -->|No| D[Use gitStatus]
B -->|Yes| E[Set gitStatusForActions = null]
D --> F{resolveQuickAction}
E --> F
F --> G{gitStatus null?}
G -->|Yes| H[Show unavailable hint]
G -->|No| I{isBusy?}
I -->|Yes| J[Show busy hint]
I -->|No| K{hasBranch?}
K -->|No| L[Show branch hint]
K -->|Yes| M{hasChanges?}
M -->|Yes| N[Return commit action]
M -->|No| O{isDiverged?}
O -->|Yes| P[Show sync disabled hint]
O -->|No| Q{isBehind?}
Q -->|Yes| R[Return pull action]
Q -->|No| S{isAhead?}
S -->|Yes| T[Return push/PR action]
S -->|No| U[Show up-to-date hint]
Last reviewed commit: 92b0dca |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, 2 comments
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| {gitStatusForActions && | ||
| gitStatusForActions.branch !== null && | ||
| !gitStatusForActions.hasWorkingTreeChanges && | ||
| gitStatusForActions.behindCount > 0 && | ||
| gitStatusForActions.aheadCount === 0 && ( |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a clearer message for diverged branches here instead of only showing "Behind upstream" for non-diverged cases. Users might be confused why the warning disappears when they make local commits on an already-behind branch.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Additional Comments (1)
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
apps/web/src/components/GitActionsControl.tsx (1)
188-346:⚠️ Potential issue | 🟠 MajorBlock actions while git status is out-of-sync.
IfgitStatusForActionsis null (out-of-sync), an already-open dialog can still execute actions, which bypasses the new gating and can skip default-branch confirmation. Add a guard to prevent running actions until the status is synchronized.🛡️ Suggested guard to enforce out-of-sync gating
}) => { + if (isGitStatusOutOfSync || !gitStatusForActions) { + toastManager.add({ + type: "info", + title: "Refreshing git status...", + description: "Please retry once the status is synchronized.", + }); + return; + } const confirmed = await maybeConfirmPushToDefaultBranch(action); if (!confirmed) return; onConfirmed?.(); @@ [ api, + isGitStatusOutOfSync, gitStatusForActions?.branch, gitStatusForActions?.hasWorkingTreeChanges, gitStatusForActions?.openPr?.url,
Sorry, something went wrong.
There was an error while loading. Please reload this page.
- Disable the quick sync action when local and upstream branches have diverged - Treat mismatched branch/status data as out-of-sync and refresh before enabling actions - Update GitActionsControl logic tests for diverged branch behavior Co-authored-by: codex <[email protected]>
Co-authored-by: codex <[email protected]>
26c2e84 to
724ecbe
Compare
| !requiresDefaultBranchConfirmation(action, isDefaultBranch) || | ||
| !gitStatusForActions?.branch | ||
| ) { | ||
| return true; |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
🟢 Low
components/GitActionsControl.tsx:202 When gitStatusForActions is null (during sync), maybeConfirmPushToDefaultBranch returns true immediately, bypassing the confirmation prompt. Consider returning false when gitStatusForActions?.branch is falsy to block the action until status is available.
| return true; | |
| return false; |
🚀 Want me to fix this? Reply ex: "fix it for me".
In file apps/web/src/components/GitActionsControl.tsx around line 202:
When `gitStatusForActions` is `null` (during sync), `maybeConfirmPushToDefaultBranch` returns `true` immediately, bypassing the confirmation prompt. Consider returning `false` when `gitStatusForActions?.branch` is falsy to block the action until status is available.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Port upstream commits ac3f22c..268016d: - Inline branch picker filtering and drop PR-only shortcut (pingdotgg#46) - Fix PR thread upstream tracking for fork branches (pingdotgg#47) Removes filterBranchPickerItems shared function in favor of inline filtering, adds URL-derived fork identity resolution, ensures upstream tracking is restored on local checkouts and reused worktrees, and simulates real git checkout in fake GH CLI for integration tests.
…ments it Design for task pingdotgg#47, written now so the implementing lane gets a contract rather than a paragraph. The one decision worth recording: a command frame is FLAT, not nested. The protocol already documents an inbound-flat / outbound-nested asymmetry, and the stated reason is that an inbound frame describes one editor's own state while an outbound frame carries a set of editors each needing a key. A command is addressed to exactly one editor, so the same rule makes it flat. That asymmetry has already caused one wrong implementation that failed SILENTLY -- the parser just dropped the frame while the connection looked healthy -- so getting it right up front is worth a spec. Capability advertisement is required rather than optional, because the engines genuinely differ: frame-step exists only on Unity through supported APIs. The toolbar must not offer what an engine cannot do, and a hello without capabilities defaults to play+stop so older plugins keep working. Two rules that are easy to get backwards, both written down: - A failed command is an in-band result, NOT a close code. The close-code set is a named set (4400/4401 = stop retrying), not a threshold, so closing a socket because Play failed would disconnect an engine over a recoverable error. - Presence is a level; commands are edges. A Play queued while an editor was disconnected must not fire on reconnect -- the user's intent is stale by then. Also records that pingdotgg#46 (authorization) gates this: the route authenticates but does not authorize, and sits outside the compile-time net that would catch that. No-scope-check on a read-only feed is a low-stakes bug; on a channel that makes an editor execute code it is not.
Each bot listed once, as a law
…igrations and re-run their index slots' (pingdotgg#47) from T3CODE-34-retire-rerun-migrations into custom-local
…ware URL escaping - emitToolBundle passes the selected root's manifest.json to compileLinked, so import validation and runtime-CSS dedupe use the runtime that readRuntimePin pinned. - stripNetworkUrls escapes http(s):// by context: / only in <script> bodies, \/ in <style> bodies, &pingdotgg#47; in HTML text and attributes (was: / everywhere, which corrupted <title> text). - Tests for both (fail on the previous code, pass now). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…trl+S sidebar, Ctrl+H/L panes) and left-hand Grow keys' (pingdotgg#47) from feat/grow-keys-left-hand into yu-v2
…ments Port the LAN and SSH connection work from scriptedalchemy/main (pingdotgg#21, pingdotgg#44, pingdotgg#47, pingdotgg#59, pingdotgg#60, pingdotgg#79, pingdotgg#88, plus later fixes to those files): - Servers advertise `_t3code._tcp` over mDNS and answer a LAN discovery proof; desktop (bonjour-service) and mobile (new t3-lan-discovery Expo module) rediscover paired machines whose address changed. - A device paired over HTTPS or Tailscale mints a DPoP-bound LAN credential that cannot outlive or outrank its paired session. - The server reports its mDNS `.local` name as a LAN endpoint. - Peer links accept ssh://user@host and run over a managed SSH tunnel that leaves the remote server running on disconnect. - SSH remote setup reuses an exact-release installed CLI behind bounded probes, binds the forward to loopback, only reuses a live tunnel, and refuses to replace an installed-but-stopped background service. Adaptations for upstream: PeerLinks exposes one shared `layerWithSsh`, also used by the orchestration runtime layer; upstream's release-mirror download path and its download error text are kept; inference-host address resolution and other fork-only features are left out. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.