Skip to content

Fix SelectPhraseBundleV2 dropdown close in modal context#37

Merged
navidshad merged 2 commits into
devfrom
CU-86exzbh61_Fix-bundle-selector-dropdown-in-save-phrase-modal-wont-close-overflows-wrapper
Jun 17, 2026
Merged

Fix SelectPhraseBundleV2 dropdown close in modal context#37
navidshad merged 2 commits into
devfrom
CU-86exzbh61_Fix-bundle-selector-dropdown-in-save-phrase-modal-wont-close-overflows-wrapper

Conversation

@navidshad

@navidshad navidshad commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

🏷️ PR Title:
Fix bundle list containment and dropdown close behavior in console-crane modal

📋 Summary

This PR addresses UI issues in the console-crane modal by ensuring the bundle list remains contained within the modal frame and that the bundle selector dropdown closes appropriately.

🔗 Related Tasks

#86exzbh61 - Keep bundle list within the modal frame and close bundle selector dropdown properly

📝 Additional Details

The fixes improve user experience by preventing overflow of the bundle list outside the modal and ensuring dropdown interaction behaves as expected.

📜 Commit List

ca49b14 fix(console-crane): keep bundle list within the modal frame #86exzbh61
f9f1c8e fix(console-crane): close bundle selector dropdown and contain its list #86exzbh61

…st #86exzbh61

The save-phrase bundle selector (a pilotui Select in custom+multiple mode)
would not close and its option list spilled out of the modal.

- Close: pilotui's only outside-driven close is a document handler that bails
  whenever the click sits under any `.relative` ancestor — true for nearly
  every click inside the ConsoleCrane modal, so the dropdown never closed.
  pilotui exposes no close method or `open` prop, so drive its own Escape
  handler from a self-managed outside-pointerdown listener and a real
  closeDropdown() (the latter also wired up the previously no-op after-save
  close called by SaveWordSectionV2).
- Overflow: pilotui only gives the option list an internal scroll in `confirm`
  mode; in the `custom` mode used here the list grows past the panel's
  max-height and out of the modal. Make the panel a flex column and let the
  list region scroll within it.

Adds a happy-dom regression test for the close mechanism.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JsGMdHrjQfWRausa9T14kw
@navidshad

Copy link
Copy Markdown
Collaborator Author

The bundle list was capped at pilotui's max-h-96 with an internal scroll, but
the save section sits near the modal bottom, so the fixed downward panel still
ran past the visible frame — the user had to scroll the modal AND the list.

On open, measure the trigger against the nearest scroll frame and place the
absolutely-positioned panel accordingly: flip it upward when it can't fully open
downward and there's more room above, and cap its height to the available space
(minus a gap) in whichever direction it opens. Reposition on resize/scroll while
open; pilotui exposes no placement API, so this is done via inline styles on its
rendered panel. The list scrolls internally within the cap.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JsGMdHrjQfWRausa9T14kw
@navidshad navidshad merged commit 646094e into dev Jun 17, 2026
3 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.15.0-dev.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.15.1-dev.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.15.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants