[Preview] Fix missing view labels in overlay#8260
Open
heathdutton wants to merge 2 commits intonasa:masterfrom
Open
[Preview] Fix missing view labels in overlay#8260heathdutton wants to merge 2 commits intonasa:masterfrom
heathdutton wants to merge 2 commits intonasa:masterfrom
Conversation
The preview header was passing the view instance to ViewSwitcher and NotebookMenuSwitcher, but both components need the view provider which carries the name, cssClass, and key properties. Pass the view provider separately for display purposes. Also fixes incorrect :v-if prop binding that should be a v-if directive on the ViewSwitcher. Closes nasa#7712
There was a problem hiding this comment.
Pull request overview
This PR fixes missing view labels in the preview overlay that were introduced by PR #7632. The previous change passed view instances instead of view providers to UI components, but view instances don't carry display metadata like name, cssClass, or key.
Changes:
- Adds a separate
currentViewProviderprop to preserve view provider data for display purposes - Fixes incorrect
:v-ifprop binding to properv-ifdirective in ViewSwitcher - Maintains the view instance for ActionCollection functionality while passing the provider for display
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/ui/preview/PreviewHeader.vue | Adds currentViewProvider prop and passes it to ViewSwitcher and NotebookMenuSwitcher; fixes :v-if to v-if |
| src/ui/preview/PreviewContainer.vue | Passes the view provider to PreviewHeader via new current-view-provider prop |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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 #7712
Describe your changes:
PR #7632 changed the preview header to pass the view instance instead of the view provider to
ViewSwitcherandNotebookMenuSwitcher. The view instance (returned byprovider.view()) doesn't carryname,cssClass, orkey-- those live on the provider. This caused blank labels in the view switcher dropdown when previewing historical data.This fix passes the view provider separately for display purposes, while keeping the view instance for the action collection watcher which needs it.
Also fixes
:v-if(prop binding, always renders) tov-if(directive, conditionally renders) on theViewSwitcher.All Submissions:
Author Checklist
type:label? Note: this is not necessarily the same as the original issue.Reviewer Checklist