Skip to content

feat(board): fade dragged card immediately and fix stale drag state#3524

Merged
dgageot merged 2 commits into
docker:mainfrom
dgageot:worktree-board-f7252aa0ba2f84be
Jul 8, 2026
Merged

feat(board): fade dragged card immediately and fix stale drag state#3524
dgageot merged 2 commits into
docker:mainfrom
dgageot:worktree-board-f7252aa0ba2f84be

Conversation

@dgageot

@dgageot dgageot commented Jul 8, 2026

Copy link
Copy Markdown
Member

When dragging a card on the board, there was no visual feedback during the drag itself — the card looked identical whether it was being moved or stationary, making it hard to tell that a drag was in progress. Additionally, the drag only started after the pointer had moved outside the card's bounds, which felt sluggish and meant a fast move could pick up the wrong card.

The card now begins fading toward the theme background on the first mouse motion while the button is pressed, not when the pointer crosses a boundary. New helpers in pkg/board/tui/view.go blend the card's title, project badge, status line, and border color toward the background, giving a clear "lifted" appearance. The click-vs-drag decision moved to release time: releasing the button over the card that was originally pressed counts as a plain click (so double-click-to-attach still works), while releasing anywhere else finalizes the move.

A follow-up fix resets drag state that was lost when tea.ExecProcess (the attach flow) consumed the mouse-release event, preventing a later plain click from silently moving a card. Wheel events are also ignored while a card is held down to avoid accidental column scrolls mid-drag.

Move the click-vs-drag decision to release time: any motion while a card
is pressed immediately marks it as dragging (and fades its colors), while
dropping back on the same card is still treated as a plain click so
double-click-to-attach keeps working.

Assisted-By: Claude
@dgageot
dgageot requested a review from a team as a code owner July 8, 2026 08:29
@aheritier aheritier added area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat:). Use on PRs only. labels Jul 8, 2026

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Assessment: 🟢 APPROVE

The drag-fade implementation is well-structured. The visual feedback helpers in view.go correctly blend card colors toward the background using explicit foreground values that are always set. The click-vs-drag decision at release time is logically sound — bubbletea's single-threaded update loop means there is no race between cardAt bounds-checking and the card-ID lookup on the same line. The wheel-suppression guard (dragCardID != "") is intentional per the PR description and avoids accidental column scrolls during a card press. No bugs found in the introduced changes.

Reset drag on attachReadyMsg and defensively in handleClick so a lost
mouse release cannot silently move a card. Ignore wheel events while a
card is pressed to avoid shifting selection mid-drag.

Assisted-By: docker-agent/claude-sonnet-4-5
@dgageot
dgageot force-pushed the worktree-board-f7252aa0ba2f84be branch from 3a9a229 to b551867 Compare July 8, 2026 08:55
@dgageot
dgageot merged commit 0b6f8e0 into docker:main Jul 8, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants