Skip to content

web: fix dropdown dismiss, retained-store order, modal hit-testing - #65

Merged
tiensonqin merged 1 commit into
mainfrom
devin/lui-web-fixes
Sep 27, 2026
Merged

tiensonqin merged 1 commit into
mainfrom
devin/lui-web-fixes

Conversation

@tiensonqin

Copy link
Copy Markdown
Collaborator

Summary

Fixes for bugs found exercising the web gallery demo after #63.

  • insert_at corrupted the retained store's child order (lui_web_store.ml): the [] base case did List.rev_append acc [value], re-appending the inserted element after the accumulator tail for every non-tail insert. Subsequent replace_children/patches then referenced stale node ids and crashed apply-batch with unknown node (seen navigating back to the Toast page). Now returns List.rev acc, matching the original web.cljc.
  • Dropdown clicks never committed (lui_web_menu.ml): every mounted DropdownMenu installs a document pointerdown that emitted Dismiss on outside presses — including presses inside other pickers' menus on the same page, which closed the open picker and detached the click target before click fired. The handler now only emits Dismiss while that menu is actually data-open, and dropdown_group_contains_event treats the whole dropdown group as inside (nested submenus get their own positioner in the portal, so they're DOM siblings, not descendants).
  • Modal layer wasn't clickable (lui.css): .lui-modal-layer lives inside .lui-popup-portal (pointer-events: none) but never re-enabled hit-testing. Added pointer-events: auto. This was a latent upstream bug — the original CSS had the same hole.
  • --destructive-foreground invisible in light theme: it aliased --destructive itself; now oklch(0.985 0 0).
  • Restored examples/components/flutter/.../app_icon_128.png (referenced by the web demo's asset loader; deleted during the OCaml migration).

Verified: overlay 38/38, simulator 15/15, unit 44/44, hot-reload 1/1, firefox 1/1 — plus a Playwright repro covering select/submenu mouse commit, dialog cancel click, and toast navigation without crashes.

Link to Devin session: https://app.devin.ai/sessions/5d6b198dceb54bb2b8fa02c8a412f45c
Open in Devin Desktop: https://app.devin.ai/desktop/session/5d6b198dceb54bb2b8fa02c8a412f45c?variant=devin
Requested by: @tiensonqin

- insert_at appended the inserted value a second time for every non-tail
  insert, leaving stale child ids that crashed apply-batch with
  "unknown node" after navigation
- every mounted dropdown's document pointerdown emitted Dismiss on
  outside presses, so clicks inside sibling menus closed open pickers
  and removed the press target before click could commit; gate Dismiss
  on the menu actually being open and treat the whole dropdown group
  (nested submenu positioners are portal siblings, not descendants)
  as inside
- restore pointer-events on .lui-modal-layer so dialogs are clickable
  inside the pointer-events:none portal
- give --destructive-foreground a light-on-destructive value in the
  light theme
- restore the flutter example app icon referenced by web asset loaders
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@tiensonqin
tiensonqin merged commit bbb9130 into main Sep 27, 2026
4 checks passed
@tiensonqin
tiensonqin deleted the devin/lui-web-fixes branch September 27, 2026 11:35
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