Skip to content

OpenConceptLab/ocl_issues#2945 | show Add to Collection on an open concept to anyone signed in - #70

Merged
paynejd merged 1 commit into
mainfrom
ocl_issues-2945-add-to-collection
Oct 22, 2026
Merged

paynejd merged 1 commit into
mainfrom
ocl_issues-2945-add-to-collection

Conversation

@paynejd

@paynejd paynejd commented Oct 22, 2026

Copy link
Copy Markdown
Member

What changed and why

An open concept's Add to Collection button (ConceptHeader) showed only when currentUserHasAccess() was true, which checks whether the signed-in user owns the page's URL owner. So the button was missing on other owners' repos (CIEL, for example), on collection pages and in global search, which is where people find concepts to add to their own collections. The bulk Add to Collection button in the results toolbar already needed only a sign-in.

  • The open concept's button now shows to anyone signed in (isLoggedIn()), matching the bulk button. Signed out, it doesn't show.
  • Edit, retire, clone and create-similar keep their existing checks, unchanged.
  • Opening a concept still doesn't touch the checkbox selection, and the dialog is unchanged.
  • The button label in ConceptHeader and ConceptCard now uses the existing addToCollection.add_to_collection key instead of hard-coded English. No new keys. pt-BR now shows the existing "Adicionar à coleção". es and zh have no addToCollection section yet (a gap that predates this PR: the dialog already falls back to English there), so the label falls back to English as before.

ConceptHeader renders in one place (ConceptHome), which serves the side panel in global search, repo and collection pages, and the full concept page (/orgs/.../concepts/<id>/), so all four behave the same.

How I verified it

  • eslint --ext .jsx,.js src/: clean. npm test: 20/20 pass.
  • Local dev build against prod data (read-only GET proxy) driven by a headless browser, signed in as a fake non-staff user (is_staff: false, no orgs; a staff user would make currentUserHasAccess() true and hide the bug), then signed out. Before (origin/main) vs after:
Where the concept is opened (public CIEL concepts) Signed in, before Signed in, after Signed out, after
Full concept page /orgs/CIEL/sources/CIEL/concepts/116128/ no button button no button
CIEL source concept list no button button no button
Global search (malaria, Source = CIEL) no button button no button
Collection page /orgs/CIEL/collections/MPX/ no button button no button

Selected checkboxes in the results list were 0 before and 0 after opening a concept, in every case. Clicking the button opens the unchanged Add to Collection dialog.

Full concept page, signed in (non-staff): before / after

before
after

Global search, signed in (non-staff): before / after

before
after

More screenshots: collection page, dialog, signed out

collection page, after
dialog, after
signed out, after

The screenshots/ocl_issues-2945 branch holds only these images and can be deleted after review.

closes OpenConceptLab/ocl_issues#2945

🤖 Generated with Claude Code

https://claude.ai/code/session_01TjM9dGow2KV1Gwr2dWQdph

…open concept to anyone signed in

The open concept's Add to Collection button was gated on owning the page's
URL owner, so it was missing on other owners' repos and in global search.
It now needs only a sign-in, like the bulk button in the results toolbar.
Edit, retire, clone and create-similar keep their existing checks. The
button label now uses the existing addToCollection.add_to_collection key
in ConceptHeader and ConceptCard.

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

@paynejd paynejd left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codex review, pass 1 (codex-cli 0.163.0, commit a6e7f0d)

Verdict: clean. No findings.

findings.json
{
    "reviewer": "codex-cli 0.163.0",
    "perspective": "defects",
    "mode": "full",
    "commit": "a6e7f0d2",
    "verdict": "clean",
    "prior": [],
    "findings": []
}

@paynejd paynejd left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplification review (fresh Claude subagent, commit a6e7f0d)

Verdict: clean. Nothing to cut. No commits landed after Codex pass 1, so no follow-up Codex check is needed.

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

@paynejd
paynejd merged commit 60d57af into main Oct 22, 2026
2 checks passed
@paynejd
paynejd deleted the ocl_issues-2945-add-to-collection branch October 22, 2026 18:23
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.

TBv3: show Add to Collection on an open concept to anyone signed in

1 participant