Skip to content

OpenConceptLab/ocl_online#888 | Everyone who sees a collection's versions has their menu, so they can export one - #133

Open
paynejd wants to merge 3 commits into
mainfrom
ocl_online-888-collection-version-menu
Open

paynejd wants to merge 3 commits into
mainfrom
ocl_online-888-collection-version-menu

Conversation

@paynejd

@paynejd paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member

For OpenConceptLab/ocl_online#888. Based on main.

Everyone who sees a collection's versions now has the three-dot menu on each. It showed only to people who can edit the collection, so someone using a published value set couldn't download it from the app. A source's versions have always had the menu for everyone.

What it does now

Who A version's menu
Can edit the collection As before
Can only view it Explore Version, View attributes, Copy API URL, Export Version, External Exports, Compare with Previous, Expansions
Signed out The same, with the two exports off, as on a source
  • The button has the "Actions" tooltip that a source's has.
  • New Expansion is in the menu only for people who can edit, like everything else that writes.
  • Export Version on HEAD is off for people who can't edit, as the API exports HEAD only for editors. A source's menu offered it to everyone who was signed in, so that's the same now. There, the tooltip that the export is being generated shows only when it is.
  • An expansion's own menu follows the same rule. It showed everything to everyone, though the API only lets editors use it. People who can only view now have Details there.

The items of the two menus moved from CollectionVersionsTab.jsx to collectionVersionMenus.jsx, so that they can be tested.

How it was checked

  • 416 tests and the lint pass, with a new test for an editor, a viewer, a visitor and staff.
  • With a local API, in a browser at 1440 and 390, as an editor, as an account that can only view, and signed out: what each menu holds, and the tooltip.
  • An export downloaded as the account that can only view, and it holds the version's content.

Which goes first

  1. OpenConceptLab/ocl_online#887 | A signed-out visitor stays on a person's public repository #132 (OpenConceptLab/ocl_online#887). This menu gives a visitor Compare with Previous, and OpenConceptLab/ocl_online#887 | A signed-out visitor stays on a person's public repository #132 makes that page's Content tab say "Login is required" to them.
  2. This one.
  3. OpenConceptLab/ocl_online#884 | A collection's expansions page shows the health result by itself, and says Default only for the default #129, which waits for OpenConceptLab/ocl_issues#3004 OpenConceptLab/ocl_issues#3009 | The expansion marks and the newer-release panel show only with EXPANSION_MARKS_TOGGLE #122 anyway. It changes CollectionVersionsTab.jsx too, in other places.

They merge without a conflict in either order. The 439 tests and the lint pass on the three together, and the browser check ran on them together.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AaZ4qWierCikGzbXQj3GN3

paynejd and others added 3 commits December 4, 2026 05:57
…ions has their menu, and what writes is there only for people who can edit it

- The menu's button shows for everyone, with the "Actions" tooltip, as a source's does. Signed out, the exports are off.
- New Expansion, and in an expansion's own menu everything but Details, need edit access.
- What the two menus hold is in collectionVersionMenus.jsx, with a test for an editor, a viewer and a visitor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qWierCikGzbXQj3GN3
…ple who can't edit the repository, on a source too

The API exports HEAD only for them. Any other version is exported for everyone who's signed in and can view it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qWierCikGzbXQj3GN3
… being generated only when it is

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AaZ4qWierCikGzbXQj3GN3
@paynejd
paynejd requested a review from snyaggarwal December 4, 2026 11:27
@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Codex review, pass 1 (codex-cli 0.171.0, commit 378550b)

Verdict: 3 findings, 2 of them P0 or P1.

  • F1.1 (P1) src/components/repos/collectionVersionMenus.jsx:38: Export Version is enabled on HEAD for viewers whose export request the API always rejects.
  • F1.2 (P1) src/components/repos/collectionVersionMenus.jsx:40: The comparison opened by the new menu offers signed-out visitors a Content view that requires authentication.
  • F1.3 (P2): About existing code that this change does not touch. It is handled separately.
findings.json
{
 "reviewer": "codex-cli 0.171.0",
 "perspective": "defects",
 "mode": "full",
 "commit": "378550b67",
 "verdict": "findings",
 "prior": [],
 "findings": [
  {
   "id": "F1.1",
   "severity": "P1",
   "tag": null,
   "file": "src/components/repos/collectionVersionMenus.jsx",
   "line": 38,
   "claim": "Export Version is enabled on HEAD for viewers whose export request the API always rejects.",
   "scenario": "A signed-in viewer opens the HEAD menu on a public collection and clicks Export Version. The dialog requests `HEAD/export/`, which returns HTTP 405 because HEAD exports require collection edit access.",
   "action": "Disable Export Version on HEAD when `hasAccess` is false. Add a viewer test covering HEAD and a released version.",
   "lines_delta": null,
   "confidence": "high"
  },
  {
   "id": "F1.2",
   "severity": "P1",
   "tag": null,
   "file": "src/components/repos/collectionVersionMenus.jsx",
   "line": 40,
   "claim": "The comparison opened by the new menu offers signed-out visitors a Content view that requires authentication.",
   "scenario": "A signed-out visitor compares two public releases with default expansions, then selects Content. The API rejects the request to `expansions/$changelog/`, so the visitor gets no content diff or explanation in the comparison view.",
   "action": "Keep public comparison views available and show that signing in is required before requesting the content diff.",
   "lines_delta": null,
   "confidence": "high"
  },
  {
   "id": "F1.3",
   "severity": "P2",
   "tag": null,
   "file": null,
   "line": null,
   "claim": "About existing code that this change does not touch. It is handled separately.",
   "scenario": null,
   "action": null,
   "lines_delta": null,
   "confidence": "high"
  }
 ]
}

@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Answers to pass 1:

  • F1.1: fixed in d0f9284, for a source's menu too, with a test for an editor, a viewer and a visitor.
  • F1.2: not here. The change for OpenConceptLab/ocl_online#887 shows "Login is required" in that view and keeps the others open. It's the same page whether it's opened from this menu or from a link.
  • F1.3: about existing code, not this change. It's handled separately.

@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Codex review, pass 2 (codex-cli 0.171.0, commit d0f9284)

Verdict: 2 findings, 1 of them P0 or P1.

  • F2.1 (P1) src/components/repos/collectionVersionMenus.jsx:40: The newly available Export Version action lets viewers queue a job that writes to the collection version.
  • F2.2 (P2) src/components/repos/SourceVersionsTab.jsx:483: The source menu reports that an export is being generated when the viewer lacks permission to export HEAD.
findings.json
{
 "reviewer": "codex-cli 0.171.0",
 "perspective": "defects",
 "mode": "verify",
 "commit": "d0f928463",
 "verdict": "findings",
 "prior": [
  {
   "id": "F1.1",
   "status": "resolved"
  },
  {
   "id": "F1.2",
   "status": "unresolved"
  },
  {
   "id": "F1.3",
   "status": "unresolved"
  }
 ],
 "findings": [
  {
   "id": "F2.1",
   "severity": "P1",
   "tag": null,
   "file": "src/components/repos/collectionVersionMenus.jsx",
   "line": 40,
   "claim": "The newly available Export Version action lets viewers queue a job that writes to the collection version.",
   "scenario": "A signed-in viewer opens Export Version for a released collection version with no cached archive. The dialog offers Queue Export. (Shortened here.)",
   "action": "Pass the collection's edit permission to the export dialog and gate Queue Export on it. Keep cached downloads available to signed-in viewers and test the missing-archive case.",
   "lines_delta": null,
   "confidence": "high"
  },
  {
   "id": "F2.2",
   "severity": "P2",
   "tag": null,
   "file": "src/components/repos/SourceVersionsTab.jsx",
   "line": 483,
   "claim": "The source menu reports that an export is being generated when the viewer lacks permission to export HEAD.",
   "scenario": "A signed-in viewer hovers over the disabled Export Version item on a source's idle HEAD row. The tooltip says the export is still being generated, so the viewer is led to wait for an action that will remain unavailable.",
   "action": "Show the processing tooltip only when processing blocks the export. Give the HEAD permission restriction its own explanation.",
   "lines_delta": null,
   "confidence": "high"
  }
 ]
}

@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Answers to pass 2:

  • F2.1: intended, not changed. The API makes an export of a released version for everyone who's signed in and can view it, and a source's menu has always offered that in the same window. Without it, nobody could download a version that hadn't been exported before. An export changes none of the version's content.
  • F2.2: fixed in 59c9605. The tooltip shows only while the version is processing.

@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Codex review, pass 3 (codex-cli 0.171.0, commit 59c9605)

Verdict: 1 findings, 0 of them P0 or P1.

  • F3.1 (P2): About existing code that this change does not touch. It is handled separately.
findings.json
{
 "reviewer": "codex-cli 0.171.0",
 "perspective": "defects",
 "mode": "verify",
 "commit": "59c960593",
 "verdict": "findings",
 "prior": [
  {
   "id": "F1.1",
   "status": "resolved"
  },
  {
   "id": "F1.2",
   "status": "unresolved"
  },
  {
   "id": "F1.3",
   "status": "unresolved"
  },
  {
   "id": "F2.1",
   "status": "resolved"
  },
  {
   "id": "F2.2",
   "status": "resolved"
  }
 ],
 "findings": [
  {
   "id": "F3.1",
   "severity": "P2",
   "tag": null,
   "file": null,
   "line": null,
   "claim": "About existing code that this change does not touch. It is handled separately.",
   "scenario": null,
   "action": null,
   "lines_delta": null,
   "confidence": "high"
  }
 ]
}

@paynejd

paynejd commented Dec 4, 2026

Copy link
Copy Markdown
Member Author

Answers to pass 3:

  • F3.1: about existing code, not this change. It's handled separately.

Simplification review (a fresh Claude subagent, commit 59c9605): two small items, neither applied.

  • Merge two if (hasAccess) in the expansion's menu: kept apart, as it saves one line.
  • Delete the test "an action gets its version": kept. The actions moved to another file, and it's the one test that they still get their version.

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.

1 participant