-
Notifications
You must be signed in to change notification settings - Fork 57
feat: cmd+click and shift+click multi-select for kanban and sidebar #1518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+2,682
−234
Merged
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
31237ad
feat: add anchored range selection to multi-select reducer
zeval 78b2a1f
feat: cmd+click and shift+click multi-select on kanban board
zeval eb2e382
feat: add cmd/shift multi-select to sidebar task list
zeval 60df474
test: e2e coverage for cmd/shift multi-select
zeval bf3b1e6
fix: harden multi-select selection lifecycle from review feedback
zeval cdfbe76
test: scope multi-select e2e helpers to active containers
zeval 6aa36c8
fix: add sidebar multi-select hook tests and tighten bulk-action life…
zeval e6f5044
fix: prune hidden sidebar selections and order bulk moves by view
zeval c2a8928
test: cover visible-order bulk move and anchor realignment
zeval b7a0d1a
fix: harden sidebar bulk-move scope and keyboard selection parity
zeval 72a1a1c
fix: order kanban bulk moves by board position
zeval 5d74b8d
test: cover multi-select helpers and fix stale-id sort fallback
zeval fc8b362
fix: order kanban card context-menu moves by board position
zeval f938825
feat: sidebar multi-select shows only bulk-valid actions with bulk pi…
zeval 4b615fa
fix: harden multi-select bulk ordering, selection clearing, and a11y
zeval db6c18e
fix: gate kanban card move-to-step for mixed-workflow selections
zeval 5f09827
fix: unpin fully pinned sidebar selections
zeval 7532efe
refactor: keep sidebar task components under limits
zeval 06869aa
test: restore sidebar selection console spy safely
zeval File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import { describe, it, expect, vi } from "vitest"; | ||
| import { dispatchKanbanCardClick, type Task } from "./kanban-card"; | ||
|
|
||
| function fakeEvent(mods: Partial<MouseEvent> = {}) { | ||
| return { | ||
| metaKey: false, | ||
| ctrlKey: false, | ||
| shiftKey: false, | ||
| preventDefault: vi.fn(), | ||
| ...mods, | ||
| } as unknown as React.MouseEvent; | ||
| } | ||
|
|
||
| const task = { id: "t1", title: "T", workflowStepId: "s1" } as Task; | ||
|
|
||
| function handlers() { | ||
| return { | ||
| onToggleSelect: vi.fn(), | ||
| onRangeSelect: vi.fn(), | ||
| onClick: vi.fn(), | ||
| isMultiSelectMode: false, | ||
| }; | ||
| } | ||
|
|
||
| describe("dispatchKanbanCardClick", () => { | ||
| it("cmd/meta-click toggles and prevents default", () => { | ||
| const h = handlers(); | ||
| const e = fakeEvent({ metaKey: true }); | ||
| dispatchKanbanCardClick(e, task.id, task, h); | ||
| expect(e.preventDefault).toHaveBeenCalled(); | ||
| expect(h.onToggleSelect).toHaveBeenCalledWith("t1"); | ||
| expect(h.onClick).not.toHaveBeenCalled(); | ||
| expect(h.onRangeSelect).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it("ctrl-click toggles (Windows/Linux)", () => { | ||
| const h = handlers(); | ||
| dispatchKanbanCardClick(fakeEvent({ ctrlKey: true }), task.id, task, h); | ||
| expect(h.onToggleSelect).toHaveBeenCalledWith("t1"); | ||
| }); | ||
|
|
||
| it("shift-click range-selects and prevents default", () => { | ||
| const h = handlers(); | ||
| const e = fakeEvent({ shiftKey: true }); | ||
| dispatchKanbanCardClick(e, task.id, task, h); | ||
| expect(e.preventDefault).toHaveBeenCalled(); | ||
| expect(h.onRangeSelect).toHaveBeenCalledWith("t1"); | ||
| expect(h.onToggleSelect).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it("plain click while in multi-select mode toggles", () => { | ||
| const h = { ...handlers(), isMultiSelectMode: true }; | ||
| dispatchKanbanCardClick(fakeEvent(), task.id, task, h); | ||
| expect(h.onToggleSelect).toHaveBeenCalledWith("t1"); | ||
| expect(h.onClick).not.toHaveBeenCalled(); | ||
| }); | ||
|
|
||
| it("plain click outside multi-select mode previews/opens", () => { | ||
| const h = handlers(); | ||
| dispatchKanbanCardClick(fakeEvent(), task.id, task, h); | ||
| expect(h.onClick).toHaveBeenCalledWith(task); | ||
| expect(h.onToggleSelect).not.toHaveBeenCalled(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.