[MC-460-A] fix(frontend): scroll active concept into view in Compare/Tags too#650
Merged
Merged
Conversation
…Tags too The sidebar auto-scroll effect only depended on selectedRealizationKey. Annotate navigates by realization (which sets that key), but Compare/Tags navigate by concept via goToConceptOffset, which clears selectedRealizationKey and only updates conceptId. The effect bailed on the null key, so the concept menu never followed the selection outside Annotate. Fall back to the active concept's parent row ([data-testid=concept-parent-button-N]) when no realization is selected, and add conceptId to the dependency array. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
Author
Self-review — [MC-460-A]Overview: Generalizes the sidebar auto-scroll so it follows the active concept in Compare/Tags, not just realization pills in Annotate. Single effect change + regression test. Correctness ✅
Notes / minor
Tests ✅
No blockers. |
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.
MC Task: MC-460 — Concept menu auto-scroll only works on Annotate / Lane MC-460-A
Summary
The concept-menu auto-scroll (keep the selected entry in view) was intended to work in every mode, but only fired on the Annotate page.
Root cause
The scroll effect in
ParseUI.tsxdepended solely onselectedRealizationKey:goToRealizationOffset), which setsselectedRealizationKey→ effect fires → menu scrolls. ✅goToConceptOffset), which explicitly doessetSelectedRealizationKey(null)and only updatesconceptId. The effect bailed at the null guard, so the menu never followed the selection. ❌The effect itself was already global and the sidebar (
ConceptSidebar) is shared across all modes — the trigger was just realization-specific, a value only Annotate produces.Fix
When no realization is selected, fall back to scrolling the active concept's parent row (
[data-testid="concept-parent-button-${conceptId}"], already rendered byConceptSidebar), and addconceptIdto the dependency array so concept-level navigation also triggers the scroll.Testing
ArrowDownbetween concepts scrolls the active concept's parent row into view (assertsscrollIntoViewis called onconcept-parent-button-3).npx vitest run src/ParseUI.test.tsx— 138 passed / 7 skippednpx tsc --noEmit— cleannpm run build— green🤖 Generated with Claude Code