Skip to content

Keep workspace deletion dialogs steady while changes load - #25321

Merged
nwparker merged 3 commits into
mainfrom
nwparker/moving-target-fix
Oct 4, 2026
Merged

nwparker merged 3 commits into
mainfrom
nwparker/moving-target-fix

Conversation

@nwparker

@nwparker nwparker commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​275 $\color{#cf222e}{\Huge{\mathbf{−}}}$​9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​266
Prod 9 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​229 $\color{#cf222e}{\Huge{\mathbf{−}}}$​99 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​130

ELI5

The Delete button stays where you first saw it, even when workspace checks finish.

What Changed

Previously, late change counts inserted red text and repeated warning paragraphs, resizing the dialog. Opening changed paths grew it again.

Each Git workspace now has a fixed-height status line from the first render. The row matches the surrounding text height, with a small gap above it. The permanent-loss warning appears once in the dialog description. Changed paths open in a bounded popover; Escape returns to the confirmation. Pending, clean, and failed checks have distinct labels. An existing dirty warning survives a failed check and keeps the detail-loading or unavailable state visible beside it.

The existing status loader now retains failed results. Counts, previews, and check states read the same host-scoped snapshot, including hydrated results for older targets without an explicit host.

Why

Reserving the status space keeps both content and destructive actions stationary. Animating the old height changes would still move the button; waiting for every workspace would delay the dialog on remote hosts.

Linked Issue

Reported directly; no linked issue.

Visual Proof

Current compact layout: status rows are one text line high with a 2px gap above them. The 31-child case is 54px shorter than the earlier version. Frame checks confirm the dialog, rows, Delete button, and keyboard focus remain steady as results arrive.

Compact dialog Changed paths open
Compact dialog in dark mode Changed paths in dark mode

Light mode:

Compact dialog in light mode

Known-dirty recovery also stays on one line:

Checking details Details unavailable
Known-dirty workspace checking details Known-dirty workspace with unavailable details
Before and after the spacing refinement, at the same viewport size
Previous spacing Compact spacing
Previous spacing Compact spacing

Testing

  • Rendered UI inspected locally via Playwright CDP in hidden Electron windows on macOS, in light and dark themes.
  • Automated tests added/updated.

Passed:

  • pnpm tc
  • pnpm run check:code-quality:changed, including the design-system gate
  • 36 focused sidebar unit tests, covering host isolation, failed checks, stale responses, folder/main-workspace exclusions, cached dirty warnings, and path previews
  • pnpm run verify:localization-catalogs and pnpm run verify:localization-extraction
  • Electron build in e2e mode
  • Rendered frame checks for single, batch, 31-child, and known-dirty recovery dialogs; batch also exercises reduced motion

To repeat the rendered regression tests after an e2e build:

ORCA_BACKGROUND_LAUNCH=1 SKIP_BUILD=1 pnpm exec playwright test tests/e2e/worktree-delete-dialog-layout.spec.ts --config tests/playwright.config.ts --project electron-headless --workers=1 --repeat-each=3

Review

Self-reviewed. Folder workspaces retain their existing behavior and do not receive Git deletion warnings. A failed remote check cannot borrow another host's status or claim the workspace is clean.

Agent skill upstream boundary

  • Not applicable; no upstream skill source or resources copied.

Notes

Host routing, deletion behavior, and remote messages are unchanged. Remote latency and failures were simulated; real SSH hosts, Linux, and Windows were not run locally. CI covers the broader lint, test, and release-build checks.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Before/after screenshots and a passing video attached
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • Full pnpm lint, pnpm test, and release build: CI; focused local checks above passed

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 54d2517c-b9eb-4b71-aeed-6f814d0f006e
📥 Commits

Reviewing files that changed from the base of the PR and between 9c1a338 and 67b7ee7.

📒 Files selected for processing (6)
  • src/renderer/src/components/sidebar/DeleteWorktreeDirtyChangeHint.tsx
  • src/renderer/src/components/sidebar/DeleteWorktreeTargetPreview.test.tsx
  • src/renderer/src/components/sidebar/delete-worktree-dirty-change-hydration.test.tsx
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • tests/e2e/worktree-delete-dialog-layout.spec.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/renderer/src/components/sidebar/DeleteWorktreeTargetPreview.test.tsx
  • src/renderer/src/components/sidebar/DeleteWorktreeDirtyChangeHint.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

The deletion dialog now distinguishes checking, complete, and unavailable Git status results. It passes check states to target previews and lineage notices, displays dirty-change information and loaded paths, and conditionally shows a warning about permanent deletion of uncommitted or untracked changes. The changes also add unit and end-to-end coverage for status outcomes and dialog layout.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 67b7e

The deletion dialog distinguishes pending, completed, and unavailable change checks while keeping its destructive action steady. No actionable merge risk is established beyond normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 67b7e

The examined changes retain host-specific status handling and preserve known dirty-workspace warnings after failed checks. No introduced security issue was demonstrated, but incomplete baseline and missing-owner routing evidence limits confidence.

Retained concerns
No architecture-level concerns identified.

Security review details

Trust Boundaries and Controls

  • observed — The hint renders supplied status and path data without invoking deletion. Status acquisition crosses existing renderer IPC or runtime RPC interfaces. For a host-qualified target whose repository owner cannot be found, hydration can pass an undefined connection ID; the inspected renderer code does not establish how the downstream IPC handler treats that case.
🚥 Pre-merge checks | ✅ 4 | ❌ 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 12 files. (2 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: keeping workspace deletion dialogs stable while status checks load.
Description check ✅ Passed The description explains the user-facing change, its purpose, implementation, testing, visual proof, and compatibility considerations. It states that no issue is linked; the template requires an issue…
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 12 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The localization catalogs were not regenerated. Both verify:localization-catalogs and verify:localization-extraction fail on this branch — see the inline comment for the exact keys and the two sync commands needed before merge.

Reviewed changes

  • Fixed-height status line — DeleteWorktreeDirtyChangeHint now reserves an h-6 row for checking / clean / unavailable and for the dirty warning, so the row no longer resizes.
  • Popover for changed paths — the inline Collapsible list is replaced by a portaled Popover, so opening details no longer grows the dialog.
  • Single dialog-level warning — the repeated per-workspace warning moved into DeleteWorktreeDialogDescription, gated by checkStates.size > 0.
  • Host-scoped check states — new getDeleteWorktreeChangeCheckStates plus a null-on-failure hydration result drive the checking / complete / unavailable labels.
  • Shared status lookup — getStatusEntries unifies hostless fallback to the hydrated identity map and is reused by counts and previews.
  • Tests — new e2e geometry spec plus unit coverage for check states and hydration/preview behavior.

ℹ️ Nitpicks

  • DeleteWorktreeTargetPreview.test.tsx:222 — the title "expands each qualified batch target independently" now contradicts the assertions: opening the runtime popover closes the local one (line 256). Consider renaming to reflect the single-open-at-a-time behavior.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for 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 GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Keep the status state visible with the dirty warning. · DeleteWorktreeDirtyChangeHint.tsx:43-61

src/renderer/src/components/sidebar/DeleteWorktreeDirtyChangeHint.tsx:43-61
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Keep the status state visible with the dirty warning.

When a missing or null status snapshot leaves checkState as checking or unavailable, the dirty fallback supplies changeCount as 0, and the hint takes its numeric-count branch instead of showing that state. The generic dirty warning is accurate, not a fabricated count. But when no preview files are available, the hint offers no path-level preview and does not tell the user that status details are unavailable. Keep the checking or unavailable state visible alongside the warning.


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 84ee0d60-5a98-4f88-a41a-a410b92a052a
📥 Commits

Reviewing files that changed from the base of the PR and between fab7c6f and 9c1a338.

📒 Files selected for processing (3)
  • src/renderer/src/components/sidebar/DeleteWorktreeDialogDescription.tsx
  • src/renderer/src/components/sidebar/DeleteWorktreeDirtyChangeHint.tsx
  • tests/e2e/worktree-delete-dialog-layout.spec.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/renderer/src/components/sidebar/DeleteWorktreeDialogDescription.tsx
  • src/renderer/src/components/sidebar/DeleteWorktreeDirtyChangeHint.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Important

The spacing refinement itself is clean — no new issues. The localization-catalog blocker raised in the previous review is still open: verify:localization-catalogs still exits 1 at 9c1a338, since no locale file was touched.

Reviewed changes (since fab7c6f0dc)

  • Tighter row spacing — DeleteWorktreeDialogDescription warning mt-2→mt-1; the status/dirty rows and the popover trigger in DeleteWorktreeDirtyChangeHint mt-1 h-6→mt-0.5 h-4. Heights stay equal across checking / clean / unavailable / dirty, so the dialog and button remain stationary.
  • e2e artifacts — added dialog.screenshot captures for the checking, loaded, and details states; assertions unchanged.

Pullfrog  | Fix it ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker requested a review from brennanb2025 as a code owner October 4, 2026 23:25
@nwparker

nwparker commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the review findings in 67b7ee7:

  • Regenerated the localization catalogs; both localization verification commands pass.
  • Kept Checking… / Details unavailable visible beside an existing dirty warning, on the same compact line. Added a regression test and a rendered frame check for this recovery case.
  • Renamed the host-preview test to describe closing the previous preview when another host is selected.

Typechecking, changed-code quality/design-system checks, the Electron build, 36 focused unit tests, and all four rendered dialog checks pass locally. Updated screenshots are in the PR description. Waiting for the fresh CI run before merging.

The advisory docstring suggestion is intentionally omitted: AGENTS.md requires concise comments only for non-obvious reasoning, and these functions already have descriptive names.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

Reviewed the delta since the prior pullfrog review (9c1a338), i.e. commit 67b7ee75aa.

  • Added compact · Checking… / · Details unavailable detail-state labels beside a known-dirty warning when no path preview has loaded.
  • Regenerated the localization catalogs: the six components.workspace.delete.changes.* keys are now in en.json, and en-runtime-required.json was re-synced.
  • Added a known-dirty e2e geometry scenario plus a unit test covering the pending-to-failed detail transition.
  • Renamed the batch-preview test title to match the single-open-at-a-time popover behavior.

Verified this run: all three localization gates exit 0 (verify:localization-catalogs, verify:localization-extraction, generate-runtime-required-english-catalog.mjs), pnpm tc:web exits 0, and the 36 focused sidebar unit tests pass.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@nwparker
nwparker merged commit 955dce5 into main Oct 4, 2026
37 checks passed
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