[PR #692] [MERGED] feat: full-screen File Browser for game assets with multi-select bulk operations #4732

Closed
opened 2026-10-22 04:10:12 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/692
Author: @Gunterlie
Created: 5/11/2026
Status: ✅ Merged
Merged: 5/12/2026
Merged by: @LukaTheHero

Base: main ← Head: file-browser


📝 Commits (10+)

  • ed2f9d8 Fix mobile tracker text preview clipping (#685)
  • 1827598 Restore same-turn game skill checks
  • 30c5179 feat: add full-screen File Browser for game assets
  • e7cd55b Merge remote-tracking branch 'upstream/main' into file-browser
  • 1ff1c28 feat: file browser polish — upload fixes, audio player, dropdowns, search, image info, text editor
  • 2115de1 fix: use FileText icon for text files in browser
  • d7f0abc refactor(file-browser): extract all sub-components and add editor polish
  • 183548b Merge remote-tracking branch 'upstream/main' into file-browser
  • 02c67c3 feat(server): add bulk move/copy/delete endpoints for game assets
  • 2799a19 feat(file-browser): multi-select with bulk move/copy/delete for files

📊 Changes

24 files changed (+3538 additions, -55 deletions)

View changed files

➕ packages/client/src/components/game-assets/ActionDropdown.tsx (+77 -0)
➕ packages/client/src/components/game-assets/AssetGrid.tsx (+232 -0)
➕ packages/client/src/components/game-assets/AudioPlayerModal.tsx (+86 -0)
➕ packages/client/src/components/game-assets/FileEditorModal.tsx (+235 -0)
➕ packages/client/src/components/game-assets/FolderTree.tsx (+97 -0)
➕ packages/client/src/components/game-assets/GameAssetsBrowserView.tsx (+848 -0)
➕ packages/client/src/components/game-assets/ImageInfoPopover.tsx (+96 -0)
➕ packages/client/src/components/game-assets/ImagePreviewModal.tsx (+110 -0)
➕ packages/client/src/components/game-assets/SearchInput.tsx (+73 -0)
➕ packages/client/src/components/game-assets/Toolbar.tsx (+328 -0)
➕ packages/client/src/components/game-assets/constants.tsx (+36 -0)
➕ packages/client/src/components/game-assets/encode-asset-path.ts (+19 -0)
➕ packages/client/src/components/game-assets/utils.tsx (+65 -0)
📝 packages/client/src/components/layout/AppShell.tsx (+55 -26)
📝 packages/client/src/components/layout/TopBar.tsx (+21 -1)
➕ packages/client/src/hooks/use-game-assets.ts (+288 -0)
➕ packages/client/src/lib/format.ts (+19 -0)
📝 packages/client/src/stores/ui.store.ts (+25 -1)
📝 packages/server/src/app.ts (+3 -2)
📝 packages/server/src/db/seed-game-assets.ts (+33 -10)

...and 4 more files

📄 Description

Linked issue

Closes #691

Why this change

Managing game assets (music, sfx, ambient audio, sprites, backgrounds) currently forces users to leave the engine and use their OS file manager or external tools. There is no in-engine way to browse the data/game-assets/ tree, preview files, organize content between categories, or batch-clean up unused assets. This creates friction for content creators who need to quickly verify sprites, audition audio cues, or move files between folders without context-switching out of the app. This PR adds a full-screen File Browser overlay that brings asset management directly into the engine.

Discord discussion: https://discord.com/channels/1417099416812392641/1503430688915984494

What changed

New UI (packages/client/src/components/game-assets/)

  • GameAssetsBrowserView.tsx — main orchestration component (~780 lines, down from 1632 after component extraction)
  • Toolbar.tsx — breadcrumb, search, view toggle, upload/new/rescan/open buttons, column dropdowns
  • AssetGrid.tsx — grid + list views with always-visible checkboxes for file multi-select
  • FolderTree.tsx — sidebar folder tree with chevron expand/collapse
  • SearchInput.tsx — responsive search (collapses to icon on mobile)
  • ImagePreviewModal.tsx — full-screen image preview with togglable metadata side panel
  • AudioPlayerModal.tsx — audio player with MIME type hints and download fallback
  • ImageInfoPopover.tsx — responsive image info popover (desktop card / mobile bottom sheet)
  • FileEditorModal.tsx — text file editor with line numbers, tab-to-spaces, Markdown preview toggle, keyboard shortcuts (Ctrl+S save, Esc close with unsaved-changes guard)
  • ActionDropdown.tsx — 3-dot action menu with outside-click and scroll-close handling
  • constants.tsx — category icons + default folder descriptions
  • utils.tsx — file-type helpers (isImage, isAudio, isEditableText, FileIcon, countItems)

New hooks (packages/client/src/hooks/use-game-assets.ts)

  • Bulk mutation hooks: useMoveGameAssetsBulk, useCopyGameAssetsBulk, useDeleteGameAssetsBulk

New server routes (packages/server/src/routes/game-assets.routes.ts)

  • POST /game-assets/move-bulk — batch move files to target folder
  • POST /game-assets/copy-bulk — batch copy files to target folder
  • POST /game-assets/delete-bulk — batch delete files
  • All endpoints return { succeeded, failed } arrays for per-file success/failure reporting

Shared constants (packages/shared/src/constants/game-assets.ts)

  • IMAGE_EXTS, AUDIO_EXTS, TEXT_EXTS, AUDIO_MIME_MAP exported for client+server reuse

Utilities

  • packages/client/src/lib/format.ts — formatBytes, formatDate

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Not yet manually tested in-browser. The following need human verification:

  • Navigate between category folders via sidebar and breadcrumbs
  • Upload files via drag-and-drop and Upload button
  • Create new folders/text files via New menu
  • Rename, move, copy, delete single files
  • Multi-select files via checkboxes and bulk move/copy/delete
  • Image/audio/text file previews
  • Text editor keyboard shortcuts (Ctrl+S, Esc with unsaved guard)
  • Mobile responsive layout

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Bildschirmfoto 2026-05-11 um 20 00 50

Summary by CodeRabbit

  • New Features

    • Full Game Assets browser: folder tree, grid/list views, search, breadcrumbs, toolbar, and lazy-open overlay
    • Previews & editors: image preview with info, audio player, text/Markdown editor, and file action menus
    • Uploads, drag‑and‑drop, multi-select with bulk move/copy/delete, create/rename/move/copy/delete flows and confirmations
  • Bug Fixes & UX

    • Enforced upload size limits, safer filename handling and collision avoidance, improved error messages, and robust metadata/description persistence

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/692 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 5/11/2026 **Status:** ✅ Merged **Merged:** 5/12/2026 **Merged by:** [@LukaTheHero](https://github.com/LukaTheHero) **Base:** `main` ← **Head:** `file-browser` --- ### 📝 Commits (10+) - [`ed2f9d8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ed2f9d8e1f041e111c81c8faba95a0f36a2d1303) Fix mobile tracker text preview clipping (#685) - [`1827598`](https://github.com/Pasta-Devs/Marinara-Engine/commit/182759890472bd536bf9e298cdce712cffc9acf1) Restore same-turn game skill checks - [`30c5179`](https://github.com/Pasta-Devs/Marinara-Engine/commit/30c517975868532bd3b92434e628313a1ec4a30c) feat: add full-screen File Browser for game assets - [`e7cd55b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e7cd55b49dac778d0e64252edcd8db0ed133a0dd) Merge remote-tracking branch 'upstream/main' into file-browser - [`1ff1c28`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1ff1c28fd99b84da45a832921d7ecde0795afa0b) feat: file browser polish — upload fixes, audio player, dropdowns, search, image info, text editor - [`2115de1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2115de1c7ffdb4d688ab3b1827a7bf7a4db5f506) fix: use FileText icon for text files in browser - [`d7f0abc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d7f0abc293de060eec98f83ba7c5596f3501c9e4) refactor(file-browser): extract all sub-components and add editor polish - [`183548b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/183548b485cad010ffefa09194d76780bba5856a) Merge remote-tracking branch 'upstream/main' into file-browser - [`02c67c3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/02c67c3f2015c75293e26da2f542b30161067963) feat(server): add bulk move/copy/delete endpoints for game assets - [`2799a19`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2799a19f6df3290ad669fa8f65a6c20a4898e57a) feat(file-browser): multi-select with bulk move/copy/delete for files ### 📊 Changes **24 files changed** (+3538 additions, -55 deletions) <details> <summary>View changed files</summary> ➕ `packages/client/src/components/game-assets/ActionDropdown.tsx` (+77 -0) ➕ `packages/client/src/components/game-assets/AssetGrid.tsx` (+232 -0) ➕ `packages/client/src/components/game-assets/AudioPlayerModal.tsx` (+86 -0) ➕ `packages/client/src/components/game-assets/FileEditorModal.tsx` (+235 -0) ➕ `packages/client/src/components/game-assets/FolderTree.tsx` (+97 -0) ➕ `packages/client/src/components/game-assets/GameAssetsBrowserView.tsx` (+848 -0) ➕ `packages/client/src/components/game-assets/ImageInfoPopover.tsx` (+96 -0) ➕ `packages/client/src/components/game-assets/ImagePreviewModal.tsx` (+110 -0) ➕ `packages/client/src/components/game-assets/SearchInput.tsx` (+73 -0) ➕ `packages/client/src/components/game-assets/Toolbar.tsx` (+328 -0) ➕ `packages/client/src/components/game-assets/constants.tsx` (+36 -0) ➕ `packages/client/src/components/game-assets/encode-asset-path.ts` (+19 -0) ➕ `packages/client/src/components/game-assets/utils.tsx` (+65 -0) 📝 `packages/client/src/components/layout/AppShell.tsx` (+55 -26) 📝 `packages/client/src/components/layout/TopBar.tsx` (+21 -1) ➕ `packages/client/src/hooks/use-game-assets.ts` (+288 -0) ➕ `packages/client/src/lib/format.ts` (+19 -0) 📝 `packages/client/src/stores/ui.store.ts` (+25 -1) 📝 `packages/server/src/app.ts` (+3 -2) 📝 `packages/server/src/db/seed-game-assets.ts` (+33 -10) _...and 4 more files_ </details> ### 📄 Description ## Linked issue Closes #691 ## Why this change Managing game assets (music, sfx, ambient audio, sprites, backgrounds) currently forces users to leave the engine and use their OS file manager or external tools. There is no in-engine way to browse the `data/game-assets/` tree, preview files, organize content between categories, or batch-clean up unused assets. This creates friction for content creators who need to quickly verify sprites, audition audio cues, or move files between folders without context-switching out of the app. This PR adds a full-screen File Browser overlay that brings asset management directly into the engine. Discord discussion: https://discord.com/channels/1417099416812392641/1503430688915984494 ## What changed ### New UI (`packages/client/src/components/game-assets/`) - `GameAssetsBrowserView.tsx` — main orchestration component (~780 lines, down from 1632 after component extraction) - `Toolbar.tsx` — breadcrumb, search, view toggle, upload/new/rescan/open buttons, column dropdowns - `AssetGrid.tsx` — grid + list views with always-visible checkboxes for file multi-select - `FolderTree.tsx` — sidebar folder tree with chevron expand/collapse - `SearchInput.tsx` — responsive search (collapses to icon on mobile) - `ImagePreviewModal.tsx` — full-screen image preview with togglable metadata side panel - `AudioPlayerModal.tsx` — audio player with MIME type hints and download fallback - `ImageInfoPopover.tsx` — responsive image info popover (desktop card / mobile bottom sheet) - `FileEditorModal.tsx` — text file editor with line numbers, tab-to-spaces, Markdown preview toggle, keyboard shortcuts (Ctrl+S save, Esc close with unsaved-changes guard) - `ActionDropdown.tsx` — 3-dot action menu with outside-click and scroll-close handling - `constants.tsx` — category icons + default folder descriptions - `utils.tsx` — file-type helpers (`isImage`, `isAudio`, `isEditableText`, `FileIcon`, `countItems`) ### New hooks (`packages/client/src/hooks/use-game-assets.ts`) - Bulk mutation hooks: `useMoveGameAssetsBulk`, `useCopyGameAssetsBulk`, `useDeleteGameAssetsBulk` ### New server routes (`packages/server/src/routes/game-assets.routes.ts`) - `POST /game-assets/move-bulk` — batch move files to target folder - `POST /game-assets/copy-bulk` — batch copy files to target folder - `POST /game-assets/delete-bulk` — batch delete files - All endpoints return `{ succeeded, failed }` arrays for per-file success/failure reporting ### Shared constants (`packages/shared/src/constants/game-assets.ts`) - `IMAGE_EXTS`, `AUDIO_EXTS`, `TEXT_EXTS`, `AUDIO_MIME_MAP` exported for client+server reuse ### Utilities - `packages/client/src/lib/format.ts` — `formatBytes`, `formatDate` ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes Not yet manually tested in-browser. The following need human verification: - Navigate between category folders via sidebar and breadcrumbs - Upload files via drag-and-drop and Upload button - Create new folders/text files via New menu - Rename, move, copy, delete single files - Multi-select files via checkboxes and bulk move/copy/delete - Image/audio/text file previews - Text editor keyboard shortcuts (Ctrl+S, Esc with unsaved guard) - Mobile responsive layout ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) <img width="1700" height="932" alt="Bildschirmfoto 2026-05-11 um 20 00 50" src="https://github.com/user-attachments/assets/870ebcad-40d4-4113-ba17-6d41487ae53f" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Full Game Assets browser: folder tree, grid/list views, search, breadcrumbs, toolbar, and lazy-open overlay * Previews & editors: image preview with info, audio player, text/Markdown editor, and file action menus * Uploads, drag‑and‑drop, multi-select with bulk move/copy/delete, create/rename/move/copy/delete flows and confirmations * **Bug Fixes & UX** * Enforced upload size limits, safer filename handling and collision avoidance, improved error messages, and robust metadata/description persistence [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/692) <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:12 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4732
No description provided.