refactor(studio): split the two files over the 600-line cap - #3313
Merged
Conversation
The file size check has been failing on main. It is diff-scoped on a PR but full-scans packages/studio on push, so two files that crept over the cap were only ever caught after merge, and every release since has been red: TimelineAutomationLane.tsx 674 lines StudioRightPanel.tsx 609 lines Both are pure code moves. No behavior change. TimelineAutomationLane.tsx keeps the single-lane editor and gives up the track-level layer: ClipLaneRow, ClipAutomationLanes and TimelineAutomationLaneSlot move to TimelineAutomationLaneSlot.tsx, which is the name its test file already used. The dependency runs one way, slot -> lane, so there is no cycle. 674 -> 499. StudioRightPanel.tsx gives up its props interface to a sibling .types.ts. That block is the part that changes least, so moving it keeps the component's own diffs small; two in-flight branches touch this file and both are based on a 556-line copy of it, so keeping the cut away from the body matters. 609 -> 568. Verified by running the CI rule's full-scan branch over the 679 tracked packages/studio source files: no file over 600, exit 0. Studio suite green at 2790 passed across 226 files, and typecheck clean.
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.
What
Splits the two
packages/studiofiles that are over the 600-line cap, soFile size checkgoes green on main.Pure code moves. No behavior change.
Why
File size checkis currently failing on main, including on the v0.7.110 release commit.The check is diff-scoped on a PR but full-scans
packages/studioon push (ci.yml:858, and its own comment explains the split: walking the whole tree blamed every unrelated PR for pre-existing offenders). So a file that creeps over the cap passes its own PR and only fails after merge, where nobody owns it. Two have accumulated that way.How
TimelineAutomationLane.tsxkeeps the single-lane editor and gives up the track-level layer.ClipLaneRow,ClipAutomationLanesandTimelineAutomationLaneSlotmove to a newTimelineAutomationLaneSlot.tsx, which is the name its test file already used, so the seam was effectively already drawn. The dependency runs one way, slot to lane, so there is no cycle. Two import sites updated.StudioRightPanel.tsxgives up its props interface to a siblingStudioRightPanel.types.ts, re-exported so no consumer changes. I picked that cut deliberately over carving out a sub-component: two in-flight branches (#3291, #3292) touch this file and both are based on a 556-line copy of it, so they will conflict on rebase regardless. Keeping the cut in the interface block, which is the part that changes least, keeps their conflicts away from the component body.Both files also shed the imports that left with the moved code.
Test plan
No new tests: these are moves, and the existing
TimelineAutomationLaneSlot.test.tsxalready covers the extracted component (6 tests, still green against its new home).Ran the CI rule's own full-scan branch locally over the 681 tracked
packages/studiosource files: no file over 600, exit 0.tsc --noEmitonpackages/studio: cleanoxlint/oxfmt: cleanNote for #3291 and #3292
Both touch
StudioRightPanel.tsxfrom a 556-line base. After this lands their rebase picks up the split file. The props interface moved out wholesale toStudioRightPanel.types.ts; the component body is otherwise untouched, so conflicts should be confined to imports.