fix(editor): Escape closes only the topmost layer; menus close when focus leaves #167
No reviewers
Labels
No labels
bug
enhancement
needs-triage
ready-for-agent
ready-for-human
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/deckle!167
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/140"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #140
What
New
web/src/layers.ts: one stack of open layers that decides what an Escape, an outside press or a focus change closes. Every dialog, every menu and the Media details panel is on it while open.isComposingor alreadypreventDefault()ed close nothing, so the page tree's inline rename and new-page inputs still use Escape themselves.useLayermemoizesopen, so a signal changing under an open layer (e.g. showing another file in the details panel) doesn't move the layer back on top.windowin the bubble phase, after Solid's delegateddocumenthandlers; its header explains whystopPropagation()can't order handlers under delegation.Moved onto it, with their own Escape/outside-press handling deleted:
Dialog, MediaPopMenuand details panel, page tree row menu, page editor header menu, element ⋮ menu, header host-navigation menus, rich-text Insert/Table menus.Behaviour changes in Media: a press on a tile body now closes an open tile menu, because only the menu and its ⋯ button count as inside. A right-click still reopens the menu at the cursor.
Tests
src/test/layers.test.ts: unit tests for the module, including the listener add/remove set.main.npm run build,tsc --noEmit,npm test(2036 passing),go vet ./...andgo test ./...all pass.scaffold/site/AGENTS.mdand README are unchanged: nothing they document changed.🤖 Generated with Claude Code
[autoland] verdict: pass
PASS. Validated for landing against issue #140.
ci / build-and-testis green on596544a(web build, vitest, go vet/test/build); not re-run.Closes #140; headafk/140is based on currentmain(no conflict).web/src/layers.tsstack; Dialog, HostNav, Media PopMenu and details panel, page tree row menu, page editor header menu, element ⋮ menu and the rich-text Insert/Table menus moved onto it, with their own Escape / outside-press / focus listeners deleted. The onlystopPropagation()left on key events are Dialog's Tab trap and the page tree's inline rename / new-page inputs, which the issue says keep their own Escape. README's header-menu paragraph still holds; AGENTS.md untouched, correctly.No CONCERNS.