Files
PaperClipAI/ui
911fe5bb9a Fix Recents ordering and add sidebar pins (#22219)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The sidebar gives people quick access to tasks, chats, and projects.
> - Recents should reflect the order in which a person opened their
tasks.
> - Opening a task only updated its saved details. It did not update the
visit time.
> - This pull request records task visits and adds Recents shortcuts to
the existing sidebar pins.
> - People can find their last task and keep frequently used items above
More.

## Linked Issues or Issue Description

**What happened?**

Opening a personal task left it in its old position or added it at the
bottom of Recents. The Recents rows also had no controls to pin their
items.

**Expected behavior**

Opening a task moves it to the top of Recents. Opening a nested task
moves its parent group to the top. A person can pin a task, chat, or
project from Recents.

**Steps to reproduce**

1. Open two personal tasks in the Coordinator workspace.
2. Reopen the first task and check its position in Recents.
3. Hover over a Recents row and look for a pin button.

**Paperclip version or commit**

Reproduced on source checkout `43b2d8be22`.

**Deployment mode**

Local dev with an isolated embedded PostgreSQL database.

Related work: #22024, #21649, and #19685.

## What Changed

- Record the first loaded task visit and subsequent reopens. Keep the
timestamp during background refreshes.
- Use the most recent task visit in each displayed group when ordering
parent rows.
- Add tasks, agent chats, and projects from Coordinator Recents to the
existing sortable sidebar pins. Resolve saved shortcuts with the current
company data and task read permissions.
- Use the same highlight state for a Recents row and its pin button.
This includes the current row, hover, and keyboard focus.

## Verification

- The reopen test failed before the fix because the older task stayed
below the newer task. The Chromium check also reproduced the missing pin
on the current row before the highlight fix.
- Ran the eight focused Vitest files for task detail, the two sidebars,
recent task state, task warmup, and pinned navigation on macOS. Ran
`pnpm --filter @paperclipai/ui typecheck`.
- In Chromium on the isolated dev server, opened two tasks and reopened
the first. Pinned a task and project and confirmed that both survived
reload. Checked current, hovered, and keyboard-focused rows. Checked
that a pointer click did not keep the pin visible after leaving an
inactive row.
- `pnpm verify` requested broader CI coverage because the product
documentation changed.

- GitHub CI passed on `b77fc06393`. The initial native-server and Canary
jobs lost their runners. Both jobs passed on retry without a code
change. [CI
retry](https://github.com/paperclipai/paperclip/actions/runs/44373716458/attempts/2)
- Greptile scored the same commit 5/5 and left no review threads.
[Greptile
review](https://github.com/paperclipai/paperclip/pull/22219#issuecomment-6988318333)

## Risks

- Recent ordering keeps the existing participation filter and subtask
groups. A task pin uses the existing summary batch to check read access
independently of participation.
- Pins are stored per browser user. Task and project keys include the
company ID. Existing page and agent-chat keys keep their saved order.
- The change uses the existing summaries API. It requires no schema
migration.

## Model Used

- OpenAI GPT-6 via Codex, with shell, GitHub CLI, and Chromium
verification tools.

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either linked existing issues or described the issue using
the relevant issue template
- [x] I have not referenced internal or instance-local Paperclip issues
or links
- [x] My branch name describes the change and contains no internal
Paperclip ticket ID
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

Co-authored-by: Scott Tong <1504818+scotttong@users.noreply.github.com>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-18 12:52:37 -08:00
..
…

@paperclipai/ui

Published static assets for the Paperclip board UI.

What gets published

The npm package contains the production build under dist/. It does not ship the UI source tree or workspace-only dependencies.

Storybook

Storybook config, stories, and fixtures live under ui/storybook/.

pnpm --filter @paperclipai/ui storybook
pnpm --filter @paperclipai/ui build-storybook

Typical use

Install the package, then serve or copy the built files from node_modules/@paperclipai/ui/dist.

Editor dependency identity

Keep the root and workspace overrides for @codemirror/state, @codemirror/view, and @lezer/common aligned. CodeMirror requires shared extension identity, while Lezer parsers and syntax highlighters require shared NodeProp IDs. Multiple Lezer copies can crash code-block highlighting with tags is not iterable. src/lib/codemirror-single-instance.test.ts checks the installed dependency graph and highlights sample code through the editor's real language dependencies. GitHub Actions owns regeneration of pnpm-lock.yaml.