Skip to content

fix(selection): keep adaptive toolbar off mid-gesture across scopes - #33

Open
itsezlife wants to merge 3 commits into
DoctorinaAI:feat/selection-chrome-parityfrom
itsezlife:fix/drop-toolbar-on-chrome-ownership-loss
Open

itsezlife wants to merge 3 commits into
DoctorinaAI:feat/selection-chrome-parityfrom
itsezlife:fix/drop-toolbar-on-chrome-ownership-loss

Conversation

@itsezlife

@itsezlife itsezlife commented Sep 16, 2026 •

Copy link
Copy Markdown

Summary

Two toolbar timing bugs from dogfooding #30 with several per-body scopes on one controller.

When selection moves from document A to B, scope A already cleared its handles but left the adaptive toolbar up. Losing ownsSelectionChrome now removes that scope's context menu. toolbarWanted stays set so the owning sibling can still restore on settle.

Separately, an expand drag near the edge could pop the toolbar before the finger came up. Autoscroll delivers scroll notifications while the drag is live, and the geometry restore path treated toolbarWanted as permission to show the menu. Hosts that clamp a wandered range back onto the subject via the public selection setter re-arm toolbarWanted mid-gesture, so the menu came back early. Scroll / geometry restore now no-ops while _dragGlobal is set. Drag-end showToolbar is unchanged.

Follow-up for #30.

Test plan

  • flutter test test/selection/selection_widget_test.dart --name "expand drag keeps toolbar hidden"
  • Multi-scope retarget: toolbar on A, move selection to B, A's overlay is gone immediately
  • Device: multi-select expand drag into a sibling body while edge autoscroll runs, toolbar stays down until release

Sibling scopes sharing a controller cleared handles on ownership loss but
left the adaptive context menu up. Remove this scope's menu without clearing
toolbarWanted so the owner can still restore on settle.
Describe surface-bounds gesture starts and empty-click dismiss in plain
terms so the package history stays host-agnostic.
Autoscroll scroll notifications were re-presenting the adaptive toolbar
mid-expand when toolbarWanted got re-armed (host clamping a range via the
public selection setter). Gate scroll / geometry restore on _dragGlobal.
@itsezlife itsezlife changed the title fix(selection): drop toolbar overlay when chrome ownership is lost fix(selection): keep adaptive toolbar off mid-gesture across scopes Sep 16, 2026
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