Skip to content

fix: Use Canvas YAML copy handler#5024

Open
BenHamiltonGit wants to merge 1 commit into
superplanehq:mainfrom
BenHamiltonGit:codex/fix-canvas-yaml-copy-handler
Open

fix: Use Canvas YAML copy handler#5024
BenHamiltonGit wants to merge 1 commit into
superplanehq:mainfrom
BenHamiltonGit:codex/fix-canvas-yaml-copy-handler

Conversation

@BenHamiltonGit
Copy link
Copy Markdown

@BenHamiltonGit BenHamiltonGit commented May 26, 2026

Summary

  • Route the Canvas YAML modal's Copy button through the parent-provided copy handler.
  • Add coverage for using the handler and hiding the button when no handler is provided.

Why

CanvasYamlView already wires handleYamlViewCopy into CanvasYamlModal, and that handler owns the success/error toast behavior for YAML copying. The modal was bypassing it with a direct navigator.clipboard.writeText(...) call, so copy result feedback was not surfaced through the existing path.

Testing

  • npx eslint src/pages/workflowv2/CanvasYamlModal.tsx src/pages/workflowv2/CanvasYamlModal.spec.tsx
  • npm run test:run -- CanvasYamlModal.spec.tsx
  • npx prettier --check src/pages/workflowv2/CanvasYamlModal.tsx src/pages/workflowv2/CanvasYamlModal.spec.tsx
  • docker compose -f docker-compose.dev.yml exec app bash -lc "cd web_src && npm run build"

Signed-off-by: BenHamiltonGit <benjamin.joel.hamilton@gmail.com>
@superplanehq-integration
Copy link
Copy Markdown

👋 Commands for maintainers:

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

@BenHamiltonGit
Copy link
Copy Markdown
Author

Thanks for taking a look. I originally found SuperPlane through a Product Engineer listing and opened this PR as the requested proof-of-work step.

I noticed this now conflicts with #5025, which removes CanvasYamlModal.tsx as part of the new Files tab work, so this specific fix may be superseded by that UI change. Either way, I enjoyed digging into the flow and would still be interested in future product engineering opportunities with the team.

Portfolio: https://portfolio-2rbk.onrender.com/

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