Skip to content

fix: lowercase the workspace key segment in workspace URLs - #7263

Merged
mytmlt merged 6 commits into
mainfrom
lowercase-workspace-slug-in-urls
Sep 9, 2026
Merged

mytmlt merged 6 commits into
mainfrom
lowercase-workspace-slug-in-urls

Conversation

@superplanehq-integration

@superplanehq-integration superplanehq-integration Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

SUPER-155

This change makes the workspace key lowercase in every workspace URL, for example /superplane/workspaces/super/lines/9f2a291c-... instead of /superplane/workspaces/SUPER/lines/9f2a291c-.... The stored workspace key, the settings page, task identifiers (for example SP-42), and the key validation rules stay uppercase and unchanged. This is a frontend-only change with no backend, database, or API impact.

UI

factoryDetailPath is the one function that every workspace-scoped path builder uses to add the workspace key to a URL. It now lowercases the key before it writes the key into the path. Because every other path builder (lines, tasks, apps, automations, missions, wiki, velocity, settings, and so on) calls this function, the whole app now produces lowercase workspace URLs without needing changes in each individual builder.

The redirect logic that sends old links to the current workspace URL now treats the lowercase key as the canonical form. A URL with an uppercase or mixed-case workspace key (for example /workspaces/SUPER/...) redirects to the lowercase URL. A URL that already uses the lowercase key does not redirect, so the app does not get stuck in a redirect loop. Old links that use the workspace database ID instead of the key still resolve and redirect to the lowercase key URL, as before.

The workspace switcher builds the target URL for the new workspace from the current URL. Because the current URL now has a lowercase workspace key but the switcher read the key from the workspace record (which stays uppercase), a case mismatch could stop the switcher from recognizing pages like Settings or Velocity that it should keep open in the new workspace. The switcher logic now normalizes the case before it compares the two, so this keeps working correctly.

The workspace key shown on the Settings page, the key input field on that page, and task identifiers (for example SP-42) are not changed by this update. They keep using the uppercase key exactly as stored.

Tests

Unit tests for the URL builders and the redirect logic are updated to expect lowercase workspace URLs. A few other tests that build or assert workspace URLs elsewhere in the app (onboarding, legacy task redirects, mission links, the app default-tab gate, and the root organization redirect) are updated the same way.


Created via SuperPlane.

RetriggerView in Greptile

The PR appears safe to merge.

superplaneagent and others added 3 commits September 8, 2026 07:11
Every workspace-scoped path now goes through factoryDetailPath, which
lowercases the factoryKey when writing it into the path. The stored
factory.key (and everywhere it's displayed, e.g. Settings) stays
uppercase — only the URL segment is lowercase.

factoryRouteNeedsCanonicalRedirect now treats the lowercase key as
canonical: an uppercase or mixed-case route segment redirects to
lowercase, and a correct lowercase segment does not redirect (no
redirect loop). replaceFactoryKeySegment always emits the lowercase
canonical key.

pathAfterWorkspaceSwitch normalizes the (uppercase) current factory
key before comparing it against the (lowercase) pathname prefix, so
the settings/velocity/etc. "keep this page" check still matches after
the workspace switch.

Signed-off-by: SuperPlane Agent <superplaneagent@superplane.com>
Co-authored-by: Miyat Miletic <mijat.miletic98@gmail.com>
factoryRouteNeedsCanonicalRedirect: a lowercase route segment matching
factory.key case-insensitively is now canonical (no redirect); an
uppercase or mixed-case segment redirects. replaceFactoryKeySegment
always emits a lowercase key. Every workspace-scoped path builder now
asserts a lowercase URL segment while keeping the factoryKey argument
uppercase, matching the stored factory.key shape.

Signed-off-by: SuperPlane Agent <superplaneagent@superplane.com>
Co-authored-by: Miyat Miletic <mijat.miletic98@gmail.com>
These specs build workspace paths through factoryDetailPath (or a
builder that composes from it) and assert on the resulting URL, so
they now expect the lowercase canonical segment: legacy work-order
redirects, mission detail links, new-workspace setup redirect,
onboarding-gate redirects, onboarding resume path, the root
organization redirect, and the factory-app default-tab gate.

Signed-off-by: SuperPlane Agent <superplaneagent@superplane.com>
Co-authored-by: Miyat Miletic <mijat.miletic98@gmail.com>
@superplanehq-integration

Copy link
Copy Markdown
Contributor Author

Maintainers: comment /deploy-storybook to get a Storybook link for this PR.

@superplanehq-integration

Copy link
Copy Markdown
Contributor Author

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes ~30s)
  • /sp stop - Stop a running machine (auto-executed on pr close)

These frontend unit specs still asserted the uppercase factory.key in the
generated workspace URLs (task/line/app/settings links, redirects, and
onboarding navigation). Workspace-scoped paths now go through
factoryDetailPath, which lowercases the URL segment while the stored
factory.key stays uppercase, so the specs now expect the lowercase
canonical URL form.

Signed-off-by: SuperPlane Agent <superplaneagent@superplane.com>
@mytmlt mytmlt self-assigned this Sep 9, 2026
@mytmlt
mytmlt enabled auto-merge (squash) September 9, 2026 11:51
Signed-off-by: SuperPlane Agent <superplaneagent@superplane.com>
@mytmlt
mytmlt merged commit 8e71199 into main Sep 9, 2026
5 of 6 checks passed
@mytmlt
mytmlt deleted the lowercase-workspace-slug-in-urls branch September 9, 2026 12:16
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