Repository navigation
Fix entity list highlighted instance focus & scroll - #792
Merged
Merged
Conversation
- Scroll the highlighted row into view after Inertia's scroll reset, and focus its link - Render enough rows for the highlighted instance to be found - Match highlighted instance on entity key (new _meta.entityKey), so it works with entity maps in Show pages - Don't focus / scroll rows without link Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Add an `entity_list_key` query param to entity list form links (edit and entity map create), passed through the form endpoint and used as `highlighted_entity_key` on redirect / cancel - Strip `entity_list_key` from the browser URL - Remove `_meta.entityKey` and restore the Show page highlight plumbing: a collapsed Show entity list with an entity map now opens on the highlighted row Co-Authored-By: Claude Opus 5.5 <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.
Problem
After submitting a form, the edited instance should be highlighted in the list (focused and scrolled into view). It often wasn't:
Scroll.reset()(window.scrollTo(0, 0)after page swap) ran right after, so the row ended up off screen.[data-instance-row] aselector could match a link inside an HTML field rendered before the row overlay link.configureEntityMap):highlighted_entity_keyis the item's entity (e.g.post-block-visuals) whileShow.vuecompared it to the field'sentityListKey(post-block), so the highlight was never applied (and a collapsed list never expanded).Fix
focusHighlightedInstance(): renders enough rows to include the highlighted instance, waits two animation frames (after Inertia's scroll reset), thenscrollIntoView({ block: 'center' })the row and focuses its link withpreventScroll.data-row-linkattribute.entity_list_keyquery param (the key of the list they're opened from).FormControllerpasses it to the form endpoint and uses it ashighlighted_entity_keyon redirect / cancel (falling back to the form entity base key).HandleInertiaRequestsstrips it from the browser URL. So the existinghighlightedEntityKey === entityListKeycheck inShow.vueworks with entity maps, including auto-expanding a collapsed list.Tests
EntityListControllerTest/ApiEntityListControllerTest; added aFormControllerTestcase forentity_list_key(endpoint, cancel URL, update & store redirects).🤖 Generated with Claude Code