Repository navigation
fix(wework): Windows plugin flicker, dev:windows dws, and PowerShell unzip - #2301
Conversation
…unzip - Align DesktopWindowsTitlebar drag region with the workbench titlebar by making the whole bar draggable with absolute-positioned controls. - Hide DesktopTopBar drag region on Windows to avoid nested drag regions conflicting with the custom titlebar. - Prepare DWS sidecar in dev:windows before launching Tauri dev. - Use PowerShell Expand-Archive for DWS zip extraction on Windows. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
PowerShell Expand-Archive requires the Microsoft.PowerShell.Archive module, which is not loadable in some environments. Use the built-in Windows tar (bsdtar) instead, which supports zip archives. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
📝 WalkthroughWalkthroughWindows development now prepares the DWS sidecar and extracts archives with Windows-compatible commands. Windows titlebar components update drag-region handling and reposition titlebar content and controls, with added coverage for hidden drag regions. ChangesWindows development workflow
Windows titlebar UI
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
wework/src/components/layout/DesktopWindowsTitlebar.tsx (1)
34-42: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd regression assertions for the drag-region contract.
The supplied Windows titlebar coverage checks layout geometry, but not the outer
data-tauri-drag-regionor eitherdata-tauri-drag-region="false"opt-out. Assert these attributes in the Windows titlebar test so a refactor cannot make the controls draggable or reintroduce flicker. Tauri 2.11.0 documents thefalseopt-out behavior. (v2.tauri.app)Also applies to: 52-55
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@wework/src/components/layout/DesktopWindowsTitlebar.tsx` around lines 34 - 42, Update the Windows titlebar test for DesktopWindowsTitlebar to assert that the outer titlebar has data-tauri-drag-region and that both interactive control containers have data-tauri-drag-region="false". Preserve the existing geometry assertions while covering the drag-region opt-out contract for the controls.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@wework/src/components/layout/DesktopTopBar.test.tsx`:
- Around line 28-40: Restore the shared navigator.userAgent after the
Windows-specific test in DesktopTopBar.test.tsx. Capture its original value
before mutation and ensure cleanup via afterEach or try/finally, while
preserving the existing assertion; then run the focused Wework tests and
required formatting/lint checks.
---
Nitpick comments:
In `@wework/src/components/layout/DesktopWindowsTitlebar.tsx`:
- Around line 34-42: Update the Windows titlebar test for DesktopWindowsTitlebar
to assert that the outer titlebar has data-tauri-drag-region and that both
interactive control containers have data-tauri-drag-region="false". Preserve the
existing geometry assertions while covering the drag-region opt-out contract for
the controls.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e83e8492-90eb-4c3c-a4d5-7b44546bbdab
📒 Files selected for processing (5)
wework/scripts/dev-windows-app.mjswework/scripts/prepare-dws-binary.mjswework/src/components/layout/DesktopTopBar.test.tsxwework/src/components/layout/DesktopTopBar.tsxwework/src/components/layout/DesktopWindowsTitlebar.tsx
| test('hides the drag region on Windows to avoid conflicting with the custom titlebar', () => { | ||
| Object.defineProperty(navigator, 'userAgent', { | ||
| configurable: true, | ||
| value: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)', | ||
| }) | ||
| render( | ||
| <DesktopTopBar | ||
| left={<button type="button">Left</button>} | ||
| right={<button type="button">Right</button>} | ||
| /> | ||
| ) | ||
|
|
||
| expect(screen.getByTestId('desktop-topbar-drag-region')).toHaveClass('hidden') |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Restore navigator.userAgent after the test.
This mutates shared test-environment state and can cause later tests to run as Windows, unexpectedly hiding the drag region. Capture the original value and restore it with afterEach or try/finally.
As per coding guidelines, run the focused Wework tests and required formatting/lint checks before committing.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@wework/src/components/layout/DesktopTopBar.test.tsx` around lines 28 - 40,
Restore the shared navigator.userAgent after the Windows-specific test in
DesktopTopBar.test.tsx. Capture its original value before mutation and ensure
cleanup via afterEach or try/finally, while preserving the existing assertion;
then run the focused Wework tests and required formatting/lint checks.
Source: Coding guidelines
Summary
DesktopTopBaron Windows.dev:windowsbefore launching Tauri dev, matching the macOS dev script behavior.tarfor DWS zip extraction instead of PowerShellExpand-Archive, which can fail when theMicrosoft.PowerShell.Archivemodule is not loadable.Test plan
/pluginsand verify the page no longer flickers continuouslypnpm --filter wework dev:windowsand confirm the DWS sidecar is extracted successfully🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Tests