Skip to content

Add activeWriteScopeId to scope.info, expose useActiveWriteScopeId#509

Draft
RhysSullivan wants to merge 1 commit intors/cloud-workspaces-08-workspace-contextfrom
rs/cloud-workspaces-09-scope-api
Draft

Add activeWriteScopeId to scope.info, expose useActiveWriteScopeId#509
RhysSullivan wants to merge 1 commit intors/cloud-workspaces-08-workspace-contextfrom
rs/cloud-workspaces-09-scope-api

Conversation

@RhysSullivan
Copy link
Copy Markdown
Owner

The scope handler now returns three things: the active display scope
(id/name/dir), a pre-computed activeWriteScopeId (the default
source-definition write target — org in global, workspace in workspace
contexts), and the full innermost-first stack for storage-target selectors.

The active write scope is computed by skipping personal scopes (those whose
id is prefixed user_org_ or user_workspace_) and picking the first
non-personal scope from the inner end. That collapses to org in the
global stack [user_org, org] and to workspace in the workspace stack
[user_workspace, workspace, user_org, org].

Client side, expose useActiveWriteScopeId() for default writes; keep
useScope() as an alias so plugin and existing pages don't churn. Update
the cloud shell + every page in packages/react/src/pages/ to call the
explicit hook so intent is clear.

The scope handler now returns three things: the active display scope
(`id`/`name`/`dir`), a pre-computed `activeWriteScopeId` (the default
source-definition write target — `org` in global, `workspace` in workspace
contexts), and the full innermost-first stack for storage-target selectors.

The active write scope is computed by skipping personal scopes (those whose
id is prefixed `user_org_` or `user_workspace_`) and picking the first
non-personal scope from the inner end. That collapses to `org` in the
global stack `[user_org, org]` and to `workspace` in the workspace stack
`[user_workspace, workspace, user_org, org]`.

Client side, expose `useActiveWriteScopeId()` for default writes; keep
`useScope()` as an alias so plugin and existing pages don't churn. Update
the cloud shell + every page in `packages/react/src/pages/` to call the
explicit hook so intent is clear.
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 4, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 21a4511 Commit Preview URL

Branch Preview URL
May 04 2026, 05:14 PM

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 4, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 21a4511 May 04 2026, 05:15 PM

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 4, 2026

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@509

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@509

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@509

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@509

@executor-js/storage-core

npm i https://pkg.pr.new/@executor-js/storage-core@509

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@509

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@509

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@509

@executor-js/plugin-google-discovery

npm i https://pkg.pr.new/@executor-js/plugin-google-discovery@509

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@509

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@509

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@509

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@509

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@509

executor

npm i https://pkg.pr.new/executor@509

commit: 21a4511

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