Files
PaperClipAI/ui
DottaandPaperclip a312bdd347 fix(ui): keep connector permission forms responsive (#22008)
## Thinking Path

> - Paperclip helps people manage AI agents and their access to
connected apps.
> - The connector permission page controls agent access and tool
approvals.
> - Large action lists mounted a test dialog for every action, even when
closed.
> - Form edits repeated that work and waited for reads before showing
saved values.
> - This pull request limits the visible controls and mounts test
dialogs when opened.
> - The form shows a pending choice at once and uses the saved response
for the next edit.
> - The benefit is fast feedback with the same server permission checks.

## Linked Issues or Issue Description

**What happened?**
Changing Any agent to selected agents was slow on connector permission
pages. Agent selection and action controls also slowed down as the
action list grew.

**Expected behavior**
Form controls must respond quickly. Search and bulk changes must cover
the full action list. A failed save must restore the saved choice.

**Steps to reproduce**
1. Open a connector permission page with hundreds of actions.
2. Switch the agent access mode and select an agent.
3. Search, filter, or change an action permission.
4. Observe the repeated render work and delayed selection feedback.

**Paperclip version or commit**
The issue was reproduced against 3659a3a947. The branch also includes
the current master revision.

## What Changed

- Show 50 actions per group at first. Keep full-list search and bulk
changes. Keep direct links to hidden actions usable.
- Mount each test dialog only when its Test button is used. Memoize
action rows and catalog groups.
- Show pending permission choices at once. Restore saved values after an
error. Update query data from the save response before the next edit.
- Limit new-action review controls to 50 at first. Keep full-list
selections and save results.
- Index agent grants and approval policies to remove repeated list
scans. Compare 100 and 500 actions to guard against quadratic growth.
- Use fresh cancellable permission reads so an older shared response
cannot replace saved choices. Share one page-size constant.
- Add regression tests with 500 actions and delayed save responses.

## Verification

- Failing-before tests showed 500 closed dialogs, 500 action rows, 500
repeated icon renders, delayed access selection feedback, and 500
new-action switches.
- A grant test failed when repeated entry scans exceeded 1,000 reads for
500 actions. The fixed path passes.
- Focused form, page, and group tests pass. They cover pending-save
rollback and a second edit while refresh reads remain pending.
- UI typecheck passes. An initial typecheck found a mutation return-type
error and a fixture cast error. Both were corrected.
- Final revision: `834f77e8b452eec85936591070df9e89d8eda091`.
- Final focused run: 120 tests pass across AppDetail, permission
controls, group changes, grant performance, API helpers, and the request
client. AI saves cover both access modes and saved install cache entries
during pending reads.
- Two tests use the real request client with shared reads started before
a save. Both fail without the fix when the old responses arrive after
the save. Both pass with fresh cancellable reads for connection,
install, profile, and policy data. The tool case also checks the next
save payload.
- The broad local selection passed 8,783 UI tests. Its overall result
was invalidated by later edits. Two unrelated CLI cases failed because
the sandbox starts with file mask 0077. Both test files pass all 24
tests with the expected mask: `umask 022; pnpm exec vitest run
cli/src/__tests__/install-store.test.ts
cli/src/__tests__/mcp-auth.test.ts`.
- Production Chromium checks use 500 actions and 100 agents. A quiet
sample measured mode changes at 49 ms (272 ms before), agent selection
at 30 ms (273 ms before), search clear at 89 ms (432 ms before), and
bulk write changes at 76 ms (300 ms before). All tested controls work.
Closed dialogs make no test-agent request. Opening Test makes one
request. Measurements are single samples and exclude provider network
latency.
- Greptile and Paperclip review both report 5/5 for the final revision.
All review threads are resolved.
- Final-revision CI passed on
`834f77e8b452eec85936591070df9e89d8eda091`: [run
44101128245](https://github.com/paperclipai/paperclip/actions/runs/44101128245).
This includes build, typecheck, general and serialized tests, browser
tests, and Runner verification. Checks ran on GitHub Actions Linux
runners.
- The private staging link was not accessible through the web tool.
Browser checks use a local component harness with 500 actions and 100
agents.

## Risks

- Large lists now require Show more to display further rows. Search and
bulk changes still use all matching actions.
- Pending choices affect the form display only. Server authorization
remains authoritative. The form prevents another save while one is
pending.
- The query cache now uses save responses. Regression tests cover failed
saves and edits during slow refresh reads.
- No schema or server API change is required.

## Model Used

OpenAI Codex, based on GPT-6, with reasoning, tools, and code execution.
This runtime does not expose a more specific model identifier.

## 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
- [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: Paperclip <noreply@paperclip.ing>
2026-11-17 08:32:16 -06: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.