fix: Open first workflow file after delayed load#5027
Conversation
|
👋 Commands for maintainers:
|
46d9b06 to
25b0ebb
Compare
Signed-off-by: BenHamiltonGit <benjamin.joel.hamilton@gmail.com>
25b0ebb to
7a5f032
Compare
|
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 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 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 |
Summary
Why
The new Files tab initializes its selected path/open tab state from the initial
filesprop. If the overlay mounts whilefilesis 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.tsxnpx eslint src/pages/workflowv2/WorkflowFilesOverlayLayer.tsx src/pages/workflowv2/WorkflowFilesOverlayLayer.spec.tsxnpx prettier --check src/pages/workflowv2/WorkflowFilesOverlayLayer.tsx src/pages/workflowv2/WorkflowFilesOverlayLayer.spec.tsxcanvas.yamlview still opens normally and tab close behavior is unchanged.