Skip to content

fix: allow resizing maximized internal windows - #589

Merged
pedronauck merged 3 commits into
mainfrom
fix/issue-585-window-resize
Sep 10, 2026
Merged

pedronauck merged 3 commits into
mainfrom
fix/issue-585-window-resize

Conversation

@pedronauck

@pedronauck pedronauck commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Problem and root cause

Closes #585.

Internal windows became impossible to resize after maximizing. Zoom structurally places the window into its own full-size tiled island, even when it started floating; the saved return anchor is separate from the active resize zone. The daemon already supports ending zoom atomically through window.resize, and window.zoom already saves/restores the original placement, but the shared frontend disabled access to that behavior twice: group-projection.ts replaced every zoomed frame's resizable edges with false, and OsWindow independently disabled react-rnd resizing whenever frame.zoomed was true. The zoom control also kept an empty glyph and the label “Zoom window” when its action was actually restore.

Resulting behavior

  • A maximized internal window exposes its border and corner resize handles. Releasing a resize uses the existing window.resize command, ends zoom, and persists the resized tiled zone on the current desktop.
  • The zoom button displays maximize/restore icons, a state-specific accessible name, and a native tooltip. “Restore window” invokes the existing zoom toggle and returns the saved floating geometry or tiled slot; resizing deliberately adopts a new zone instead.
  • Existing app minimum sizes, tiled obstacle limits, compact presentation, revision checks, and rollback behavior remain in the existing resize path. Title-bar dragging while maximized still requires restoring first.
  • Web and Electron use these same frontend components. This concerns internal windows, not native application/browser fullscreen.

Verification

  • Reproduced the disabled-edge regression in the existing projection suite before repairing production code: all four expected resize edges were false.
  • Repository-root bunx turbo run test --filter=./web -- ... passed the four affected projection/window/frame/zoom-menu suites: 32 tests.
  • Repository-root bunx turbo run build --filter=./web passed, including Web typecheck.
  • Real daemon-served Chromium E2E, with a binary built from this worktree and isolated homes/ports/sockets:
    • Existing E2E-003: lifted zoom and exact tiled-anchor restoration passed.
    • Existing E2E-137: grouping into a zoomed frame and restoring the split passed.
    • New regression in the existing os-shell.spec.ts: two floating maximize/restore cycles; southeast-corner and west-edge resizing during zoom; subsequent maximize/restore/reload cycles; persisted geometry and unchanged peer-window records. Passed in 5.1s, including exact normalized x/y/width/height derived from the pointer deltas on Tasks' own tiled group.
  • The runtime fixtures completed teardown. The host daemon was not restarted or changed.
  • make gate: passed; Web lane reports 771 files / 7,117 tests passed, with lint reporting 0 warnings / 0 errors. make gate-status confirms js-web is CURRENT-PASS after commit.
  • Reviewed the complete changed diff and checked formatting/whitespace.

Local E2E commands used the repository's installed Playwright CLI with --config web/playwright.config.ts os-shell.spec.ts --grep ..., under the shared machine lock and with COMPOZY_TEST_DAEMON_BIN pointing at the worktree binary. The test subprocess omitted the host-inherited COMPOZY_INTERNAL_RESTART_OPERATION_ID; otherwise its fresh isolated database cannot resolve that host restart operation. Initial test setup also needed to bring Tasks forward via the dock and wait for desktop animation stability before dragging. No production failures or assertions were suppressed.

Cross-surface and compatibility impact

Audit follows docs/_memory/change-impact.md:

  • Native tools / CLI / HTTP / UDS: no IDs, schemas, descriptors, capability gates, or commands changed. The Web resize gesture now reaches the already-supported window.resize; restoring still uses window.zoom.
  • Extensibility / hooks / config: no extensions, hooks, resources, SDKs, or configuration keys changed. Existing semantic command dispatch and events remain authoritative.
  • Workspace/profile isolation and user state: no storage/schema changes or migrations. Existing workspace/profile-scoped command transport and daemon persistence own geometry. E2E checks that a peer window is unchanged and that resized geometry survives reload. Existing return anchors and structural zoom semantics remain intact.
  • Official Compozy skill: its existing window-management contract already documents resizing as ending zoom in place and unzoom as restoring the return anchor; no tool/runtime instruction change is needed.
  • Web / Docs: updated shared window projection/chrome, the existing E2E and component suites, window-management user documentation, canonical Zoom/Restore wording in COPY.md, and both affected QA scenarios. No public compatibility removal or internal consumer was left behind.

Limits

Linux and Electron were not run locally; local real-run evidence is macOS with Chromium against the shared Web bundle. The Web build emits pre-existing CSS ::highlight and large-chunk warnings outside this change. React Doctor reports one maintainability warning on the existing OsWindow control-flow complexity (93/100); this patch removes one condition from that function and introduces no new branching there. Required PR CI is tracked on this PR; local build/test diagnostic output outside the changed behavior was not suppressed.

@vercel

vercel Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
compozy-site Ready Ready Preview Sep 10, 2026 4:16pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 6ac02305-6365-481e-bfca-1925d31858df

📥 Commits

Reviewing files that changed from the base of the PR and between e76cb83 and 2b61dcf.

⛔ Files ignored due to path filters (4)
  • docs/qa/scenarios/ET-window-manager-layout-gestures.md is excluded by !**/*.md
  • docs/qa/scenarios/ET-window-zoom-in-place.md is excluded by !**/*.md
  • packages/site/content/docs/workspaces/window-management.mdx is excluded by !**/*.mdx
  • web/e2e/__tests__/os-shell.spec.ts is excluded by !web/e2e/**
📒 Files selected for processing (6)
  • web/src/systems/os/components/__tests__/os-window-frame.test.tsx
  • web/src/systems/os/components/__tests__/os-window.test.tsx
  • web/src/systems/os/components/os-traffic-lights.tsx
  • web/src/systems/os/components/os-window.tsx
  • web/src/systems/os/lib/__tests__/group-projection.test.ts
  • web/src/systems/os/lib/group-projection.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

Zoomed internal windows are now resizable on all edges. Resizing ends zoom. The zoom control displays a restore label, icon, title, and pressed state. Tests verify both behaviors.

Changes

Zoomed window behavior

Layer / File(s) Summary
Resize zoomed windows
web/src/systems/os/lib/group-projection.ts, web/src/systems/os/components/os-window.tsx, web/src/systems/os/lib/__tests__/group-projection.test.ts
Zoomed frames now support resizing on all edges. Dragging remains disabled until the window is restored. Resizing commits a new zone and ends zoom.
Restore control semantics
web/src/systems/os/components/os-traffic-lights.tsx, web/src/systems/os/components/__tests__/os-window-frame.test.tsx, web/src/systems/os/components/__tests__/os-window.test.tsx
The zoom control uses the “Restore window” label and minimize icon when pressed. Its accessible name, title, and aria-pressed state reflect the zoomed state.

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 2b61d

Maximized internal windows can now be resized and restored with matching controls and accessibility state. The supplied tests and verification are consistent with the intended behavior, so this change is mergeable.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy issue #585. Zoomed internal windows regain resize support, resizing can end zoom and persist a tiled placement, and the zoom control exposes restore behavior with state-specific la…
Out of Scope Changes check ✅ Passed The reviewed changes are limited to maximized internal-window resizing, zoom-state controls, related model behavior, and tests. These changes directly support issue #585 and do not show unrelated scop…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: enabling resizing for maximized internal windows.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-585-window-resize

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.

@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

React Doctor found 1 new issue in 1 file · 1 warning · score 93 / 100 (Great) · 1 fixed · vs main

1 warning

src/systems/os/components/os-window.tsx

  • ⚠️ L41 React function has high control-flow complexity no-high-complexity-react-function

Reviewed by React Doctor for commit 0a74ff3. See inline comments for fixes.

@greptile-apps

greptile-apps Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR enables resizing maximized internal windows through the existing tiled resize path and improves the zoom control’s state-specific icon, accessible label, tooltip, documentation, and regression coverage.

  • Maximized windows expose edge and corner resize handles while remaining non-draggable.
  • Resizing ends zoom and persists a new tiled zone; the Restore control returns the saved placement.
  • The latest change adds the Zoom/Restore wording to COPY.md, satisfying the repository copy contract.

Confidence Score: 4/5

The PR is not yet safe to merge because the outstanding zoomed tiled-resize calculation can commit geometry that differs from the rectangle displayed during the gesture.

The earlier tiled-resize finding remains unresolved: React Rnd measures the gesture against the full zoomed rectangle, but commitTiledResize still applies its delta to frame.zone, which may represent the smaller pre-zoom tiled placement and therefore cause a size jump on commit. The prior E2E coverage finding was manually resolved, and the latest COPY.md update fully fixes the copy-contract finding.

Files Needing Attention: web/src/systems/os/components/os-window.tsx, web/src/systems/os/hooks/use-os-window-resize.ts

Important Files Changed

Filename Overview
web/src/systems/os/lib/group-projection.ts Projects zoomed frames across the work area with all resize edges enabled.
web/src/systems/os/components/os-traffic-lights.tsx Adds maximize/restore icons and state-specific accessible labels and tooltips.
web/e2e/tests/os-shell.spec.ts Adds direct coverage for maximized tiled resize geometry, persistence, repeated zoom cycles, and peer-window stability.
COPY.md Establishes the canonical Zoom window and Restore window wording and explains their behavior.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Maximized internal window] --> B{User action}
    B -->|Restore control| C[window.zoom toggle]
    C --> D[Restore saved placement]
    B -->|Resize handle| E[window.resize]
    E --> F[End zoom]
    F --> G[Persist resized tiled zone]
Loading

Reviews (3): Last reviewed commit: "docs: define internal window control lab..." | Re-trigger Greptile

Comment thread web/src/systems/os/components/os-window.tsx
Comment thread web/e2e/__tests__/os-shell.spec.ts Outdated
coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 10, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Sep 10, 2026
Comment thread web/src/systems/os/components/os-traffic-lights.tsx
@pedronauck
pedronauck merged commit 470c7c8 into main Sep 10, 2026
49 checks passed
@pedronauck
pedronauck deleted the fix/issue-585-window-resize branch September 10, 2026 16:48
This was referenced Sep 27, 2026

This branch was successfully deployed

1 active deployment
Preview — 0a74ff3c Deployed Sep 10, 2026 by vercel[bot]
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.

Internal windows cannot be resized after entering fullscreen mode

1 participant