Skip to content

fix: Open first workflow file after delayed load#5027

Open
BenHamiltonGit wants to merge 1 commit into
superplanehq:mainfrom
BenHamiltonGit:codex/files-tab-small-fix
Open

fix: Open first workflow file after delayed load#5027
BenHamiltonGit wants to merge 1 commit into
superplanehq:mainfrom
BenHamiltonGit:codex/files-tab-small-fix

Conversation

@BenHamiltonGit
Copy link
Copy Markdown

@BenHamiltonGit BenHamiltonGit commented May 26, 2026

Summary

  • Open the first workflow file when the Files tab mounts before files are available and they load afterward.
  • Add coverage for the delayed-load case while preserving the existing behavior that closing the last tab keeps all tabs closed.

Why

The new Files tab initializes its selected path/open tab state from the initial files prop. If the overlay mounts while files is empty and the files arrive on a later render, the editor can remain blank until the user manually selects a file. This keeps the initial file-opening behavior working for delayed data without reopening tabs the user intentionally closed.

Testing

  • npm run test:run -- WorkflowFilesOverlayLayer.spec.tsx
  • npx eslint src/pages/workflowv2/WorkflowFilesOverlayLayer.tsx src/pages/workflowv2/WorkflowFilesOverlayLayer.spec.tsx
  • npx prettier --check src/pages/workflowv2/WorkflowFilesOverlayLayer.tsx src/pages/workflowv2/WorkflowFilesOverlayLayer.spec.tsx
  • Manually tested locally in the Files tab to verify the default canvas.yaml view still opens normally and tab close behavior is unchanged.

@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)

Signed-off-by: BenHamiltonGit <benjamin.joel.hamilton@gmail.com>
@BenHamiltonGit BenHamiltonGit force-pushed the codex/files-tab-small-fix branch from 25b0ebb to 7a5f032 Compare May 27, 2026 00:19
@BenHamiltonGit
Copy link
Copy Markdown
Author

Hope you don’t mind the second PR. After noticing my previous one was superseded by the new Files tab work in #5025, I wanted to do a little extra due diligence against the current main branch.

This one is aimed directly at that new flow: if the Files tab mounts before files are available, it now opens the first file once they load, while preserving the existing tab-close behavior.

I also rebased after #5026 landed and kept the new sidebar-offset coverage intact. I manually tested the Files tab locally as well to verify the default canvas.yaml view still opens normally and tab close behavior is unchanged.

I originally found SuperPlane through a Product Engineer listing and would be glad to connect if future product engineering opportunities open up.

Email: benjamin.joel.hamilton@gmail.com
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