Skip to content

Close keyboard and edge-scroll the dash on app drag - #112

Open
RobinJ1995 wants to merge 3 commits into
claude/app-drag-drop-reorder-twr4jpfrom
claude/dash-edge-scroll-close-keyboard
Open

Close keyboard and edge-scroll the dash on app drag#112
RobinJ1995 wants to merge 3 commits into
claude/app-drag-drop-reorder-twr4jpfrom
claude/dash-edge-scroll-close-keyboard

Conversation

@RobinJ1995

Copy link
Copy Markdown
Owner

Summary

Two follow-ups to the dash drag-reorder work in #108, making a custom-ordered dash easier to rearrange.

Stacked on #108 — this PR is based on claude/app-drag-drop-reorder-twr4jp so it shows only the incremental diff. GitHub will auto-retarget it to master once #108 merges. (Review/merge #108 first.)

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 static startAppDrag).

  • 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 DashEdgeScroller follows the platform's 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.

Implementation notes

  • The scroll velocity is a pure function (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.
  • Edge zone is 15% of the grid height at each end; scroll stops automatically when the grid can't scroll further (canScrollList).

🤖 Generated with Claude Code


Generated by Claude Code

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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
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.

2 participants