Close keyboard and edge-scroll the dash on app drag - #112
Conversation
Two follow-ups to the dash drag-reorder work, so a custom-ordered dash is easier to rearrange: - Starting any dash drag now lowers the soft keyboard. The dash search field may have raised it (most notably when dragging a search result), where it would otherwise cover the launcher bar and lower dash rows. Hidden at the drag-initiation site (AppLauncherLongClickListener) so it fires for grid and search-result drags alike. - Dragging near the grid's top or bottom edge auto-scrolls it, so an app can be dropped onto a row that isn't on screen. New DashEdgeScroller follows the platform list drag-scroll pattern: ACTION_DRAG_LOCATION only fires while the pointer moves, so a self-reposting Handler tick does the scrolling, accelerating the deeper into the edge zone the finger sits, and stops on drop / exit / end. DashGridDragListener lazily owns one scroller per page grid and drives it from onDrag. The velocity geometry is a pure function, unit-tested in isolation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D594DCEMgKkkceo5McSkKU
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b4ff1d43fd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Edge-scroll moves the grid under a stationary finger, but the loose-app / folder reorder-fold preview was only recomputed from ACTION_DRAG_LOCATION, and ACTION_DROP commits the cached previewIndex / foldTargetKey. So letting auto-scroll reveal a row and then releasing without moving again dropped the item on the pre-scroll target instead of the row now under the finger. DashEdgeScroller now calls back after each scroll step; DashGridDragListener re-resolves the preview at the last pointer position. Only the cached loose/folder preview needs this — a folder-member drop already recomputes its target from the drop point in onMemberDrop. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D594DCEMgKkkceo5McSkKU
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 32f652047f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The previous re-resolve skipped folder-member drags because draggedKey is null for them. But onMemberDrop only recomputes the target cell — the fold still requires armedPosition to match, and armedPosition/highlight stayed pinned to the pre-scroll row since onMemberLocation never re-ran. So edge- scrolling a member and releasing without moving would extract it loose instead of folding onto the row now under the finger. The edge-scroll callback now re-resolves the member hover as well, using the extracted app captured at ACTION_DRAG_STARTED (memberApp) so onMemberLocation can run from the stored pointer position. onMemberLocation / resolveAndPreview now both take plain coordinates. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D594DCEMgKkkceo5McSkKU
Summary
Two follow-ups to the dash drag-reorder work in #108, making a custom-ordered dash easier to rearrange.
Changes
Close the keyboard when a drag starts. The dash search field may hold the soft keyboard open — most notably when dragging a search result — where it would otherwise cover the launcher bar and the lower dash rows. The keyboard is now lowered at the drag-initiation site (
AppLauncherLongClickListener.hideKeyboard), so it fires for both dash-grid drags and search-result drags (which share the staticstartAppDrag).Edge-scroll the dash during a drag. Dragging near the grid's top or bottom edge now auto-scrolls it, so an app can be dropped onto a row that isn't currently on screen. New
DashEdgeScrollerfollows the platform's list drag-scroll pattern:ACTION_DRAG_LOCATIONonly fires while the pointer moves, so a self-repostingHandlertick does the scrolling, accelerating the deeper into the edge zone the finger sits, and stops on drop / exit / end.DashGridDragListenerlazily owns one scroller per page grid and drives it fromonDrag.Implementation notes
DashEdgeScroller.velocityFor(y, height)) — 0 through the middle, ramping from a min step at a zone's inner edge to a max step at the grid's edge, negative at the top and positive at the bottom — unit-tested in isolation (DashEdgeScrollerTest) so the geometry doesn't depend on driving a live Handler/GridView.canScrollList).🤖 Generated with Claude Code
Generated by Claude Code