Skip to content

fix(chrome): portal model picker out of composer stacking - #22

Merged
Warexpor merged 2 commits into
mainfrom
mono/portal-model-picker
Sep 4, 2026
Merged

fix(chrome): portal model picker out of composer stacking#22
Warexpor merged 2 commits into
mainfrom
mono/portal-model-picker

Conversation

@Warexpor

@Warexpor Warexpor commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary

Port of upstream hardbeat920/monocode#31 onto this fork’s current chrome.

Upstream hardbeat920#31 moved the model picker menu through createPortal onto document.body at z-index 80 so Composer’s data-composer-box (relative z-10 stacking context) could not clip it. This fork already routes the menu through the shared Popover (which portals to document.body at LAYER.popover = 80). This PR pins that contract explicitly:

  • ModelPicker passes layer={LAYER.popover} and documents the stacking reason
  • Source-contract test asserts Popover portal wiring (and that we do not regress to a local createPortal / menuStyle path)

No redesign; other composer pickers left alone (same scope note as upstream).

How the portal works

Popover renders with createPortal(..., document.body) and zIndex: LAYER.popover (80). Outside-click treats both the portalled frame and the trigger anchor as inside. Positioning stays viewport-fixed via placePopover.

Files

  • src/chrome/ModelPicker.tsx (+5)
  • src/chrome/ModelPicker.test.ts (+28)

Verification

  • npm run check:web — vitest 1209 passed (118 files), tsc --noEmit clean
  • npm run build — Vite production build succeeded
  • Full vite preview / browser chrome smoke — not done; app chrome needs Tauri invoke to mount. No native Windows/Tauri/DWM or live session QA claimed.
  • CI check + Windows NSIS

Refs

mono and others added 2 commits September 4, 2026 21:46
Composer stacks a relative z-10 box; pin ModelPicker's Popover to
LAYER.popover on document.body so the menu is not clipped — same
contract as hardbeat920#31.
Assert the fork keeps upstream hardbeat920#31's stacking fix via Popover rather
than a local createPortal/menuStyle path.
@Warexpor
Warexpor merged commit 4a50e40 into main Sep 4, 2026
4 checks passed
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