Files
PaperClipAI/ui/src
12635af273 fix(ui): skip the GitHub star prompt for established companies (#22031)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The self-hosted board asks people to star GitHub after five
completed tasks.
> - The current prompt checks only whether five completed tasks exist.
> - This also interrupts established companies on their first visit
after an update.
> - This pull request records whether a company was first observed below
five tasks.
> - Eligible companies still receive the prompt when they reach five
tasks.

## Linked Issues or Issue Description

**What happened?**

The GitHub star modal appears for established companies with five or
more completed tasks. The query returns at most five tasks, so a company
with 100 completed tasks also meets the current trigger.

**Expected behavior**

Only companies first observed below five completed tasks should qualify.
Companies already at or above five should stay excluded.

**Steps to reproduce**

1. Use a self-hosted company with at least five completed tasks.
2. Open the board in a browser profile that has not shown the GitHub
star prompt.
3. Open the task list. The modal appears even though the milestone
happened earlier.

**Paperclip version or commit**

Reproduced from `cefef8f11d67`. The fix is rebased on `9c776cdf39`.

**Deployment mode**

Self-hosted server. This is a board UI bug and does not depend on an
agent adapter.

Related merged work: [initial star
prompt](https://github.com/paperclipai/paperclip/pull/20453) and [task
interruption
guards](https://github.com/paperclipai/paperclip/pull/20713). A search
for related issues and PRs found no open duplicate for milestone
eligibility. This small bug fix does not overlap planned roadmap work.

## What Changed

- Record eligibility from the first successful completed-task read.
First reads at five or more do not qualify.
- Save that decision per company in browser storage. Preserve
eligibility across reloads and company switches.
- Keep the existing cloud, onboarding, task-focus, retry, other-dialog,
and one-time display guards.
- Add regression coverage for established companies, milestone
completion, return visits, company switches, and failed reads. Document
the behavior in `doc/PRODUCT.md`.

## Verification

- The new regression tests failed on the old implementation for initial
counts of five and 100, and for a company switch.
- After the rebase, `cd ui && pnpm exec vitest run
src/components/GitHubStarPrompt.test.tsx` passed all 14 tests on
`beaa2f1c86e5c5281f8bc7f3914e54625a3f4767` on macOS with Node.js 26.4.0.
- An earlier `pnpm verify` attempt passed 505 UI test files. CLI
fixtures failed because the sandbox denied loopback listeners (`listen
EPERM`). All five blocked CLI suites passed on a focused rerun with
loopback access: 104 tests.
- Local `pnpm verify` exited 2 because `doc/PRODUCT.md` requires broad
CI coverage. The focused modal suite passed. The final CI run supplies
that broad coverage.
- CI on `beaa2f1c86e5c5281f8bc7f3914e54625a3f4767`: [Typecheck + Release
Registry](https://github.com/paperclipai/paperclip/actions/runs/44132073335/job/134211999908),
[Build](https://github.com/paperclipai/paperclip/actions/runs/44132073335/job/134211999799),
[Canary Dry
Run](https://github.com/paperclipai/paperclip/actions/runs/44132073335/job/134211999904),
all eight browser shards, all nine serialized-server suites, all
general-test shards, and the final [CI verification
gate](https://github.com/paperclipai/paperclip/actions/runs/44132073335/job/134264789640)
passed on GitHub-hosted Ubuntu runners. The PR has 59 passing checks and
three intentional skips, with no pending or failing checks. See the [CI
run](https://github.com/paperclipai/paperclip/actions/runs/44132073335).
- The [first server-shard 7
attempt](https://github.com/paperclipai/paperclip/actions/runs/44132073335/job/134212002338)
failed in the unchanged `issue-recovery-live-run-agent-census.test.ts`.
A background delivery pass did not settle within the fixture's 20-second
bound. All four tests in that file passed in an isolated local run in
67.46 seconds. A [single targeted CI
rerun](https://github.com/paperclipai/paperclip/actions/runs/44132073335/job/134257768504)
then passed without source changes. This proves recovery; the cause of
the earlier timeout is not established. The failed attempt remains part
of this record.
- [Greptile
review](https://github.com/paperclipai/paperclip/pull/22031#issuecomment-6955022258):
5/5 on the same revision, with no inline findings.
- `git diff --check` passed.

## Risks

Low risk. The change affects only an optional prompt. Eligibility
remains local to a browser and company. It does not sync between
devices. If browser storage is unavailable, the prompt stays hidden.
Companies first observed at or above five stay excluded even if tasks
are later reopened.

## Model Used

OpenAI GPT-6 through Codex. The exact deployment ID and context window
were not exposed. Used reasoning, terminal tools, and code execution.

## 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: Scott Tong <scott@scottsmbpm5max.lan>
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-11-17 11:38:25 -08:00
..
…