Repository navigation
feat(workbench): pin tasks from the sidebar row and reorder the Pinned list - #3445
Xentropics wants to merge 2 commits into
Conversation
…d list A pin button on each task row (on hover) pins the task to the Pinned list at the top, or unpins it. A pinned task now stays in its project's list as well, marked with the pin, so pinning no longer hides it from its project. The Pinned list can be reordered by dragging within it; the order is saved in a new workbench.sidebar-pins memento, so the workbench.sidebar schema is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[Medium impact] The change affects task browsing in the desktop workbench sidebar. The PR appears safe to merge, with non-blocking keyboard-access improvements needed for the new pin and reorder controls. FindingsFix with agent prompt### Issue 1
apps/emdash-desktop/src/core/features/workbench/browser/sidebar/pinned-task-list.tsx:26
The new Pinned list only registers `PointerSensor`, and `SortablePinnedRow` has no focusable drag target. Keyboard-only users cannot change the saved order. Add `KeyboardSensor` with sortable keyboard coordinates and apply the returned `attributes` to a focusable row or drag handle.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
### Issue 2
apps/emdash-desktop/src/core/features/workbench/browser/sidebar/task-item.tsx:185
`PinToggle` uses `hidden` until the row is hovered. For unpinned tasks and all rows in the Pinned list, keyboard users cannot reach the button even when the task label has focus. Also reveal it with `group-focus-within/row:flex` so users can tab from the label to the pin button.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryAdds row-level pin buttons and manual ordering for the Pinned list.
Reviews (1) · Last reviewed commit: "feat(workbench): pin tasks from the side..." · Reviewed by Greptile |
| const entries = getSidebarStore().pinnedSidebarEntries; | ||
| const sidebar = getSidebarStore(); | ||
| const entries = sidebar.pinnedSidebarEntries; | ||
| const sensors = useSensors(useSensor(PointerSensor, { activationConstraint: { distance: 6 } })); |
There was a problem hiding this comment.
Pinned ordering requires a mouse
The new Pinned list only registers PointerSensor, and SortablePinnedRow has no focusable drag target. Keyboard-only users cannot change the saved order. Add KeyboardSensor with sortable keyboard coordinates and apply the returned attributes to a focusable row or drag handle.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/emdash-desktop/src/core/features/workbench/browser/sidebar/pinned-task-list.tsx
Line: 26
Comment:
**Pinned ordering requires a mouse**
The new Pinned list only registers `PointerSensor`, and `SortablePinnedRow` has no focusable drag target. Keyboard-only users cannot change the saved order. Add `KeyboardSensor` with sortable keyboard coordinates and apply the returned `attributes` to a focusable row or drag handle.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Upstream's project and task lists in the sidebar are pointer-only as well (PointerSensor only), so this keeps the Pinned list consistent with them. Keyboard reordering for the sidebar lists would be better as its own change across all three, since KeyboardSensor on these rows would take Enter/Space, which currently open the task.
There was a problem hiding this comment.
That makes sense — keeping the Pinned list consistent with the existing project and task list behavior is reasonable. You're right that keyboard reordering across all three would be better scoped as its own change, especially given the Enter/Space conflict with opening tasks. Good point.
Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.
| aria-pressed={isPinned} | ||
| className={cn( | ||
| 'size-5', | ||
| isPinned && !inPinnedList ? 'flex' : 'hidden group-hover/row:flex' |
There was a problem hiding this comment.
PinToggle uses hidden until the row is hovered. For unpinned tasks and all rows in the Pinned list, keyboard users cannot reach the button even when the task label has focus. Also reveal it with group-focus-within/row:flex so users can tab from the label to the pin button.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/emdash-desktop/src/core/features/workbench/browser/sidebar/task-item.tsx
Line: 185
Comment:
**Pin buttons stay hidden**
`PinToggle` uses `hidden` until the row is hovered. For unpinned tasks and all rows in the Pinned list, keyboard users cannot reach the button even when the task label has focus. Also reveal it with `group-focus-within/row:flex` so users can tab from the label to the pin button.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
Fixed in 2657ae6: the button now also shows with group-focus-within/row:flex, so Tab moves from the task label to it.
The button was display:none until hover, so Tab could never reach it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Description
Pinning a task currently moves it out of its project's list into the Pinned list, and the Pinned list can't be reordered. This PR makes the pin a toggle on the task row and lets the Pinned list be ordered by hand.
PinOff.Implementation notes:
workbench.sidebar-pinsmemento (order:projectId:taskIdkeys). The existingworkbench.sidebarschema is left untouched, so older builds keep reading it.SidebarStore.pinnedSidebarEntriessorts the pinned tasks by that saved order. Tasks pinned since the last reorder follow in the usual sidebar order. A drag saves the whole list again, so keys of unpinned tasks drop out then.isPinnedflag, set throughtask.setPinned.Related issues
None found.
Testing
oxfmt --checkandoxlintpass on the changed filestypecheck(browser tsconfig) passesvitest run --project nodefor the workbench slice and manifests: 160 pass, including newsidebar-storetests for the pinned orderpnpm run devwith an isolated profile: pin and unpin from the project list and from the Pinned list, reorder the Pinned list by dragging, order persists across reloadsScreenshot/Recording (if applicable)
I can add one on request.
Checklist
messages and, when possible, the PR title
🤖 Generated with Claude Code