Skip to content

fix(settings): preserve tab when switching workspaces - #6704

Merged
waleedlatif1 merged 1 commit into
stagingfrom
feat/workspace-switcher
Aug 14, 2026
Merged

fix(settings): preserve tab when switching workspaces#6704
waleedlatif1 merged 1 commit into
stagingfrom
feat/workspace-switcher

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

  • preserve the active settings tab when switching workspaces
  • drop workspace-scoped detail paths while keeping non-settings navigation unchanged

Type of Change

  • Bug fix

Testing

  • Targeted Vitest suite
  • Sim TypeScript check
  • Repository lint and audit suite

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 14, 2026 8:19pm

Request Review

@cursor

cursor Bot commented Aug 14, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Localized client-side URL routing in the workspace switcher; no auth, data, or API changes.

Overview
Workspace switches from settings now land on the same settings section in the target workspace (e.g. MCP stays on MCP) instead of always going to the workspace root.

A new resolveWorkspaceSwitchHref helper builds the navigation URL: it keeps only the settings section segment and strips deeper workspace-scoped detail paths (such as a specific secret/credential id), so ids from the old workspace are not carried over. Switches from workflows or other non-settings routes still go to /workspace/{id}.

switchWorkspace in useWorkspaceManagement uses the current pathname via usePathname and pushes that resolved href. Vitest covers section preservation, detail stripping, non-settings behavior, and the invalid settings path error.

Reviewed by Cursor Bugbot for commit 715c4c8. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR preserves the active settings section when switching workspaces while discarding workspace-specific detail segments.

  • Adds a pathname-aware workspace-switch destination resolver.
  • Retains non-settings workspace-switch behavior.
  • Adds focused tests for section preservation, detail truncation, root navigation, and malformed settings paths.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/hooks/use-workspace-management.ts Adds settings-aware destination resolution to workspace switching without an eligible unresolved follow-up finding.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/hooks/use-workspace-management.test.tsx Adds focused coverage for preserved settings sections, discarded detail segments, and fallback behavior.

Reviews (2): Last reviewed commit: "fix(settings): preserve tab when switchi..." | Re-trigger Greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@greptile

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 715c4c8. Configure here.

@waleedlatif1
waleedlatif1 merged commit 3d4e3d2 into staging Aug 14, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the feat/workspace-switcher branch August 14, 2026 21:17
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.

2 participants