Add a proper way to switch between views - #548
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new left-side view switcher to replace the in-view “standard/interactive” toggle and standardizes Vue defineEmits typings across several components, aligning the UI more closely with the “switch views” requirement from #365.
Changes:
- Add
ViewSwitcherComponentand integrate it into the main content layout for per-file view selection. - Remove the Simulation Experiment standard/interactive toggle UI and associated
switchViewemits/styles. - Migrate multiple components to the object/tuple form of typed
defineEmits, and bump package versions.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/renderer/src/components/widgets/InputWidget.vue | Updates defineEmits typing to tuple/object form. |
| src/renderer/src/components/widgets/InputScientificNumberWidget.vue | Updates defineEmits typing to tuple/object form. |
| src/renderer/src/components/widgets/GraphPanelWidget.vue | Updates defineEmits typing to tuple/object form for margins/reset events. |
| src/renderer/src/components/ViewSwitcherComponent.vue | Adds new icon-based left-side view switcher UI. |
| src/renderer/src/components/views/SimulationExperimentStandardView.vue | Removes toggle UI and switchView emit; keeps keyboard-active tracking. |
| src/renderer/src/components/views/SimulationExperimentInteractiveView.vue | Removes toggle UI and switchView emit. |
| src/renderer/src/components/views/simulation-experiment-view.css | Removes styling for the removed toggle button. |
| src/renderer/src/components/propertyEditors/PropertyEditor.vue | Updates defineEmits typing to tuple/object form. |
| src/renderer/src/components/OpenCOR.vue | Updates view registrations (ids/labels/icons) for simulation experiment views. |
| src/renderer/src/components/MainMenu.vue | Updates defineEmits typing to tuple/object form. |
| src/renderer/src/components/dialogs/YesNoQuestionDialog.vue | Updates defineEmits typing to tuple/object form. |
| src/renderer/src/components/dialogs/UpdateAvailableDialog.vue | Updates defineEmits typing to tuple/object form. |
| src/renderer/src/components/dialogs/SimulationExperimentInteractiveViewSettingsDialog.vue | Updates defineEmits typing to tuple/object form. |
| src/renderer/src/components/dialogs/SettingsDialog.vue | Updates defineEmits typing to tuple/object form. |
| src/renderer/src/components/dialogs/OpenRemoteDialog.vue | Updates defineEmits typing to tuple/object form. |
| src/renderer/src/components/dialogs/OkMessageDialog.vue | Updates defineEmits typing to tuple/object form. |
| src/renderer/src/components/dialogs/DisconnectFromGitHubDialog.vue | Updates defineEmits typing to tuple/object form. |
| src/renderer/src/components/dialogs/BaseDialog.vue | Updates defineEmits typing to tuple/object form. |
| src/renderer/src/components/dialogs/AboutDialog.vue | Updates defineEmits typing to tuple/object form. |
| src/renderer/src/components/ContentsComponent.vue | Embeds the new view switcher alongside the view content; replaces onSwitchView with onSelectView. |
| src/renderer/src/common/viewRegistry.ts | Extends view descriptor metadata with optional icon. |
| src/renderer/package.json | Bumps renderer package version. |
| package.json | Bumps root package version. |
Suppressed comments (1)
src/renderer/src/components/ViewSwitcherComponent.vue:51
categoriesWithViewscurrently lists all registered views for a category, even when they don’t apply to the current file. This can surface non-functional options in the switcher (and can leave the content area empty if a non-applicable view is selected). Filter the descriptors byfileTypesandisAvailablefor the provided file.
for (const category of Object.values(ViewCategory)) {
const views = viewRegistry.descriptors(category);
if (views.length > 0) {
res.push([category, views]);
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replace function-style `defineEmits` declarations with Vue's object/tuple syntax.
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.
Fixes #365.