Skip to content

feat(workspaces): an address that names no workspace opens in the one used last - #1692

Merged
sickerine merged 4 commits into
devfrom
feat/last-workspace
Dec 1, 2026
Merged

sickerine merged 4 commits into
devfrom
feat/last-workspace

Conversation

@sickerine

Copy link
Copy Markdown
Collaborator

Members of an organisation kept ending up in their own workspace: signing in lands on /, and a paper's page names no workspace, so the rail on it was the person's own. Walkers published reports in their own workspace that were meant for their organisation. Part of the workspace publishing milestone (OS-37).

What changes

The order is now: an address under /o/<slug> is that organisation's, an item opens where it is, and anything else follows the workspace used last in this browser.

  • Remembered. The rail's cookie also keeps the organisation it drew last for the account, on every page it draws. Using your own workspace clears it.
  • Arriving. Loading the home page, a search (/results?q=…) or a new report (/publish) opens it in that organisation. So does signing in. A link followed inside the app is never moved, so a tab in your own workspace stays there whatever another tab did.
  • Bare section pages stay yours. /library, /settings/billing and the rest are how the site's own emails and payment pages name a person's own workspace.
  • Pages in no workspace. A paper's page and the policy pages stay in the organisation the tab was in: the rail, its links and the page's actions are that organisation's. Loaded fresh, they use the remembered one. From such a page, switching to your own workspace goes to your home page.
  • Reports are items. /publish?report=R… opens in the workspace the report belongs to, like a search or a collection.
  • No loops. The proxy redirects only to an organisation the person is still a member of. Someone removed from it, or another account on the same browser, starts in their own workspace.

Checks

  • npx tsc --noEmit, npx vitest run lib/workspaces convex/workspaces and the sharing and gate tests, check:ui-rules, check:user-actions, check:convex-rules
  • In a browser on a production build against the dev backend, as a member of a test organisation:
    • /, /publish, /publish?code=X and /results?q=… open in the organisation once it was used; /library, /settings/billing and /pricing stay the person's own
    • a paper page and a policy page keep the organisation's rail, reached inside the app and loaded fresh, and keep the person's own after their own workspace was used
    • switching to the own workspace from a paper page lands on /
    • signing out and in lands in the organisation; another member of the same organisation signing in on that browser lands on /
  • npm run verify -- shift on /papers/W2741809807 and /: no new shifts in Chromium and Firefox, and none on the paper and policy pages loaded after the organisation
  • Cross-family review: two findings, both fixed (sign-in used the cookie of whoever was there before; a change of the address's query alone didn't count as use)

Not checked here

/publish?report=R… opening in its workspace needs the new homeOf on the backend, so it is checked on dev after the Convex push.

Deploy order

Convex before the app: an app that asks homeOf about a report fails against a backend that doesn't know the kind.

…ount that signed in, and opening an item by the address's query counts as using its workspace
@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0da70e0a-832f-4537-ace9-a629f596564c
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-01T18:35:17.204435Z 9e4efd1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e4efd1a77

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/workspaces/paths.ts Resolved
Comment thread components/workspaces/rail.tsx Resolved
… workspace used last, and every page says which workspace its tab is in, not only the rail, which a phone mounts only while its sheet is open
@sickerine
sickerine merged commit 74fedf7 into dev Dec 1, 2026
6 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.

1 participant