refactor(canvas): split 650-line FilesTab.tsx into focused components - #10
Merged
Conversation
Pure restructure — no behavior change. Extracts FileTree, FileEditor, FilesToolbar, useFilesApi hook, and tree utilities into sibling files under canvas/src/components/tabs/FilesTab/. Top-level FilesTab.tsx is now 240 lines (glue + confirmations); re-exports buildTree/TreeNode so the existing import path and tests remain stable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Walks the real UI end-to-end:
1. Creates + registers a workspace on the platform
2. Opens the detail side panel
3. Clicks the Files tab (force-click since it's in an overflow-x bar)
4. Asserts all 3 split components render:
- FilesToolbar: "+ New" + "Upload" buttons
- FileTree: the config.yaml seeded by the default template
- FileEditor: "Select a file to edit" empty-state
Saves screenshots at /tmp/filestab-{1,2,3}-*.png for manual review.
Run: cd canvas && npx playwright test e2e/filestab-smoke.spec.ts
Requires platform on :8080 + canvas on :3000.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
7-Gate Verification: PASS
Change is NOT noteworthy (pure file-split refactor, no auth/billing/data-deletion touched). Merging as merge-commit. |
molecule-ai Bot
pushed a commit
that referenced
this pull request
Apr 21, 2026
refactor(canvas): split 650-line FilesTab.tsx into focused components
This was referenced Apr 23, 2026
HongmingWang-Rabbit
pushed a commit
that referenced
this pull request
Jun 12, 2026
…as masked + workflow flag flipped SCRIPT fail-closed: - unreadable log + success status → masked_run (was warn-only PASS). Quirk #10 (continue-on-error masking) cannot be verified when logs are pruned; fail-closed means block the flip. WORKFLOW flag: - continue-on-error: true → false on scan job. Diff-proof: 35/35 pytest tests pass. Refs: mc#1982, internal#219 §1
HongmingWang-Rabbit
pushed a commit
that referenced
this pull request
Jun 12, 2026
Makes SOP#765 mechanical (the mc#1982 masking incident). A job that is continue-on-error: true AND emits a context in .gitea/required-contexts.txt fails the lint. continue-on-error rolls a failed step up to SUCCESS (Gitea Quirk #10) — on a required context that turns a real failure green. .gitea/required-contexts.txt is the checked-in SSOT (CI cannot always read branch_protections); when DRIFT_BOT_TOKEN is present the lint also live-reads BP and fails on allowlist drift, degrading gracefully on 403/absent token. 6 pytest cases + verified clean against current core (3 required contexts, all coe=false) with live BP cross-check passing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
canvas/src/components/tabs/FilesTab.tsx(650 lines) into focused sibling files undercanvas/src/components/tabs/FilesTab/.FilesTab.tsxstays at the same import path (240 lines, glue + confirmation dialogs) and re-exportsbuildTree/TreeNodeso the existingbuildTree.test.tsandSidePanel.tsximports are unaffected.ConfirmDialog-style banners (noconfirm()/alert()/prompt()introduced).Files
FilesTab.tsx— 240 lines (was 650): state orchestration, layout, inline confirm banners, re-exports.FilesTab/FilesToolbar.tsx— 77 lines: root selector, New/Upload/Export/Clear/Refresh buttons.FilesTab/FileTree.tsx— 115 lines: recursiveFileTree+TreeItem.FilesTab/FileEditor.tsx— 112 lines: header, save/download buttons, textarea with Ctrl/Cmd+S and Tab handling.FilesTab/useFilesApi.ts— 172 lines: GET/PUT/DELETE API wrapper, directory expansion, bulk upload/download/delete.FilesTab/tree.ts— 86 lines:FileEntry,TreeNode,getIcon,buildTreeutility.Test plan
cd canvas && npm run build— cleancd canvas && npm test -- --run— 357/357 pass (incl. existingbuildTreetests)wc -l— top file 240 (≤250), largest sibling 172 (≤300)grep -n "confirm(\|alert(\|prompt(" FilesTab*— 0 matches