Skip to content

Move git action progress to toast and stop auto-opening PR pages - #38

Merged
juliusmarminge merged 2 commits into
mainfrom
codething/6c8437ef
Feb 13, 2026
Merged

juliusmarminge merged 2 commits into
mainfrom
codething/6c8437ef

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Feb 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Move git action execution feedback out of the modal into a persistent progress toast.
  • Keep action selection UI available in the modal and close the modal when an action starts.
  • Add toast controls to dismiss progress, view step-level statuses, and open PR links explicitly.
  • Remove server-side gh pr view --web behavior so existing/new PRs are reported but not auto-opened.
  • Update git manager tests to assert PR metadata is returned without invoking pr view.

Testing

  • Updated apps/server/src/gitManager.test.ts:
  • Verifies existing PR flow returns opened_existing metadata and does not call gh pr view.
  • Verifies create PR flow does not call gh pr view after creation.
  • Lint: Not run (not available in provided context).
  • Web UI/manual checks: Not run.

Open with Devin

Summary by CodeRabbit

  • New Features

    • Consolidated Git progress toast showing per-step status, an optional "Open PR" action, and dismiss control for clearer, non-modal progress feedback.
  • Bug Fixes

    • Stopped automatically opening pull requests in the browser after creating or detecting an existing PR.
  • Refactor

    • Streamlined Git action UI and controls to drive progress via the toast instead of modal-specific flows.
  • Tests

    • Updated tests to match the new behavior that no browser-opening occurs for existing or newly created PRs.

- Keep the git action modal in selection mode while actions run in a dismissible progress toast
- Remove automatic `gh pr view --web` calls; only return PR metadata and open links on explicit user action
- Update server/web tests to assert no implicit PR browser open behavior
@macroscopeapp

macroscopeapp Bot commented Feb 13, 2026 •

Copy link
Copy Markdown
Contributor

Move git action progress to a global toast in GitActionsControl and stop auto-opening PR pages by removing GitManager.openPrInBrowser and browser calls

Update web UX to show action progress in a toast with optional Open PR and remove all GitHub CLI browser-opening calls; adjust tests to assert no gh pr view --web usage; clear ELECTRON_RUN_AS_NODE from the electron spawn env in dev-electron.mjs.

📍Where to Start

Start with the git action UI flow in GitActionsControl.tsx, then review PR handling changes in gitManager.ts and corresponding tests in gitManager.test.ts.


Macroscope summarized cfa9fa5.

@coderabbitai

coderabbitai Bot commented Feb 13, 2026 •

Copy link
Copy Markdown

Walkthrough

Removes automatic browser-opening for existing or newly created PRs, updates server git manager and tests accordingly, and refactors the Git actions UI to surface progress via a consolidated toast (with new progress state and messages) instead of inline modal steps.

Changes

Cohort / File(s) Summary
Server git manager & tests
apps/server/src/gitManager.ts, apps/server/src/gitManager.test.ts
Removed side effects that opened PRs in a browser (deleted openPrInBrowser and related calls). Tests updated to expect PR metadata returned without invoking gh pr view/--web.
Web UI — Git actions control
apps/web/src/components/GitActionsControl.tsx
Replaced in-modal step UI with a toast-driven progress flow: added toast visibility/state, step-to-message mapping, per-step progress/status propagation, new open-from-toast and dismiss handlers, and reworked modal option rendering and action controls. Removed some icon imports and moved progress display to a persistent bottom-right toast.
Desktop dev script env
apps/desktop/scripts/dev-electron.mjs
Stop passing ELECTRON_RUN_AS_NODE to child by using a shallow-copied childEnv with that key removed when spawning the child process.

Sequence Diagram(s)

mermaid
sequenceDiagram
autonumber
participant UI as UI (GitActionsControl)
participant Server as Server (gitManager)
participant Git as Git (local repo & gh CLI)
UI->>UI: User selects git action -> runGitAction
UI->>UI: open progress toast, init steps
UI->>Server: request perform action (generate/commit/push/pr)
Server->>Git: perform generate step
Git-->>Server: generate result/status
Server->>Git: perform commit step
Git-->>Server: commit result/status
Server->>Git: perform push step
Git-->>Server: push result/status
Server->>Git: check/create PR (no browser open)
Git-->>Server: return PR metadata
Server-->>UI: return aggregated progress/result + PR metadata
UI->>UI: update toast status/message; show Open PR button if URL present

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main changes: moving git action progress to a toast UI and removing auto-opening of PR pages.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codething/6c8437ef

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Feb 13, 2026

Copy link
Copy Markdown

Greptile Overview

Greptile Summary

Refactored git action UX to show progress in a persistent toast instead of blocking the modal, and removed automatic browser opening of PR pages. The modal now closes immediately when an action starts, displaying real-time progress in a fixed toast that allows users to explicitly choose to open PR links. Server-side openPrInBrowser method removed to prevent unwanted browser tabs.

Confidence Score: 5/5

  • Safe to merge with no concerns
  • Clean refactoring with comprehensive test coverage updates, straightforward UX improvements, and no breaking changes or security issues
  • No files require special attention

Important Files Changed

Filename Overview
apps/server/src/gitManager.ts Removed openPrInBrowser method and its calls to stop auto-opening PRs in browser
apps/server/src/gitManager.test.ts Updated tests to verify gh pr view is not called after PR operations
apps/web/src/components/GitActionsControl.tsx Refactored to show progress in persistent toast instead of modal, modal now only handles action selection

Sequence Diagram

sequenceDiagram
    participant User
    participant Modal as GitActionsControl Modal
    participant Toast as Progress Toast
    participant Server as GitManager
    participant GH as GitHub CLI

    User->>Modal: Open & select action
    User->>Modal: Click "Continue"
    Modal->>Modal: Close modal
    Modal->>Toast: Show toast with initial steps
    Toast->>Server: runStackedAction()
    
    alt Create/Open PR
        Server->>GH: gh pr list (check existing)
        alt PR exists
            GH-->>Server: Return PR metadata
            Note over Server: Skip gh pr view --web
            Server-->>Toast: Return opened_existing + metadata
        else PR doesn't exist
            Server->>GH: gh pr create
            GH-->>Server: PR created
            Note over Server: Skip gh pr view --web
            Server-->>Toast: Return created + metadata
        end
    end
    
    Toast->>Toast: Update step statuses
    Toast->>User: Show "Open PR" button
    User->>Toast: Click "Open PR" (optional)
    Toast->>GH: Open URL in browser
    User->>Toast: Click "Done"
    Toast->>Toast: Dismiss toast
Loading

Last reviewed commit: f4b1f43

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@apps/web/src/components/GitActionsControl.tsx`:
- Around line 783-798: The Run button is not disabled when the chosen action
option itself is disabled; update the button and the action entrypoint to guard
against disabled selections. Modify the Run button's disabled expression to
include the selected option's disabled flag (e.g.,
selectedGitModalActionOption?.disabled or gitModalSelectedAction?.disabled) in
addition to isGitActionRunning and selection presence, and also add an early
return guard in runGitAction() that checks the selected option's disabled flag
before proceeding so clicks/no-ops can't trigger when an option is disabled.
🧹 Nitpick comments (1)
apps/web/src/components/GitActionsControl.tsx (1)

392-403: Use useTransition for tracking async action pending state instead of manual state management.

Replace isGitModalActionRunning state with useTransition to automatically track the pending state of the async action. This eliminates manual state bookkeeping and leverages React 19's built-in pattern for async operations.

When implementing, note that dismissGitProgressToast will need to be updated to access the pending state from useTransition rather than as a separate state dependency.

♻️ Suggested refactor (partial)
-import { useCallback, useEffect, useMemo, useRef, useState } from "react";
+import { useCallback, useEffect, useMemo, useRef, useState, useTransition } from "react";
...
-const [isGitModalActionRunning, setIsGitModalActionRunning] = useState(false);
+const [isGitModalActionRunning, startGitActionTransition] = useTransition();
...
-const runGitAction = useCallback(async () => {
+const runGitAction = useCallback(() => {
   if (!api || !gitCwd) return;
   if (!selectedGitModalActionOption || selectedGitModalActionOption.disabled) return;
+  startGitActionTransition(async () => {
     ...
-    setIsGitModalActionRunning(true);
     ...
-  } finally {
-    setIsGitModalActionRunning(false);
-    await refreshGitStatus().catch(() => undefined);
-  }
+  } finally {
+    await refreshGitStatus().catch(() => undefined);
+  }
+  });
-}, [api, gitCwd, gitModalCommitMessage, refreshGitStatus, selectedGitModalActionOption]);
+}, [api, gitCwd, gitModalCommitMessage, refreshGitStatus, selectedGitModalActionOption, startGitActionTransition]);

Comment on lines +783 to +798
className="rounded-xl border border-border px-4 py-2 text-sm text-foreground transition-colors duration-150 hover:bg-accent disabled:cursor-not-allowed disabled:opacity-60"
onClick={closeGitActionModal}
disabled={isGitActionRunning}
>
{gitModalResult ? "Done" : "Cancel"}
Cancel
</button>
<button
type="button"
className="rounded-xl bg-foreground px-4 py-2 text-sm font-medium text-background transition-colors duration-150 hover:bg-foreground/90 disabled:cursor-not-allowed disabled:opacity-60"
onClick={() => {
void runGitAction();
}}
disabled={isGitActionRunning || !selectedGitModalActionOption}
>
{runActionLabel(gitModalSelectedAction)}
</button>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Disable “Run” when the selected option is disabled.
Line 795 only disables on running/missing selection, but Line 394 still no-ops when the selected option is disabled, which feels broken.

🐛 Suggested fix
- disabled={isGitActionRunning || !selectedGitModalActionOption}
+ disabled={
+   isGitActionRunning ||
+   !selectedGitModalActionOption ||
+   selectedGitModalActionOption.disabled
+ }
🤖 Prompt for AI Agents
In `@apps/web/src/components/GitActionsControl.tsx` around lines 783 - 798, The
Run button is not disabled when the chosen action option itself is disabled;
update the button and the action entrypoint to guard against disabled
selections. Modify the Run button's disabled expression to include the selected
option's disabled flag (e.g., selectedGitModalActionOption?.disabled or
gitModalSelectedAction?.disabled) in addition to isGitActionRunning and
selection presence, and also add an early return guard in runGitAction() that
checks the selected option's disabled flag before proceeding so clicks/no-ops
can't trigger when an option is disabled.

- Remove `ELECTRON_RUN_AS_NODE` before spawning `electronmon` in desktop dev script
- Replace detailed multi-step Git progress toast with a compact status message + optional Open PR action

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@apps/web/src/components/GitActionsControl.tsx`:
- Around line 311-320: The toast always shows a generic "Git action failed."
even when gitModalError contains the real error; update the logic that builds
gitProgressToastMessage (and optionally gitProgressToastStatus) to surface the
actual error text from gitModalError (e.g., use gitModalError.message or
String(gitModalError)) instead of the hardcoded message; adjust the ternary
around isGitModalActionRunning / gitModalError that references
gitProgressToastMessage and gitProgressToastStatus so openPrFromToast failures
display the real error while preserving running state via
isGitModalActionRunning and using runningStepMessage(activeGitProgressStep?.id
?? "commit") when appropriate.
🧹 Nitpick comments (1)
apps/web/src/components/GitActionsControl.tsx (1)

783-799: Avoid disabled on buttons; use aria-disabled + click guards.

This keeps buttons accessible and avoids tooltip breakage. Consider replacing disabled with aria-disabled and guarding in onClick.

♿ Suggested refactor
-              <button
+              <button
                 type="button"
-                className="rounded-xl border border-border px-4 py-2 text-sm text-foreground transition-colors duration-150 hover:bg-accent disabled:cursor-not-allowed disabled:opacity-60"
-                onClick={closeGitActionModal}
-                disabled={isGitActionRunning}
+                className={`rounded-xl border border-border px-4 py-2 text-sm text-foreground transition-colors duration-150 hover:bg-accent ${
+                  isGitActionRunning ? "cursor-not-allowed opacity-60" : ""
+                }`}
+                aria-disabled={isGitActionRunning}
+                onClick={() => {
+                  if (isGitActionRunning) return;
+                  closeGitActionModal();
+                }}
               >
                 Cancel
               </button>
-              <button
+              <button
                 type="button"
-                className="rounded-xl bg-foreground px-4 py-2 text-sm font-medium text-background transition-colors duration-150 hover:bg-foreground/90 disabled:cursor-not-allowed disabled:opacity-60"
-                onClick={() => {
-                  void runGitAction();
-                }}
-                disabled={isGitActionRunning || !selectedGitModalActionOption}
+                className={`rounded-xl bg-foreground px-4 py-2 text-sm font-medium text-background transition-colors duration-150 hover:bg-foreground/90 ${
+                  isGitActionRunning || !selectedGitModalActionOption ? "cursor-not-allowed opacity-60" : ""
+                }`}
+                aria-disabled={isGitActionRunning || !selectedGitModalActionOption}
+                onClick={() => {
+                  if (isGitActionRunning || !selectedGitModalActionOption) return;
+                  void runGitAction();
+                }}
               >
                 {runActionLabel(gitModalSelectedAction)}
               </button>

Based on learnings: Avoid using disabled props on buttons as they harm accessibility and break tooltips. Instead, use styling (e.g., opacity, hover states) and handle the disabled state through click handlers.

Comment on lines +311 to +320
const gitProgressToastStatus = isGitModalActionRunning
? "running"
: gitModalError
? "failed"
: "done";
const gitProgressToastMessage = isGitModalActionRunning
? runningStepMessage(activeGitProgressStep?.id ?? "commit")
: gitModalError
? "Git action failed."
: "Done.";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Toast error text should surface the actual error.

If openPrFromToast fails, gitModalError is set but the toast always shows “Git action failed.”, which is misleading. Use the actual error message to avoid false failure reporting.

🛠️ Suggested change
-  const gitProgressToastMessage = isGitModalActionRunning
-    ? runningStepMessage(activeGitProgressStep?.id ?? "commit")
-    : gitModalError
-      ? "Git action failed."
-      : "Done.";
+  const gitProgressToastMessage = isGitModalActionRunning
+    ? runningStepMessage(activeGitProgressStep?.id ?? "commit")
+    : gitModalError
+      ? gitModalError
+      : "Done.";
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const gitProgressToastStatus = isGitModalActionRunning
? "running"
: gitModalError
? "failed"
: "done";
const gitProgressToastMessage = isGitModalActionRunning
? runningStepMessage(activeGitProgressStep?.id ?? "commit")
: gitModalError
? "Git action failed."
: "Done.";
const gitProgressToastStatus = isGitModalActionRunning
? "running"
: gitModalError
? "failed"
: "done";
const gitProgressToastMessage = isGitModalActionRunning
? runningStepMessage(activeGitProgressStep?.id ?? "commit")
: gitModalError
? gitModalError
: "Done.";
🤖 Prompt for AI Agents
In `@apps/web/src/components/GitActionsControl.tsx` around lines 311 - 320, The
toast always shows a generic "Git action failed." even when gitModalError
contains the real error; update the logic that builds gitProgressToastMessage
(and optionally gitProgressToastStatus) to surface the actual error text from
gitModalError (e.g., use gitModalError.message or String(gitModalError)) instead
of the hardcoded message; adjust the ternary around isGitModalActionRunning /
gitModalError that references gitProgressToastMessage and gitProgressToastStatus
so openPrFromToast failures display the real error while preserving running
state via isGitModalActionRunning and using
runningStepMessage(activeGitProgressStep?.id ?? "commit") when appropriate.

@juliusmarminge
juliusmarminge merged commit 9e3fa3e into main Feb 13, 2026
3 checks passed
aorwall added a commit to aorwall/t3code that referenced this pull request Aug 6, 2026
`projects.readFile` answers with the path it actually read, which is not
always the path that was asked for: a workspace that keeps its
repositories in subdirectories has no file at the path a mention names,
and the server resolves it into the checkout that does.

The panel kept addressing the file by the path that was clicked, so a
save went to that path instead — creating a stray file at the workspace
root while the file on screen stayed untouched. Move the open surface
onto the resolved path instead, keeping its reveal line and tab
position, and close it when the destination is already open.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
maria-rcks pushed a commit to maria-rcks/t3libre that referenced this pull request Sep 21, 2026
i2cjak referenced this pull request in i2cjak/Backplane Sep 29, 2026
Composer: Up/Down by shown lines, click to place the caret, drag to select
@joeljanson joeljanson mentioned this pull request Oct 7, 2026
longtngo added a commit to longtngo/t3code that referenced this pull request Oct 9, 2026
Range personal f93ae9c + origin/main 6497246, merge base 611132c.
57 conflicts (52 content, 3 modify/delete, 2 rename/delete), 192 upstream renames.

Shape: upstream moved every provider but Codex and Claude into packages
(provider-core/acp/acp-registry/cursor/grok/opencode/pi/muse/testing), drivers read
settings through ProviderHost, and pingdotgg#17300 dropped the legacy providers settings map.

Resolutions:
- Fork-only files re-pointed at moved modules by package specifier (git rename map).
- Legacy providers map: upstream's migration taken; fork patch mirrors and their tests
  (configDirPath, outputStyle, Codex setupMode) removed; trust rule follows upstream's decode.
- Scoped settings: upstream's per-environment failure messages replace the fork's refusal copy.
- Composer: upstream's Compact/Full chip and measured resting padding; fork send/stop row,
  offline-queue label and threadPanelSummary kept; attention dot dropped with upstream.
- Migrations: upstream 059/060 applied as ids 68/69; preview-migration test stays rejected.
- AuthPairingLinks: upstream pingdotgg#16730 fixed the boolean bind itself; fork patch retired.
- ClaudeDriver offer-to-compact setting reads host.settings; tests build on ProviderHostLive.
- OpenCodeRuntime back to upstream's inline encoder; fork diagnosticsJson.ts deleted.
- Find-highlight cases (pingdotgg#10439) split into a jsdom file, as upstream runs them.
- UsageService v4-upgrade test awaits its second persist (temp-dir removal race).

Invariants: all re-probed; pingdotgg#38 caught resolveClaudeCatalogContextWindow losing export again.
Sweeps (mid-merge): resurrected 4, dropped 283, fork-loss 370, both-kept 0; after
filtering relocations, every residual line tied to a resolution (resurrected: 2 lockfile,
2 upstream test lines ported to the fork's fold-aware toggle helper).
Gate: pnpm verify EXIT=0, 23/23 test packages, 25,310 tests, 0 failed (Node 24.16).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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