Skip to content

Fix/Inexistent tab for active route#1955

Merged
255kb merged 4 commits intomockoon:mainfrom
Mavbraz:fix/inexistent-tab-for-active-route
Nov 25, 2025
Merged

Fix/Inexistent tab for active route#1955
255kb merged 4 commits intomockoon:mainfrom
Mavbraz:fix/inexistent-tab-for-active-route

Conversation

@Mavbraz
Copy link
Contributor

@Mavbraz Mavbraz commented Nov 16, 2025

Technical implementation details

Fix the tab that'll appear when a route deletion happens and the route to be switched to does not have the tab.

Checklist

  • data migration added (@mockoon/commons)
  • commons lib tests added (@mockoon/commons)
  • commons-server lib tests added (@mockoon/commons-server)
  • CLI tests added (@mockoon/cli)
  • desktop UI automated tests added (@mockoon/app)

Closes #1893

Copy link
Contributor

Copilot AI left a comment

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 fixes a bug where deleting a route causes the application to display a tab that doesn't exist for the newly active route type. The fix ensures that when switching to a different route type (e.g., from HTTP to CRUD or WebSocket), the active tab is automatically reset to a valid tab (RESPONSE) if the current tab is not supported by the new route type.

Key changes:

  • Added logic to reset active tab when deleting a route and switching to a different route type
  • Extended responseTabForcedNavigation to handle WebSocket routes
  • Added comprehensive automated tests for CRUD and WebSocket route scenarios

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/app/test/specs/routes-create-delete.spec.ts Restructured tests and added two new test suites to verify tab reset behavior when deleting HTTP routes and switching to CRUD or WebSocket routes
packages/app/test/libs/routes.ts Added assertActiveRouteTab helper method to verify the active tab in tests
packages/app/src/renderer/app/stores/reducer.ts Updated REMOVE_ROUTE action to call responseTabForcedNavigation and properly reset the active tab when switching routes
packages/app/src/renderer/app/stores/reducer-utils.ts Extended responseTabForcedNavigation function to handle WebSocket routes and updated documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

255kb
255kb previously approved these changes Nov 25, 2025
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@255kb 255kb merged commit 14265cf into mockoon:main Nov 25, 2025
12 checks passed
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.

Active route does not respect available tabs after route delete

3 participants