Repository navigation
Conversation
… with results One "Include retired" switch in the results toolbar of concept and mapping searches (global search, source and collection pages) sets the results, the filter values and the filter counts together. Off by default in sources and global search, on in collections. Off sends retired=false and on sends includeRetired=true, on the list request and the facet request alike. The setting is kept in the URL (includeRetired, written only when it differs from the page's default); changing it starts again from page 1. The label shows the retired count when the facet response gives one. The Retired filter leaves the filter panel for these searches. A Retired filter in an old URL or a repository's saved default filters sets the switch instead (true,false or true alone: on; false: off), and new default filters don't save it. Repository searches keep their Retired filter. "Active" now always means not retired: a collection's summary shows all its concepts and how many are retired, a source's keeps its active count; collection version and expansion rows show all members, with the retired count once the API gives retired_concepts / retired_mappings; compact counts of summary.active_* say "Active Concepts" / "Active Mappings". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVNufohRXPK1DHpx7i
…pped; Searchlight keeps the switch From the first Codex pass on #110: - a slow list or filter-count answer for the switch's previous setting no longer overwrites the current one (each keeps only its latest request); - an applied filter value that loses all its matches shows 0, not its old count; - applying a Class or Map Type in Searchlight keeps includeRetired; - a Retired filter in a repository's saved defaults sets the switch's default there, so turning it back to the page default survives a reload, and saved defaults that held only that filter no longer leave the table on hierarchy roots; - returning from Matched Candidates keeps the retired count; - only an owner's /collections/ path segment makes a page a collection; - the count label test no longer depends on the machine's number format. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVNufohRXPK1DHpx7i
|
Codex review, pass 1 (codex-cli 0.169.0, commit a833560) Verdict: findings (8: 4 P1, 4 P2)
findings.json{
"reviewer": "codex-cli 0.169.0",
"perspective": "defects",
"mode": "full",
"commit": "a833560c",
"verdict": "findings",
"prior": [],
"findings": [
{
"id": "F1.1",
"severity": "P1",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 516,
"claim": "An older facet response can overwrite the counts for the current switch setting.",
"scenario": "Turn Include retired off while the facets request for the on setting is pending. If the older request finishes last, the list stays active-only but the filter panel shows counts that include retired concepts.",
"action": "Give each search a request identifier shared by its list and facet requests. Discard responses for superseded searches and show counts only when they match the displayed results.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.2",
"severity": "P1",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 544,
"claim": "An applied facet retains its old positive count when switching off retired results removes its last match.",
"scenario": "In a collection, apply the Drug class filter without a keyword when every matching drug is retired. Turn Include retired off. The list reports zero concepts and the API returns no Drug bucket, but the panel still shows the previous Drug count.",
"action": "Keep the applied value available to remove, but show a count of zero when its bucket is absent from the new response. Treat a missing facet field as an empty bucket list.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.3",
"severity": "P1",
"tag": null,
"file": "src/components/search/SearchInputDrawer.jsx",
"line": 140,
"claim": "Applying a Searchlight Class or Map Type filter drops the Include retired setting.",
"scenario": "Turn Include retired on in global concept search, then apply Class=Drug through Searchlight. The new URL keeps the class filter and drops includeRetired=true, so retired drugs disappear from the results.",
"action": "Carry the existing Include retired setting into Searchlight URLs for the same concept or mapping search while resetting pagination.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.4",
"severity": "P1",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 185,
"claim": "A legacy saved Retired filter can override the user's switch choice on reload.",
"scenario": "Open a source whose only saved filter is retired=true,false. It opens with Include retired on. Turn the switch off and reload. The URL dropped the switch parameter because off is the source default, so the saved filter turns the switch back on.",
"action": "Preserve enough URL state to distinguish an intentional return to the page default from a fresh visit that should apply the legacy saved filter.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.5",
"severity": "P2",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 147,
"claim": "Leaving Hierarchy can leave the table showing only hierarchy roots.",
"scenario": "Open a source with Hierarchy as its saved display and retired=false as its only saved filter. Switch to Table. Converting that filter leaves the URL unchanged, so no list or facet request runs and the table keeps the hierarchy response.",
"action": "When applying deferred defaults leaves the query string unchanged, fetch the page-one list and facets directly.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.6",
"severity": "P2",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 502,
"claim": "Returning from semantic match can leave the retired count missing.",
"scenario": "On a source version, run a keyword search with Include retired on and a visible retired count. Run semantic match for the same keyword, let it finish, then go Back. The match response discarded the stored count, and returning to the same keyword skips the facet request that would restore it.",
"action": "Refresh facets when leaving match mode so the restored results bar gets the retired count for that search.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.7",
"severity": "P2",
"tag": null,
"file": "src/components/search/retiredSwitch.js",
"line": 13,
"claim": "A source named collections gets the collection default.",
"scenario": "Open /orgs/MyOrg/sources/collections/HEAD/concepts/ without an override. The substring match turns Include retired on, so the source shows retired concepts by default.",
"action": "Determine repository type from the route's repository-type segment.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.8",
"severity": "P2",
"tag": null,
"file": "src/components/repos/__tests__/expansionCounts.test.js",
"line": 32,
"claim": "The new count-label test fails under locales that use a different grouping separator.",
"scenario": "Run the expansion count tests with LC_ALL=de_DE.UTF-8. The implementation correctly formats the total as 8.765, but the test requires 8,765 and fails.",
"action": "Build the expected interpolated value using the process locale, or use a fixture that does not require digit grouping.",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Responses to pass 1 (fixes in 2f2743b)
|
… page change overtakes From the second Codex pass on #110: - when a page or page-size change replaces a list request that was to refresh the filter counts, the newer request refreshes them; a list answer keeps the latest counts rather than the ones from when it was sent; - clearing the keyword in the search bar keeps includeRetired; - coming back from Matched Candidates refreshes the filter counts; - an includeRetired URL opens a saved Hierarchy display as a list, as filters do; - the active-count stand-in for 10,000-result totals isn't extended to retired=false; - the count label test formats both numbers the machine's way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVNufohRXPK1DHpx7i
|
Codex review, pass 2 (codex-cli 0.169.0, commit 2f2743b) Verdict: findings (6: 2 P1, 4 P2). Earlier: F1.1 regressed, F1.2 resolved, F1.3 resolved, F1.4 resolved, F1.5 resolved, F1.6 resolved, F1.7 resolved, F1.8 unresolved.
findings.json{
"reviewer": "codex-cli 0.169.0",
"perspective": "defects",
"mode": "verify",
"commit": "2f2743be",
"verdict": "findings",
"prior": [
{
"id": "F1.1",
"status": "regressed"
},
{
"id": "F1.2",
"status": "resolved"
},
{
"id": "F1.3",
"status": "resolved"
},
{
"id": "F1.4",
"status": "resolved"
},
{
"id": "F1.5",
"status": "resolved"
},
{
"id": "F1.6",
"status": "resolved"
},
{
"id": "F1.7",
"status": "resolved"
},
{
"id": "F1.8",
"status": "unresolved"
}
],
"findings": [
{
"id": "F2.1",
"severity": "P1",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 458,
"claim": "Changing the page size during a retirement refresh can leave the filter counts on the previous switch setting.",
"scenario": "In an unfiltered concept listing with Include retired on, turn it off and change the page size before the list returns. The page-size request supersedes the switch request and skips facets, so the active-only rows retain counts that include retired concepts. If the switch request already started its facet fetch, the page-size response can still overwrite the new counts with its older snapshot.",
"action": "Refresh facets independently of pagination when the search criteria change, and preserve the latest facet state when a list response arrives.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F2.2",
"severity": "P1",
"tag": null,
"file": "src/components/search/SearchInput.jsx",
"line": 159,
"claim": "Submitting an empty Searchlight query drops the Include retired override.",
"scenario": "Turn Include retired on in global concept search, clear the keyword in Searchlight, and press Enter. The resulting URL keeps only the resource type, so the unfiltered list hides retired concepts.",
"action": "When clearing the keyword, preserve the current Include retired override on the same search page.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F2.3",
"severity": "P2",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 286,
"claim": "Leaving semantic match can carry facet counts from a different keyword into the regular results.",
"scenario": "On a source version with Include retired on, run a regular search for malaria, run semantic match for insulin, then submit insulin as a regular search. The list updates to insulin, but the filter panel and retired count still describe malaria because leaving match mode suppresses the facet request.",
"action": "On return to regular search, refresh facets unless the stored counts match the current keyword, filters, and retirement setting.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F2.4",
"severity": "P2",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 78,
"claim": "A saved Hierarchy display can prevent a shared URL from applying its retirement override.",
"scenario": "Open a source whose saved display is Hierarchy, switch to Table, turn Include retired on, and reload. The URL still has includeRetired=true, but the page opens in Hierarchy, hides the switch, and sends onlyHierarchyRoot without the retirement setting.",
"action": "Treat an explicit retirement override as a list filter when choosing the initial display, just as the code treats the filters parameter.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F2.5",
"severity": "P2",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 468,
"claim": "The results bar can use the default expansion's count for a different expansion.",
"scenario": "A collection version's default expansion has 23,000 active concepts. Select an alternate expansion with exactly 10,000 active concepts and turn Include retired off. When the API reports 10,000, the results bar substitutes 23,000 from the collection version's summary.",
"action": "Use a summary as a fallback only when it describes the exact expansion being queried.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F2.6",
"severity": "P2",
"tag": null,
"file": "src/components/repos/__tests__/expansionCounts.test.js",
"line": 32,
"claim": "The count-label test still fails under locales that use non-Latin digits.",
"scenario": "Run the expansion count tests with LC_ALL=ar_EG.UTF-8. The implementation formats the retired count as ٤٧٦, but the assertion still expects the literal 476.",
"action": "Format both expected counts with toLocaleString().",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Responses to pass 2 (fixes in a065958)
|
…h; a new search drops counts on their way for the last From the third Codex pass on #110: - clearing the keyword keeps includeRetired on every search page, including /search/ with no type in the URL; - a search that changes the filter counts drops a counts answer still on its way for the previous one, so active-only rows never show beside counts that include retired. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVNufohRXPK1DHpx7i
|
Codex review, pass 3 (codex-cli 0.169.0, commit a065958) Verdict: findings (4: 1 P1, 3 P2). Earlier: F1.1 resolved, F1.2 resolved, F1.3 resolved, F1.4 resolved, F1.5 resolved, F1.6 resolved, F1.7 resolved, F1.8 resolved, F2.1 resolved, F2.2 unresolved, F2.3 resolved, F2.4 resolved, F2.5 resolved, F2.6 resolved.
findings.json{
"reviewer": "codex-cli 0.169.0",
"perspective": "defects",
"mode": "verify",
"commit": "a0659581",
"verdict": "findings",
"prior": [
{
"id": "F1.1",
"status": "resolved"
},
{
"id": "F1.2",
"status": "resolved"
},
{
"id": "F1.3",
"status": "resolved"
},
{
"id": "F1.4",
"status": "resolved"
},
{
"id": "F1.5",
"status": "resolved"
},
{
"id": "F1.6",
"status": "resolved"
},
{
"id": "F1.7",
"status": "resolved"
},
{
"id": "F1.8",
"status": "resolved"
},
{
"id": "F2.1",
"status": "resolved"
},
{
"id": "F2.2",
"status": "unresolved"
},
{
"id": "F2.3",
"status": "resolved"
},
{
"id": "F2.4",
"status": "resolved"
},
{
"id": "F2.5",
"status": "resolved"
},
{
"id": "F2.6",
"status": "resolved"
}
],
"findings": [
{
"id": "F3.1",
"severity": "P1",
"tag": null,
"file": "src/components/search/SearchInput.jsx",
"line": 160,
"claim": "Clearing a concept keyword still drops the retirement override when the URL omits type.",
"scenario": "Search globally for malaria and turn Include retired on. The toolbar writes /search/?q=malaria&includeRetired=true. Clear the keyword in Searchlight and press Enter. The URL becomes /search/ and retired concepts disappear.",
"action": "Preserve includeRetired on empty submissions even when the destination relies on the default concept type.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F3.2",
"severity": "P2",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 544,
"claim": "Reloading a filtered URL can hide applied filters whose only matches are retired.",
"scenario": "In a collection, apply Datatype=Coded and Locale=en when every concept matching both filters is retired. Turn Include retired off and reload. The first facet response has no matching buckets, so the panel hides both selections and offers no way to remove just one.",
"action": "Keep applied facet values visible with zero counts using the URL's selections, even when there are no earlier facet results.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F3.3",
"severity": "P2",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 478,
"claim": "Newly loaded rows can appear alongside counts from the opposite switch setting.",
"scenario": "Turn Include retired off while the previous facet request is pending. If the old facets arrive before the active-only list, that list preserves the old counts. The active-only rows then appear alongside counts that still include retired concepts until the new facet request completes.",
"action": "Invalidate facet responses when the retirement setting changes and withhold counts until they match the displayed results.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F3.4",
"severity": "P2",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 746,
"claim": "A completed collection removal can reload results using a superseded retirement setting.",
"scenario": "On a collection HEAD, turn Include retired off and confirm a bulk removal. While the delete is pending, use browser Back to restore Include retired on. When the delete succeeds, its refresh sends retired=false. The checked switch then stays above active-only rows and counts until another search.",
"action": "Refresh the current URL-derived search after removal instead of reusing the search state captured at confirmation.",
"lines_delta": null,
"confidence": "high"
}
]
} |
|
Responses to pass 3 (fixes in a84ecad; this was the third and last defect pass)
No P0 or P1 open. Commits after a065958 still need the final check of that range. |
…ollections; label reads Include Retired With the switch off, sources and global search now send no retired param: the API already leaves retired ones out there, and a plain listing stays off the search index, so paging past 10,000 results works as before. Collections keep sending retired=false when off, and on is includeRetired=true everywhere. In sources and global search the filter counts follow the list once the oclapi2 change for this ticket makes facets use the default retired rule. The switch reads "Include Retired", as the concept page's chip does; the other locales already use their chip's wording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVNufohRXPK1DHpx7i
…saved Retired defaults ignored - The switch's default is isCollectionSearchURL itself (renamed from isCollectionURL, which versionsTab.styles.js also exports with a looser match). - A saved Retired default filter no longer sets the switch: getRepoDefaultFilters already leaves it out, and no repository on production has one. - hasRetiredSwitch compares the two resources directly; Number.isFinite replaces lodash isNumber. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVNufohRXPK1DHpx7i
|
Simplification review (Claude subagent, commit 21c130b). Responses; applied in 50e6355:
|
…keep the 10,000-result paging cap The API runs them on the search index with or without a keyword, so Last Page past 10,000 results returned 400 (also on main; a065958's retired=false had hidden it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVNufohRXPK1DHpx7i
|
Codex check of commits a065958..50e6355 (codex-cli 0.169.0, commit 50e6355) Verdict: 1 P1, 1 P2.
findings.json{
"reviewer": "codex-cli 0.169.0",
"perspective": "defects",
"mode": "final",
"commit": "50e63553",
"verdict": "findings",
"prior": [],
"findings": [
{
"id": "FC.1",
"severity": "P1",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 407,
"claim": "A keyword-free global search exposes pagination beyond the API's 10,000-result window.",
"scenario": "Open /search/ with Include Retired off and more than 10,000 active concepts, then click Last Page. Removing retired=false makes the UI treat the request as a database listing. Axios still sends q= and APIService sends INCLUDESEARCHLATEST, so the API uses Elasticsearch and rejects the page. At a0659581, the UI capped pagination and hid Last Page.",
"action": "Keep the pagination cap for global concept and mapping requests that send q with INCLUDESEARCHLATEST, including when q is empty. Cover that request shape in a pagination test.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "FC.2",
"severity": "P2",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 100,
"claim": "Upgrading discards an existing source's saved preference to include retired concepts.",
"scenario": "On a self-hosted instance, open a source whose saved concept filters contain retired: \"true,false\", with no URL override. At a0659581 the switch opened on and showed both active and retired concepts. Now it opens off and hides the retired concepts because the saved filter is discarded.",
"action": "Restore the translation from a saved Retired filter to the switch default. Keep an explicit URL setting authoritative.",
"lines_delta": null,
"confidence": "high"
}
]
}Responses
|
Independent review (Claude, with Codex second opinion)Reviewed at 35ede39 against Verdict: not ready to merge. Two items come first:
Codex refuted none of my findings. Where we differ on severity is listed at the end. P11.
P22. Matched Candidates (
3 (pair). With the switch off, a collection can't page past 10,000 results. P3
Earlier acceptances I agree with.
Where Codex and I differ on severity:
Codex blind defect pass on this PR (codex-cli 0.169.0, xhigh, commit 35ede39): 9 findings (F1.1 and F1.2 are pair findings on oclapi2#1019; F1.3 = 4, F1.4 = FC.2 accepted earlier, F1.5 = 2, F1.6 = 6, F1.7 = 3, F1.8 = 7, F1.9 = the facet cache, item 4 on oclapi2#1019)
{
"reviewer": "codex-cli 0.169.0",
"perspective": "defects",
"mode": "full",
"commit": "35ede39fed87f9d32e1ba7ba1d9600a49a6e6c19",
"verdict": "findings",
"prior": [],
"findings": [
{
"id": "F1.1",
"severity": "P1",
"tag": null,
"file": "src/components/search/retiredSwitch.js",
"line": 23,
"claim": "Deploying TBv3 first or rolling back the API brings back the count mismatch the ticket fixes.",
"scenario": "With the new TBv3 and the old API, the switch is off in CIEL v2026-10-23. The list excludes retired drugs, but the Class facet still includes them because the request sends no retired filter and the old API skips the default retired rule for facets. In a collection, switching off sends retired=false, which makes the old API omit the retired bucket, so the switch loses its count.",
"action": "Gate the switch on an API capability or provide compatible facet and retired-count requests for the old API. Cover API rollback in the rollout check.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.2",
"severity": "P1",
"tag": null,
"file": "src/components/repos/ExpansionRowList.jsx",
"line": 83,
"claim": "The stated API-first deployment makes the current TBv3 undercount collection and expansion members.",
"scenario": "An expansion has 8,289 active concepts and 476 retired concepts. After the API deploy, a browser still running the current TBv3 bundle reads active_concepts as the total in both the expansion row and its collection version row. Those rows drop from 8,765 to 8,289 while the collection still contains 8,765 concepts.",
"action": "Stage the expansion count change additively, or ship a compatible reader before changing the meaning of the existing fields.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.3",
"severity": "P1",
"tag": null,
"file": "src/components/search/ResultConstants.js",
"line": 141,
"claim": "Repository search keeps the Retired filter in the panel and has no results-bar switch.",
"scenario": "Open the global Repositories tab for a search with active and retired repositories. The panel still shows Retired, and the results bar offers neither the switch nor the retired repository count, even though the paired API returns the retired bucket.",
"action": "Apply the URL-backed switch and facet-panel removal to repository searches as well.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.4",
"severity": "P1",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 329,
"claim": "The migration silently discards saved repository defaults that include retired concepts.",
"scenario": "A source owner saved both Retired values as the default filter. Opening the source without query parameters previously included retired concepts for all visitors. The new code strips the saved Retired field and initializes the switch from the source default, so those concepts disappear until each visitor turns the switch on.",
"action": "Use the saved setting when initializing or resetting the switch, give explicit URL settings precedence, and preserve the switch setting when saving defaults.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.5",
"severity": "P1",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 320,
"claim": "Matched Candidates loses the ability to include retired concepts.",
"scenario": "Open an existing $match URL whose Retired filter selects both values. The base frontend converted that filter to includeRetired=true for the match request. The PR strips the filter, skips the new request parameters for $match, and hides the switch in Matched Candidates. The API then excludes retired candidates and the user cannot bring them back from that screen.",
"action": "Pass the retired setting to $match and retain a way to change it in Matched Candidates.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.6",
"severity": "P1",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 484,
"claim": "The switch publishes new results while the filter panel still shows selectable counts from the previous setting.",
"scenario": "Turn the switch off in a source while a class contains only retired concepts. The list completes before the facet request starts and replaces the rows while retaining the previous facets. During that request, the panel still offers the retired-only class with its old positive count, and applying it leads to an empty result set.",
"action": "Clear or disable stale facets when the switch changes, or publish the new rows and facets together. Test with a delayed facet response.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.7",
"severity": "P2",
"tag": null,
"file": "src/components/search/retiredSwitch.js",
"line": 23,
"claim": "Turning the switch off limits unfiltered collection browsing to the first 10,000 active members.",
"scenario": "Open an expansion with 12,000 active concepts and no keyword or other filters. The default list can page through all members. Switching off sends retired=false, which forces Elasticsearch and stops pagination at its 10,000-result window.",
"action": "Use includeRetired=false with the paired API so an otherwise unfiltered collection list keeps database pagination. Use the legacy facet filter only where compatibility requires it.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.8",
"severity": "P2",
"tag": null,
"file": "src/components/search/retiredSwitch.js",
"line": 62,
"claim": "The switch omits the count when a successful search has zero retired matches.",
"scenario": "Search for a term that matches active concepts only. The paired API returns a false bucket with no true bucket, as its integration test expects. The frontend renders Include Retired without a number. The frontend test reaches the zero display state only by supplying a true bucket with a zero count.",
"action": "Represent zero explicitly in the API response or infer it after confirming the backend supports the new facet contract. Test the response shape the paired API actually returns.",
"lines_delta": null,
"confidence": "high"
},
{
"id": "F1.9",
"severity": "P2",
"tag": null,
"file": "src/components/search/Search.jsx",
"line": 533,
"claim": "A cached pre-deploy facet response can keep the old counts visible after the API-first rollout.",
"scenario": "A user opens the unfiltered first page of a source's latest version before deploy, warming the Redis facet cache. The new frontend sends the same switch-off facet query, and the paired API can serve the old cached payload for up to 24 hours without running its new retired rule.",
"action": "Version or invalidate the affected source facet cache entries as part of the API rollout.",
"lines_delta": null,
"confidence": "high"
}
]
} |
The TBv3 half of OpenConceptLab/ocl_issues#3057. Filter counts in TBv3 included retired concepts while the result list hid them (CIEL v2026-10-23, Class = Drug: 8,765 in the panel, 8,289 in the list). One "Include Retired" switch in the results toolbar now drives the results, the filter values and the filter counts together, and "active" always means not retired.
Draft for a look at the visuals first.
What changes
The switch (concept and mapping searches: global search, source pages, collection pages)
includeRetired=true|false, written only when it differs from the page's default, so it survives reload and Back. Changing it starts again from page 1 and refetches results and filter counts together.Request contract (shared with OpenConceptLab/oclapi2#1019)
retired=falseincludeRetired=trueincludeRetired=trueThe list request and the filter (facet,
facetsOnly=true) request send the same. With the switch off, sources and global search send nothing because the API already leaves retired ones out of their results, and a plain listing stays off the search index, so paging past 10,000 results keeps working.Deploy order: OpenConceptLab/oclapi2#1019 first, then this.
retired=falsefilters both).retiredfield,truevalue, and shows only when that value is there (never "(0)" for a missing one). Today it shows in sources and global search in both states, and in collections only when on: withretired=falsethe API leaves thetruevalue out. Once the oclapi2 PR returns both values of the Retired facet, it shows in every state.The Retired filter leaves the filter panel for concept and mapping searches.
true,false→ on,false→ off. A retired-only filter (true) can't be expressed with the switch, so it turns the switch on (active and retired, each retired one marked Retired). The URL's ownincludeRetiredwins.retiredentry in them is left out, and new saved defaults never include it. (No repository on production hasretiredin its saved default filters.)retired=false), so a switch there would have nothing to show.Counts and wording ("active" = not retired)
retired_concepts/retired_mappingsto expansion summaries (total = active + retired). On today's API, where the expansion'sactive_conceptsis already the total, they show that number as "8,765 concepts". A version with no expansion falls back to its own summary, labelled "Active Concepts".summary.active_*say so: the tooltips in repository search rows and source version rows, the repository hover card, the version picker table and the version comparison rows now read "Active Concepts" / "Active Mappings".Checked in the app
Local build against the production API, signed in as a test account.
The test collection's summary panel reads "8,765 concepts (476 retired)" at HEAD and at v1. Reload keeps the setting; Back returns to the previous one. An old
filters={"retired":"true,false"}URL opens with the switch on;{"retired":"false", ...}with it off and the other filters kept.The
issues#3057-screenshotsbranch holds only these images and can be deleted after review.Worth knowing
retired=false, a filter, so a collection of more than 10,000 members gets the 10,000-result paging window the UI already applies to filtered searches.Design system
The switch reuses the existing "Include Retired" chip on a concept's associations (
Associations.jsx: MUI Chip, tick icon and filledprimary.90when on, outlined when off). The OCL v3 design system has no on/off toggle for a filter or results toolbar; this is a gap to fill there, with this chip as the candidate pattern. The label reads "Include Retired", as that chip and the other toolbar buttons do (es, pt-BR and zh use their chip's wording).Tests
npm test: 179 pass, 0 fail. New:src/components/search/__tests__/retiredSwitch.test.js(defaults, request params, old-URL mapping, URL precedence, Searchlight URLs, retired count) andsrc/components/repos/__tests__/expansionCounts.test.js(expansion and version counts before and after the API change, labels)../node_modules/eslint/bin/eslint.js src --ext .jsx,.js: clean.Review
Three Codex defect passes, posted below with responses. Fixed: answers to an earlier search no longer overwrite the current list or counts (including a page change that overtakes a switch change), Searchlight and clearing the keyword keep the switch, an includeRetired URL opens a saved Hierarchy display as a list, and an applied filter value with no matches left shows 0. Two P2s accepted as behaviour that predates this PR (see the pass 3 reply). Since then the "off" request changed per context and the label casing changed (21c130b); the simplification review then removed the saved-default mapping and an alias (50e6355). A Codex check of a065958..HEAD follows below.
closes OpenConceptLab/ocl_issues#3057
🤖 Generated with Claude Code
https://claude.ai/code/session_01AaZ4qVNufohRXPK1DHpx7i