Skip to content

fix(settings): redirect unavailable tabs to general - #6710

Merged
TheodoreSpeaks merged 1 commit into
stagingfrom
fix/workspace-settings-fallback
Aug 14, 2026
Merged

fix(settings): redirect unavailable tabs to general#6710
TheodoreSpeaks merged 1 commit into
stagingfrom
fix/workspace-settings-fallback

Conversation

@TheodoreSpeaks

Copy link
Copy Markdown
Collaborator

Summary

Problem: Switching workspaces preserves the current settings URL, but the destination workspace may not expose that section.

Solution: Recognized but unavailable sections now redirect to the destination workspace's General settings page, while invalid routes and inaccessible workspaces still return 404.

Implementation level

  • Primary level: Server route
  • Chokepoint: WorkspaceSettingsSectionPage already owns destination-specific availability and authorization, so the fallback belongs there instead of duplicating those rules in the workspace switcher.
  • Key files:
    • page.tsx - applies the fallback at the settings-route boundary
    • page.test.tsx - covers subscription, workspace, organization, invalid-section, and inaccessible-workspace behavior

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 10:03pm

Request Review

@cursor

cursor Bot commented Aug 14, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes settings route behavior from 404 to redirect for authorization/availability cases; invalid routes and inaccessible workspaces remain 404, so security boundaries are preserved but navigation semantics shift at a central chokepoint.

Overview
When a settings URL is preserved across workspace switches, recognized sections that are unavailable in the destination workspace now redirect to General instead of returning 404.

WorkspaceSettingsSectionPage centralizes this via redirectToGeneralSettings, covering hidden workspace nav items, org sections without a host org (including mapping sessions), billing/org gates when billing is disabled, non-admin org viewers, and org sections blocked by permissions or plan features. Invalid section slugs and workspaces the viewer cannot access still fail fast with 404 before loading host context where appropriate.

Adds Vitest coverage for subscription, workspace, and org redirect paths plus the unchanged 404 cases.

Reviewed by Cursor Bugbot for commit 8010d92. 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

This PR redirects recognized but unavailable workspace settings sections to General while preserving 404 behavior for invalid sections and inaccessible workspaces.

  • Adds sessions to organization-section availability checks.
  • Centralizes the General-settings redirect.
  • Adds focused route tests for unavailable, invalid, and inaccessible cases.

Confidence Score: 5/5

The PR appears safe to merge with no actionable defects identified.

The fallback target bypasses availability gates and renders normally, while invalid sections and inaccessible workspaces continue to return 404 as intended.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/settings/[section]/page.tsx Redirects recognized unavailable sections to General while retaining route validation and workspace-access checks.
apps/sim/app/workspace/[workspaceId]/settings/[section]/page.test.tsx Covers subscription, workspace, organization, unknown-section, and inaccessible-workspace behavior.

Reviews (1): Last reviewed commit: "fix(settings): redirect unavailable tabs..." | Re-trigger Greptile

@TheodoreSpeaks
TheodoreSpeaks merged commit 41923b8 into staging Aug 14, 2026
30 checks passed
@TheodoreSpeaks
TheodoreSpeaks deleted the fix/workspace-settings-fallback branch August 14, 2026 22:10
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.

1 participant