Skip to content

feat(workbench): pin tasks from the sidebar row and reorder the Pinned list - #3445

Open
Xentropics wants to merge 2 commits into
generalaction:mainfrom
Xentropics:feat/sidebar-pin-copies
Open

Xentropics wants to merge 2 commits into
generalaction:mainfrom
Xentropics:feat/sidebar-pin-copies

Conversation

@Xentropics

Copy link
Copy Markdown

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.

  • Pin from the row: each task row in the sidebar shows a pin button on hover. Clicking it pins the task, clicking again unpins it. In the Pinned list the button shows PinOff.
  • The task stays in its project: a pinned task is shown in the Pinned list as a copy and stays in its project's list as well, where the pin icon stays visible to mark it. Pinning no longer hides a task from its project.
  • Reorder pinned tasks: drag within the Pinned list to change the order. Dragging only works within that list; the project list is a separate drag context.

Implementation notes:

  • The pinned order is stored in a new workbench.sidebar-pins memento (order: projectId:taskId keys). The existing workbench.sidebar schema is left untouched, so older builds keep reading it.
  • SidebarStore.pinnedSidebarEntries sorts 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.
  • The pin state itself is unchanged: it is still the task's isPinned flag, set through task.setPinned.

Related issues

None found.

Testing

  • oxfmt --check and oxlint pass on the changed files
  • typecheck (browser tsconfig) passes
  • vitest run --project node for the workbench slice and manifests: 160 pass, including new sidebar-store tests for the pinned order
  • Manual testing in pnpm run dev with an isolated profile: pin and unpin from the project list and from the Pinned list, reorder the Pinned list by dragging, order persists across reloads

Screenshot/Recording (if applicable)

I can add one on request.

Checklist
  • I kept this PR small and focused
  • I ran a self-review before opening this PR
  • I ran the relevant local checks or explained why not
  • I updated docs when behavior or setup changed (no user docs for the sidebar that I found)
  • I added or updated tests when behavior changed, or explained why not
  • I only added comments where the logic is not obvious
  • I used Conventional Commits for commit
    messages and, when possible, the PR title

🤖 Generated with Claude Code

…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>
@greptile-apps

greptile-apps Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5

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

Findings

  1. P2 Pinned ordering requires a mouse ▶
  2. P2 Pin buttons stay hidden ▶
Fix 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.

Summary

Adds row-level pin buttons and manual ordering for the Pinned list.

  • Task rows can pin and unpin tasks that stay in their projects.
  • The Pinned list keeps a hand-set order across reloads.

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 } }));

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.

P2 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!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

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.

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'

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.

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

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!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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>

This branch has not been deployed

No deployments
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.

1 participant