Skip to content

OpenConceptLab/ocl_online#785 | A new project stopped at the limit shows the API's notice - #146

Open
paynejd wants to merge 3 commits into
mainfrom
OpenConceptLab/ocl_online-785-project-limit
Open

paynejd wants to merge 3 commits into
mainfrom
OpenConceptLab/ocl_online-785-project-limit

Conversation

@paynejd

@paynejd paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member

Linked Issue

Advances OpenConceptLab/ocl_online#785

What this changes

When someone can't start another map project, the Mapper shows the notice the API sends, in the notice dialog it already has.

The Mapper stops a new or copied project from its own cached numbers, before it asks the API to create it, so the API's notice for that limit never showed. It now asks GET /capabilities/mapper.projects/note/ first: the route it already asks for the line under a new project's owner, which may now also answer with a notice. That covers the New button, "create similar" in the list and inside a project, and opening /map-projects/new directly.

With no notice (an API without the route, an older one, a failure, or no answer in 5 seconds) it shows its own dialog, as before. That dialog's sentence no longer says that deleting one project frees a slot, because it doesn't for someone who is past the limit.

Two small changes to the notice dialog: a limit that never resets has an info icon on its line in place of the calendar, and a long title's lines are evened out.

How it was checked

npm test (833) and npm run test:integration (20) pass, and ESLint is clean. In a browser against a local API, at 1440 and 390 px and in the four languages: past the limit, at it, with no notice, with no route, every way to start a project, and someone who has room.

Existing pieces used

Piece Component
The dialog, its line and its buttons LimitNotice
The dialog when there's no notice QuotaDialog

Order

It can be released before or after the API's parts: until the API sends a notice, the Mapper shows its own dialog.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AaZ4qVzyaMUV7QSvivXit7

paynejd and others added 3 commits December 3, 2026 01:34
…ows the API's notice

The Mapper stops a new or copied project from its own numbers, before it asks
the API, so the API's notice for that limit never showed. It now asks for it
first, and shows its own sentence only when there's none. That sentence no
longer says that deleting one project frees a slot, which isn't so for someone
past the limit.

In the notice dialog, the line of a limit that never resets has an info icon
in place of the calendar, and a long title's lines are evened out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVzyaMUV7QSvivXit7
… time; the Mapper's own sentence says only what's so

A late answer could reopen a dialog already closed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVzyaMUV7QSvivXit7
…a refusal shown meanwhile

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qVzyaMUV7QSvivXit7
@paynejd

paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Codex review, pass 1 (codex-cli 0.169.0, commit fdf4d41)

Verdict: findings, 1 finding.

  • F1.1 P1 MapProject.jsx:6569 A late Copy response can reopen a dialog the user already dismissed.
findings.json
{
  "reviewer": "codex-cli 0.169.0",
  "perspective": "defects",
  "mode": "full",
  "commit": "fdf4d41",
  "verdict": "findings",
  "prior": [],
  "findings": [
    {
      "id": "F1.1",
      "severity": "P1",
      "tag": null,
      "file": "src/components/map-projects/MapProject.jsx",
      "line": 6569,
      "claim": "A late Copy response can reopen a dialog the user already dismissed.",
      "scenario": "At the project limit, a user chooses Create similar inside a project. The menu closes without visible feedback while the request is pending, so the user tries again. If the second request returns first and the user closes its notice, the first request can time out and reopen the fallback dialog without another click.",
      "action": "Allow only one blocked Copy lookup at a time. Add a regression test that retries while the lookup is pending and checks that the dialog stays closed after dismissal.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

@paynejd

paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Pass 1 (commit 8ab744f):

  • F1.1 (P1), fixed. Reproduced in a browser: choose "create similar" twice while the API is slow, close the notice, and it came back. Only one lookup runs at a time now. This component has no tests that render it, so the check is a browser one.

@paynejd

paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Codex review, pass 2 (codex-cli 0.169.0, commit 8ab744f)

Verdict: findings, 1 finding.

Earlier: F1.1 resolved

  • F2.1 P2 MapProject.jsx:6576 A delayed Create similar notice can replace a newer refusal dialog.
findings.json
{
  "reviewer": "codex-cli 0.169.0",
  "perspective": "defects",
  "mode": "verify",
  "commit": "8ab744f",
  "verdict": "findings",
  "prior": [
    {
      "id": "F1.1",
      "status": "resolved"
    }
  ],
  "findings": [
    {
      "id": "F2.1",
      "severity": "P2",
      "tag": null,
      "file": "src/components/map-projects/MapProject.jsx",
      "line": 6576,
      "claim": "A delayed Create similar notice can replace a newer refusal dialog.",
      "scenario": "While a match run is in progress, a user at the project cap chooses Create similar. The notice lookup is slow, and a match request hits its own limit and opens a dialog. When the Copy lookup finishes, it replaces the match dialog and hides the reason the run stopped.",
      "action": "Invalidate the pending Copy notice when a newer refusal is shown. Add a regression test that resolves the Copy lookup after a match refusal opens.",
      "lines_delta": null,
      "confidence": "high"
    }
  ]
}

@paynejd

paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Pass 2 (commit bf1df9e):

  • F2.1 (P2), fixed. If another refusal opened while Copy's notice was being asked for, that one stays.

@paynejd

paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Simplification review (a fresh Claude subagent, commit bf1df9e)

Verdict: clean.

findings.json
{
  "reviewer": "claude subagent",
  "perspective": "simplify",
  "mode": "full",
  "commit": "bf1df9e",
  "verdict": "clean",
  "prior": [],
  "findings": []
}

@paynejd

paynejd commented Dec 3, 2026

Copy link
Copy Markdown
Member Author

Codex check of commits 8ab744f..bf1df9e (codex-cli 0.169.0, commit bf1df9e)

Verdict: clean.

Earlier: F2.1 resolved

findings.json
{
  "reviewer": "codex-cli 0.169.0",
  "perspective": "defects",
  "mode": "final",
  "commit": "bf1df9e",
  "verdict": "clean",
  "prior": [
    {
      "id": "F2.1",
      "status": "resolved"
    }
  ],
  "findings": []
}

@snyaggarwal snyaggarwal left a comment

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.

Verdict: approve. Merge order for OpenConceptLab/ocl_online#785: OpenConceptLab/oclapi2#1118, then OpenConceptLab/ocl_online_api#133, then this one. Any order is safe, because with no notice the Mapper shows its own dialog.

Open core: clean. The Mapper renders the notice the API sends, through the existing LimitNotice/normalizeNotice(). It works nothing out, and the components and locale files gain no plan, upgrade or limit wording. The locale change goes the right way: it drops the "delete one to free a slot" sentence for a neutral "You can't start another map project.", and the dropped new_project key falls back to projects.default through QuotaDialog's key list. The cap icon is chosen from the API's kind, and textWrap: 'balance' is cosmetic.

Contract and fallback check:

  • fetchCapabilityNotice() reads data.notice from GET /capabilities/mapper.projects/note/, the same shape as the create refusal's notice. errorCode='mapper_projects_limit_reached' matches oclapi2's code.
  • On an open install the route is a 404, and a failure, a timeout or a missing title gives null, so the Mapper shows QuotaDialog as before. The tests cover each of these. projects_not_entitled and access never ask and still show PreviewLimitDialog.
  • Re-entrancy: New and "create similar" in the list are guarded by checkingNewProject. Copy inside a project is guarded by copyBlockPendingRef and never replaces a refusal already shown (Codex F1.1/F2.1, fixed by Jon).

Nits, none blocking:

  1. MapProject.jsx onCopyClick: during the wait of up to 5 s there's no busy state, unlike the list's checkingNewProject. On a slow API a Copy click looks like it did nothing until the dialog opens.
  2. Pre-existing, so this PR doesn't need to change it: if the note route answers with a message and notice: null, the API is saying there's room. The Mapper still shows the fallback because of its cached count. Refreshing the cache in that case would let a user with a stale cache go on. That's a possible follow-up.

CI is green.

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.

2 participants