Repository navigation
improvement(workflow): scope the editor by props instead of the URL - #8996
Merged
Merged
Conversation
The workflow editor read workspaceId/workflowId from useParams() all over its tree, so it only worked mounted at /workspace/[workspaceId]/w/[workflowId]. - WorkflowScopeProvider + useWorkflowScope/useScopedWorkflowId supply the ids; <Workflow> takes them as required props and the route page passes them in. - Previews (Preview, PreviewWorkflow, PreviewEditor) scope SubBlocks to the workspace with no workflow; /w renders Panel under a null-workflow scope. - The socket room is only what mounted editors request: Workflow always joins its workflowId and releases it on unmount; the route-param fallback is gone. - Editor navigation goes through useResourceRouter so a containing pane can intercept it. - useWand, SkillModal and the custom-tool generation hooks take workspaceId explicitly, since they also render outside the editor. Claude-Session: https://claude.ai/code/session_01UMjSAnE9M7r86o5P19ash5
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
|
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 62 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
… to the enclosing editor - joinWorkflow returns a release for its own mount token, so unmounting one of two editors on the same workflow can no longer drop the other's room; leaveWorkflow is gone - PreviewScope inherits the enclosing editor's workspace before the workspace host - TSDoc on useWorkflowScope Claude-Session: https://claude.ai/code/session_01UMjSAnE9M7r86o5P19ash5
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@TheodoreSpeaks I have started the AI code review. It will take a few minutes to complete. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
workspaceId/workflowIdfrom the URL, so<Workflow>works wherever it's mounted (groundwork for rendering the full editor in the org home's resource pane).WorkflowScopeProvider+useWorkflowScope()(throws outside a provider) +useScopedWorkflowId()(throws in a preview).<Workflow>takes both ids as required props; the route page passes them from params.Preview,PreviewWorkflow,PreviewEditor) scope sub-blocks to the workspace with no workflow;/workspace/[id]/wrenders Panel under the same null-workflow scope.Workflowalways joins its workflow and releases it on unmount (leaveWorkflow(id)), with a request stack so unmounting one editor never drops another's room. The route-param fallback is removed fromsocket-provider.useResourceRouter, so a containing pane can intercept them.useWand,SkillModal, and the custom-tool generation hooks takeworkspaceIdexplicitly since they also render outside the editor.Type of Change
Testing
bun run lint,bun run check:audits, block registry check, artifact generators (no drift)bun run test: all pass except 6 inlib/cleanup/lib/corethat fail identically on staging HEADsocket-join-target.test.tscovers the request stack and visibility gate (new cases verified to fail against the matching mutations); sub-block tests now render underWorkflowScopeProviderChecklist
test-auditauthoring gate)🤖 Generated with Claude Code
https://claude.ai/code/session_01UMjSAnE9M7r86o5P19ash5