Mapper: show orphan-algorithm candidates in the by-algorithm view#38
Open
paynejd wants to merge 1 commit into
Open
Mapper: show orphan-algorithm candidates in the by-algorithm view#38paynejd wants to merge 1 commit into
paynejd wants to merge 1 commit into
Conversation
…by-algorithm view
The by-algorithm grouping of the Candidates tab only iterated the
project's configured algorithms[], so candidates whose algorithm_id is
not in algosSelected (project reconfigured after running algorithms, or
PR3-C v1->v2 migration tags) appeared in no bucket — even though they
already render in the quality view and the AI payload, both gated by
target-repo membership rather than algorithm_id.
Add getOrphanAlgorithmIds(rowState, configuredIds) to viewBuilders (pure,
unit-tested) and, in getCandidates()'s algorithm branch, append one bucket
per orphan id after the configured algos using the existing
buildAlgorithmRowViews. Buckets use a synthesized algo {id, name, order:
Infinity} labeled 'Unrecognized algorithm (<id>)' and keep the by-algo
full mix (no target-repo filter; per-row mappability stays gated
downstream).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes OpenConceptLab/ocl_issues#2556
Problem
In the by-algorithm grouping of the Candidates tab,
getCandidates()iterates only the project's configured algorithms (algosSelected). A candidate'salgorithm_idcan legitimately fall outside that set — the project was reconfigured after running algorithms, or the PR3-C v1→v2 migration (oclmap#37 / ocl_issues#2555) saved a tag that doesn't match a configured algo id. Those "orphan-algo" candidates appeared in no bucket in the by-algorithm view, even though they already render in:— both gated by target-repo membership (
conceptBelongsToTargetRepo), never byalgorithm_id.Change
viewBuilders.js: add pure, unit-tested helpergetOrphanAlgorithmIds(rowState, configuredIds)→ the distinct candidatealgorithm_ids not in the configured set (first-seen order, null ids ignored).Candidates.jsx(getCandidates()algorithm branch): after the sorted configured algos, append one bucket per orphan id, built with the existingbuildAlgorithmRowViews. Each uses a synthesizedalgoof{id, name: t('map_project.unrecognized_algorithm'), order: Infinity}→ header renders asUnrecognized algorithm (<id>). The render path only readsalgo.name/algo.id/algo.type?.…, so the minimal synthesized object is safe.isTargetRepoView/conceptBelongsToTargetRepo, exactly as for configured algos.unrecognized_algorithmadded to en/es/zh.The existing
hasCandidates-desc /algo.order-asc ordering of configured algos is unchanged; orphans are concatenated strictly after all configured buckets.Tests
__tests__/views.test.jscoveringgetOrphanAlgorithmIds(null rowState, distinct/deduped orphans, all-configured →[], nullalgorithm_idignored, round-trip intobuildAlgorithmRowViews).npm test→ 141 pass / 0 fail.npm run eslint→ clean.webpackdev build compiles successfully.Out of scope
The migration itself (oclmap#37) and the quality view / AI payload (already surface these candidates).
🤖 Generated with Claude Code