Skip to content

Issues#2486#14

Merged
snyaggarwal merged 3 commits into
mainfrom
issues#2486
Apr 27, 2026
Merged

Issues#2486#14
snyaggarwal merged 3 commits into
mainfrom
issues#2486

Conversation

@snyaggarwal
Copy link
Copy Markdown
Contributor

Linked Issue

Closes OpenConceptLab/ocl_issues#2486

Screenshots
Screenshot 2026-04-27 at 10 55 11
Screenshot 2026-04-27 at 10 56 13

@snyaggarwal snyaggarwal requested a review from paynejd April 27, 2026 05:26
Copy link
Copy Markdown
Member

@paynejd paynejd left a comment

Choose a reason for hiding this comment

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

LGTM — clean implementation. Row-click navigation, hover affordance, and kebab menu all match the ticket spec. Good scope discipline keeping Controls.jsx out. One minor note: confirm primary.95 exists in the MUI theme so the hover highlight applies.

@snyaggarwal snyaggarwal merged commit 6e75945 into main Apr 27, 2026
1 check passed
paynejd added a commit that referenced this pull request May 12, 2026
Addresses 6 issues from @snyaggarwal's latest PR comments — including two
regressions I introduced in 2d96c09 (#11, #14) — plus four target-repo /
table-view / bridge-config fixes from @paynejd's local testing.

#14 — Score shows NaN%.
viewBuilders.getScoreDetails now returns rerankScore='' and algoScore=''
when no numeric value is present, instead of parseFloat(null).toFixed(2)
yielding the literal string 'NaN%'. The mapped CIEL concept in the
Target Code panel shipped a visible NaN% chip because legacyToRowView
(introduced 2d96c09) passes search_meta values that may be undefined
when the mapping projection lost them.

#11 — Rerank fires on every row visit.
scheduleRerank now gates on display_name presence: a concept_row is
rerank-eligible only when its ConceptDefinition has a usable name. The
2d96c09 fix that filtered name-less rows out of buildRerankRowsForRow
correctly stopped the -100000 reranker sentinel, but its corollary —
those rows stay rerank_score=undefined forever — caused the scheduler
to re-fire on every row open. writeConceptCachePatch now chains into
scheduleRerank for every row referencing a concept_key whose patch
transitions display_name from absent to present (e.g. ensureLoaded
completing on a bridge cascade target).

#13 — AutoMatch doesn't auto-select even when top candidate qualifies.
Resolves transitively with #11: bridge cascade targets that previously
stayed rerank_score=undefined now receive a score after ensureLoaded
completes + the chained scheduleRerank fires. pickTopRowView's
rerank_score ?? -1 fallback no longer keeps them stuck at the bottom.

Target-repo filtering (Quality view + Map button).
Quality (score-grouped) view now ONLY shows target-repo concepts.
Bridge intermediaries (CIEL when target is ICD/LOINC) are reference
metadata about the cascade, not mappable themselves; surfacing them in
Quality view double-counted and confused the bucketing. Algorithm view
keeps the full mix so users can browse by-algorithm. Implementation:
Candidates accepts a `targetCanonical` prop (sourced from
buildProjectContext().target_repo.canonical_url, the same canonical the
normalizer used to stamp ConceptDefinition.reference.url, so the
comparison is exact) and filters qualityRowViews against it.

Same canonical gates the Map button everywhere. The action column in
both table and card views now hides MapButton for non-target-repo
concepts. Concept.jsx Item renders a placeholder spacer for the bridge
intermediary's algoScoreFirst row (reverting the 2d96c09 fix that had
shown a Map indicator there) — bridge intermediaries can't be mapped,
and Unified view no longer surfaces them anyway after this commit.

Table view broken (display='table' in Candidates).
TableResults reads ALL_COLUMNS['concepts'] paths that expect the legacy
concept shape (id, url, names, descriptions, source, search_meta, ...)
at top level. The rowsForTable decoration in 2d96c09 only added id/url
for click lookup, leaving the table cells blank. Now spreads the
conceptForMapping projection first, then the rowView fields (no
collision between the two — different keys), then sets id/url/version_url
explicitly at the end for handleRowClick.

#12 — First-time row click with bridge: API returned candidates, UI shows
none. Auto-Match works in the same setup.
buildProjectContext's bridge_repo was only constructed when
bridgeAlgo.target_repo_url was truthy. When a user adds the bridge algo
and accepts the placeholder default '/orgs/CIEL/sources/CIEL/' without
editing the field, sel.target_repo_url stays undefined — so on the next
fetch, projectContext.bridge_repo is absent, the normalizer's
resolveReference returns null for every bridge primary, normalizeAlgoResult
returns the empty triple, and rowState ends up with zero candidates.
Auto-Match exhibits the same code path but apparently works in Sunny's
env (likely his algo state has target_repo_url populated by some other
write path; the manual-click flow is the one that surfaces it). Fix:
buildProjectContext falls back to a per-type default
(BRIDGE_DEFAULT_RELATIVE_URL['ocl-ciel-bridge'] = '/orgs/CIEL/sources/CIEL/')
matching the MultiAlgoSelector placeholder. Generic 'ocl-bridge' algos
without target_repo_url still fail (no canonical default makes sense),
but that's expected per the spec — the user must set it.

Verified: 79/79 tests pass, eslint clean. Local in-browser: legacy
project loads, candidates render, Quality view shows only target-repo
concepts, table view shows full columns, Auto-Match selects correct
rows, no rerank re-fire loop on row visits, no NaN% chips. Bridge /
scispacy / AI Assistant exercise still gates merge per the original
PR description; the remaining open items are S6 (Auto Match no calls
with bridge-only algo — pending Sunny's diagnostics) and verifying
the above fixes against his environment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Mapping Projects dashboard: row click to open + actions menu

2 participants