Skip to content

fix(wework): Windows plugin flicker, dev:windows dws, and PowerShell unzip - #2301

Merged
qdaxb merged 2 commits into
wecode-ai:mainfrom
sdadunderscoresdad:fix/wework-windows-plugin-flicker
Jul 29, 2026
Merged

qdaxb merged 2 commits into
wecode-ai:mainfrom
sdadunderscoresdad:fix/wework-windows-plugin-flicker

Conversation

@sdadunderscoresdad

@sdadunderscoresdad sdadunderscoresdad commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Fix continuous flicker when opening the plugin interface on Windows by aligning the custom Windows titlebar drag region with the workbench titlebar pattern (full-bar drag region with absolute-positioned controls) and disabling nested drag regions in DesktopTopBar on Windows.
  • Prepare the DWS sidecar in dev:windows before launching Tauri dev, matching the macOS dev script behavior.
  • Use Windows built-in tar for DWS zip extraction instead of PowerShell Expand-Archive, which can fail when the Microsoft.PowerShell.Archive module is not loadable.

Test plan

  • Windows: open /plugins and verify the page no longer flickers continuously
  • Windows: run pnpm --filter wework dev:windows and confirm the DWS sidecar is extracted successfully
  • macOS/Linux: confirm plugin page and workbench titlebar remain visually and functionally unchanged
  • CI: wework unit tests and lint pass

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Improved Windows desktop titlebar behavior and positioning.
    • Windows now uses a custom titlebar without conflicting drag regions.
    • Development startup now prepares the required DWS sidecar automatically.
  • Bug Fixes

    • Improved cross-platform extraction of DWS binaries, including Windows archive handling.
  • Tests

    • Added coverage to verify Windows drag-region behavior.

jiaqi62 and others added 2 commits July 29, 2026 17:02
…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>
@coderabbitai

coderabbitai Bot commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Windows 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.

Changes

Windows development workflow

Layer / File(s) Summary
DWS sidecar preparation and extraction
wework/scripts/dev-windows-app.mjs, wework/scripts/prepare-dws-binary.mjs
The Windows launcher invokes prepare:dws for the selected Tauri target. Archive extraction now selects tar or unzip based on platform and archive type while preserving target mapping behavior.

Windows titlebar UI

Layer / File(s) Summary
Windows drag-region and titlebar layout
wework/src/components/layout/DesktopTopBar.tsx, wework/src/components/layout/DesktopWindowsTitlebar.tsx, wework/src/components/layout/DesktopTopBar.test.tsx
The desktop drag region is hidden on Windows, titlebar content uses absolute positioning with explicit Tauri drag-region attributes, and the Windows behavior is tested.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: micro66

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title captures the main Windows fixes: plugin flicker, dev:windows DWS prep, and archive extraction changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
wework/src/components/layout/DesktopWindowsTitlebar.tsx (1)

34-42: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add regression assertions for the drag-region contract.

The supplied Windows titlebar coverage checks layout geometry, but not the outer data-tauri-drag-region or either data-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 the false opt-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

📥 Commits

Reviewing files that changed from the base of the PR and between 9462de3 and 97d605b.

📒 Files selected for processing (5)
  • wework/scripts/dev-windows-app.mjs
  • wework/scripts/prepare-dws-binary.mjs
  • wework/src/components/layout/DesktopTopBar.test.tsx
  • wework/src/components/layout/DesktopTopBar.tsx
  • wework/src/components/layout/DesktopWindowsTitlebar.tsx

Comment on lines +28 to +40
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')

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.

🎯 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

@qdaxb
qdaxb added this pull request to the merge queue Jul 29, 2026
Merged via the queue into wecode-ai:main with commit c91ba16 Jul 29, 2026
35 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jul 31, 2026
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.

2 participants