Skip to content

fix(window): fit main window to half-screen tiling cells - #4254

Open
ranrany123 wants to merge 1 commit into
binaricat:mainfrom
ranrany123:fix/macos-half-screen-window-bounds
Open

ranrany123 wants to merge 1 commit into
binaricat:mainfrom
ranrany123:fix/macos-half-screen-window-bounds

Conversation

@ranrany123

Copy link
Copy Markdown
Contributor

Summary

Fixes the main window spilling past the screen edge when macOS or Windows tiles it to a half-screen (or quarter-screen) cell. Window tiling keeps the app's minimum size, so the previous 1100×640 minimum produced a 1100px-wide window inside a ~735px cell and pushed the window partly off screen. Restored window bounds could also reopen partially off screen.

Type of Change

  • Bug fix

Related Issue (optional)

N/A

Changes Made

  • Cap the main window's effective minimum size at half the current display work area minus the macOS tiled-window margin, so standard half/quarter tiling cells fit. The 1100×640 layout minimum still applies when the display can hold it.
  • Fit restored startup bounds fully into the target display's work area. Windows that intentionally span adjacent displays are preserved; only rectangles with pixels outside every work area are moved/capped.
  • Let VaultPageHeader wrap its action buttons on narrow half-screen widths instead of clipping them.
  • Add regression tests for startup bounds fitting and the wrapped Vault header.

Screenshots / Demo

Verified in the built app on a 1470×956 logical Mac display (macOS 27.2):

  • Half-screen: 735×848 window fully on screen; effective minimum 719×409.
  • Quarter-screen: 735×425 window fully on screen.
  • A tiling-style 723×413 request (with the default ~8px macOS tiling margin) is accepted unchanged.
  • Vault header wraps to two rows at 735px; the local terminal remains usable.
  • A saved off-screen state {x:499,y:253,width:1100,height:838} reopens at {x:370,y:43}.

Testing

  • I have tested these changes locally (built app)
  • Linting passes (npm run lint)
  • Tests pass (npm test) — targeted window-manager (127) and Vault header/layout suites pass locally; the full local run on Node 26 has 8 environment/build-artifact failures unrelated to this change (plugin example fixtures, PTY/path tests). CI runs the full suite on Node 22 after the example-plugin build steps.
  • Generated capability tool specs are updated when applicable (npm run generate:capability-tools) — not applicable; no capability catalog changes
  • No new console errors or warnings, if this affects app behavior

Checklist

  • My code follows the existing project style
  • I have not introduced any breaking changes (or I have described them above)

Documentation: not applicable — this changes internal window sizing and narrow-window layout only.

🤖 Generated with Claude Code

macOS and Windows window tiling keep the app's minimum size when the
requested cell is smaller, so the 1100x640 minimum pushed half-tiled
windows past the screen edge. Cap the effective minimum at half the
display work area minus the macOS tiling margin, and pull restored
bounds back inside the work area while preserving windows that span
adjacent displays.

Let Vault page headers wrap their action buttons on narrow half-screen
windows instead of clipping them.

Tests: window manager suite (127) and Vault header/layout tests pass.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T15:31:47.724411Z 5da8466 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5da8466416

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Wrap instead of clipping when the window is tiled to a narrow
// half-screen cell: the search row keeps its controls and the
// fixed-width action buttons move to a second row.
"min-h-14 px-4 py-2 flex flex-wrap items-center gap-x-3 gap-y-2 app-no-drag",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Allow nested action groups to wrap at the new tiling widths

On a 1366px display at 125% scaling, the newly permitted half-screen window is about 546 logical pixels wide; the default 208px Vault sidebar leaves less than 300px for the header's contents. In the first-party Keychain view, KeychainManager.tsx:595-651 puts New Key, Import Certificate, and New Identity inside one non-wrapping flex child with non-shrinking buttons. Wrapping this outer container cannot split that action group, so it remains wider than the available space and the Keychain root's overflow-hidden clips the rightmost actions instead of moving them onto another row. Make the nested action groups wrap or collapse as well so those controls remain visible at the newly supported window sizes.

Useful? React with 👍 / 👎.

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