Skip to content

fix(wework): let app shell follow viewport - #2573

Merged
qdaxb merged 2 commits into
mainfrom
fix/wework-resize-viewport
Aug 11, 2026
Merged

qdaxb merged 2 commits into
mainfrom
fix/wework-resize-viewport

Conversation

@qdaxb

@qdaxb qdaxb commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • removed the asynchronous Tauri innerSize / scaleFactor synchronization from the React app shell
  • let the Tauri app shell fill the WebView exclusively through fixed inset-0
  • replaced the obsolete native-size race test with an app-shell regression assertion that forbids inline width and height
  • documented the WebView viewport ownership rule in the Chinese and English macOS developer guides

Root cause

The app shell had two competing size sources. CSS already pinned it to the WebView viewport, while useTauriViewportSize asynchronously converted native resize events and wrote explicit inline dimensions. A stale native conversion could override the current CSS viewport after a resize, leaving part of the window unfilled.

Impact

The Wework main surface now follows every WebView resize synchronously and cannot retain an older native width or height. Native window dimensions remain limited to window creation, restoration, and system-level window management.

Validation

  • pnpm --filter wework test src/App.plugins.test.tsx — 27 tests passed
  • pnpm --filter wework exec prettier --check src/App.tsx src/App.plugins.test.tsx
  • pnpm --filter wework exec eslint src/App.tsx src/App.plugins.test.tsx
  • pnpm --filter wework typecheck
  • pnpm --filter wework build
  • pre-push ESLint, TypeScript, and complete unit-test checks
  • isolated real Tauri verification across 1280x720 -> 1920x966 -> 1280x720 -> 1920x966; the app shell matched the viewport bounds after every resize

Summary by CodeRabbit

  • Bug Fixes

    • Improved layout stability by allowing the interface to fill the available window through responsive viewport styling.
    • Prevented asynchronous resizing and scaling from causing incorrect or stale layout dimensions.
    • Ensured collapsed app views maintain a fixed, full-viewport presentation.
    • Improved embedded browser positioning on Linux for reliable sizing and placement.
  • Documentation

    • Added guidance on window surfaces, responsive layouts, native window sizing, and Linux embedded browser hosting.

@qdaxb
qdaxb enabled auto-merge August 11, 2026 06:07
@coderabbitai

coderabbitai Bot commented Aug 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 772171e8-ac4a-4ccb-be46-e4ad88dc6235

📥 Commits

Reviewing files that changed from the base of the PR and between cce0d95 and ea95899.

📒 Files selected for processing (4)
  • docs/en/wework/developer-guide/wework-macos-release.md
  • docs/zh/wework/developer-guide/wework-macos-release.md
  • wework/src-tauri/src/embedded_browser.rs
  • wework/src-tauri/src/embedded_browser/linux_host.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/en/wework/developer-guide/wework-macos-release.md

📝 Walkthrough

Walkthrough

The React app shell no longer derives layout dimensions from Tauri viewport events. Linux embedded WebViews now use a GTK overlay and fixed-position host. Tests and release guides document the updated window-surface constraints.

Changes

Window surface layout

Layer / File(s) Summary
CSS shell contract
wework/src/App.tsx, wework/src/hooks/useTauriViewportSize.ts, wework/src/App.viewport.test.tsx, wework/src/App.plugins.test.tsx, docs/en/wework/developer-guide/wework-macos-release.md, docs/zh/wework/developer-guide/wework-macos-release.md
Removed the Tauri viewport hook, viewport attributes, and inline dimensions. The viewport hook and its tests were deleted. The plugin-route test and release guides use CSS viewport sizing requirements.
Linux embedded WebView host
wework/src-tauri/src/embedded_browser.rs, wework/src-tauri/src/embedded_browser/linux_host.rs
Added GTK overlay and fixed-host placement for Linux embedded WebViews. New WebViews apply bounds after creation and close with an error when placement fails.

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

Sequence Diagram(s)

sequenceDiagram
  participant OpenCommand
  participant EmbeddedBrowser
  participant LinuxHost
  participant GTKContainer
  OpenCommand->>EmbeddedBrowser: create embedded WebView
  EmbeddedBrowser->>LinuxHost: apply_bounds(position, size)
  LinuxHost->>GTKContainer: find or create fixed host
  GTKContainer-->>LinuxHost: place WebView at logical bounds
  LinuxHost-->>EmbeddedBrowser: return placement result
  EmbeddedBrowser-->>OpenCommand: close and return error on failure
Loading

Possibly related PRs

🚥 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 clearly summarizes the main change: the Wework app shell now follows the WebView viewport.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wework-resize-viewport

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.

@qdaxb
qdaxb added this pull request to the merge queue Aug 11, 2026
@qdaxb
qdaxb removed this pull request from the merge queue due to a manual request Aug 11, 2026
@qdaxb
qdaxb merged commit 62f0924 into main Aug 11, 2026
49 checks passed
@qdaxb
qdaxb deleted the fix/wework-resize-viewport branch August 11, 2026 07:00
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