Skip to content

Add a proper way to switch between views - #548

Merged
agarny merged 4 commits into
opencor:mainfrom
agarny:issue365
Aug 7, 2026
Merged

Add a proper way to switch between views#548
agarny merged 4 commits into
opencor:mainfrom
agarny:issue365

Conversation

@agarny

@agarny agarny commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #365.

Copilot AI lite review requested due to automatic review settings August 7, 2026 20:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ViewSwitcherComponent and integrate it into the main content layout for per-file view selection.
  • Remove the Simulation Experiment standard/interactive toggle UI and associated switchView emits/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

  • categoriesWithViews currently 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 by fileTypes and isAvailable for 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.

Comment thread src/renderer/src/components/ViewSwitcherComponent.vue
Comment thread src/renderer/src/components/ViewSwitcherComponent.vue
Comment thread src/renderer/src/components/ContentsComponent.vue
agarny added 3 commits August 7, 2026 23:29
Replace function-style `defineEmits` declarations with Vue's object/tuple syntax.
@agarny agarny changed the title Add a proper way to switch views Add a proper way to switch between views Aug 7, 2026
@agarny
agarny merged commit 01e3900 into opencor:main Aug 7, 2026
9 checks passed
@agarny
agarny deleted the issue365 branch August 7, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a proper way to switch between views

2 participants