Files
PaperClipAI/ui
5e2243f081 fix(ui): align sidebar avatars and navigation icons (#20926)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The left navigation mixes agent avatars, task status icons, and page
icons.
> - Agent avatars used 20px boxes. Task and page icons used 16px boxes.
> - The different widths moved agent labels 4px to the right of other
labels.
> - This pull request gives these icons the same 16px square slot.
> - Shared label positions make pinned and recent items easier to scan.

## Linked Issues or Issue Description

Refs #19685, which added mixed agent and page pins. No duplicate
alignment PR was found.

**What happened?**

Agent avatars in pinned and recent navigation were wider than task and
page icons. Their labels started 4px farther to the right. Inline icon
layout also produced different box heights.

**Expected behavior**

Use the existing 16px task and page icon size for all leading navigation
icons. Center each icon in a square slot. Start the labels at the same
horizontal position.

**Steps to reproduce**

1. Pin an agent conversation and a page such as Routines.
2. Open agent conversations and tasks so both appear in Recents.
3. Compare the icon boxes and label positions across the rows.

**Paperclip version or commit**

Base commit: `c5e6ab5ca813`.

**Deployment mode**

Local source checkout. This is a client layout issue.

## What Changed

- Use 16px agent avatars for pinned and recent conversation rows.
- Give `SidebarNavItem` a fixed 16px square icon slot with centered
contents and left-aligned text. The existing token scale supplies the
size.
- Add light and dark Storybook examples with mixed icons and long
labels. The browser assertions compare slot sizes, label positions, and
glyph bounds.
- Add a production `CoordinatorSidebar` regression test that compares
pinned and recent avatar dimensions with a task status icon.

## Verification

- `pnpm exec vitest run ui/src/components/SidebarNavItem.test.tsx
ui/src/components/CoordinatorSidebar.test.tsx
ui/src/components/SidebarAgents.test.tsx` passes: 59 tests across three
files.
- Regression proof: the new production-avatar test fails with the
original 20px avatars (`expected 20 to be 16`) and passes with 16px
avatars. This addresses the initial review's test coverage gap.
- `pnpm check:token-gates` passes.
- `pnpm --filter @paperclipai/ui typecheck` passes.
- `pnpm --filter @paperclipai/ui build` passes on the final source tree.
- `pnpm verify --base origin/master` returns exit 2 because the new
Storybook file needs broad CI coverage. The focused local tests run
separately. CI must supply the remaining coverage.
- Browser inspection on macOS checked all 13 mixed rows in light and
dark themes. Every icon slot measured 16 by 16 CSS pixels. Every label
started at the same position. Before and after captures use production
components with fixture data; they do not prove server persistence or
permissions.
- Review `sidebar-icon-alignment--dark` and
`sidebar-icon-alignment--light` in Storybook to inspect the mixed rows
and run their layout assertions.
- [Greptile
review](https://github.com/paperclipai/paperclip/pull/20926#issuecomment-6806138954):
5/5 on `e779f4707e7826d577b23a2991f3f36755e954be`. The initial 4/5
review requested production Recents coverage. The added regression test
addresses that finding; the thread is resolved.
- CI queue recovery: the superseded first run was canceled. The next run
stalled before runner assignment; GitHub accepted force-cancel but left
it queued and refused the rerun request. The final empty commit requests
fresh CI without changing the source tree. Required CI is tracked in
[run
43095809539](https://github.com/paperclipai/paperclip/actions/runs/43095809539).
Its jobs are still queued; CI completion is not yet claimed.
- External blocker: after more than 15 minutes, the fresh run still has
zero jobs. Other repository PR runs are also queued. A repository
Actions or runner administrator must restore dispatch before the
required typecheck, test, build, and E2E gates can report results. The
root cause of the dispatch delay is not established.

## Risks

- Low risk. The shared icon slot also affects other navigation rows.
Existing badge, rail, and expanded-state tests cover the shared
component.
- Agent avatars become smaller in pinned and recent navigation, as
requested. No data or API contracts change.

> For core feature work, check [`ROADMAP.md`](ROADMAP.md) first and
discuss it in `#dev` before opening the PR. Feature PRs that overlap
with planned core work may need to be redirected. This change is a
scoped UI bug fix.

## Model Used

- OpenAI GPT-6 via Codex. The host does not expose the exact served
model snapshot or context window size. Used reasoning, code editing,
shell execution, and browser inspection.

## 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 (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [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
- [ ] 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 <scott@scottsmbpm5max.lan>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-11 14:01:22 -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.