refactor(upload): unify file-drop pipeline across all list pages#492
Open
Papyszoo wants to merge 2 commits into
Open
refactor(upload): unify file-drop pipeline across all list pages#492Papyszoo wants to merge 2 commits into
Papyszoo wants to merge 2 commits into
Conversation
Replace the flat tonemapped HDR/EXR preview with the same metallic- sphere orbit animation the real asset processor produces, and cache results per-variant so the variant preview endpoint stays consistent with the map-level preview. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replaces the hand-rolled UploadableGrid + per-feature drag handlers with a single canonical UploadDropZone wrapper backed by a shared useDragAndDrop hook. Eliminates duplicate code, fixes a hover-state bug where the dashed-border drop affordance leaked into idle :hover, and adds bounded-concurrency uploads (4 workers) so dropping many files no longer hangs the UI. Also wires panel-wide tab-drop on the dock content area: tabs can now be dropped anywhere on the side panel, not just on the dock bar. File and tab drags coexist via MIME-type isolation — UploadDropZone filters on `Files`, and inner stopPropagation prevents file drops from bubbling to the panel-wide tab-drop listener. Performance: - O(N²) Zustand store updates → skip-clone for unaffected batches - Serial upload loop → bounded concurrency pool of 4 - Module-level shared drag listeners with refcount instead of per-instance Migrations: - 5 list pages (EnvironmentMap, Model, Sound, Sprite, TextureSet) - 4 container tabs (Sprites, Sounds, EnvironmentMaps, TextureSets) - Deletes UploadableGrid.tsx + UploadableGrid.css All 247 tests pass; vite build clean. Co-Authored-By: Claude Opus 4.7 <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
UploadableGrid+ per-feature drag handlers with a single canonical<UploadDropZone>wrapper backed by a shareduseDragAndDrophook (one source of truth for the file-drop affordance across the app)What changed
New canonical drop wrapper
UploadDropZone.tsx/.css— single visual treatment (dashed primary-color border on.drag-over), routes drops toonFilesDropped, ignores tab drags at hook levelMigrated 5 list pages →
UploadDropZoneEnvironmentMapList,ModelGrid,SoundList,SpriteList,TextureSetListMigrated 4 container tabs →
UploadDropZoneContainerSpritesTab,ContainerSoundsTab,ContainerEnvironmentMapsTab,ContainerTextureSetsTabUploadProgressWindowalready shows per-file progress)Deletes
UploadableGrid.tsx+UploadableGrid.css(replaced byUploadDropZone):hover:not(.drag-over)rules inEnvironmentMapList.css,ModelGrid.css,TextureSetGrid.cssthat were leaking drop styling into the idle hover statePerformance
uploadProgressStore: per-item updates skip cloning unaffected batches (O(N²) → O(N))useFileUpload.uploadMultipleFiles: bounded concurrency pool of 4 workers replaces serialforloopuseDragAndDropinstancePanel-wide tab drop
DockPanelContentattaches the existing tab-drop handlers to the.dock-contentdivdraggedTab); innerUploadDropZonecallsstopPropagationso file drops never reach the tab-drop listenerTest plan
npx jest— 247/247 tests passing across 21 suitesnpx vite build— clean build🤖 Generated with Claude Code