[PR #4555] [MERGED] Persist library folders on the server #6423

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4555
Author: @minikkeuen
Created: 8/4/2026
Status: ✅ Merged
Merged: 8/4/2026
Merged by: @SpicyMarinara

Base: staging ← Head: library-folder-persistence


📝 Commits (5)

  • 5c72d58 feat: persist library folders in server storage
  • 449a340 Merge remote-tracking branch 'origin/staging' into library-folder-persistence
  • 483b5d8 fix: harden library folder persistence
  • 6847082 fix: harden library folder migration
  • 41a3a4d Merge branch 'staging' into library-folder-persistence

📊 Changes

10 files changed (+382 additions, -53 deletions)

View changed files

📝 packages/client/src/hooks/use-library-folders.ts (+71 -53)
📝 packages/server/src/db/file-backed-store.ts (+1 -0)
📝 packages/server/src/db/schema/index.ts (+1 -0)
➕ packages/server/src/db/schema/library-folders.ts (+16 -0)
📝 packages/server/src/routes/admin.routes.ts (+9 -0)
📝 packages/server/src/routes/index.ts (+2 -0)
➕ packages/server/src/routes/library-folders.routes.ts (+57 -0)
➕ packages/server/src/services/storage/library-folders.storage.ts (+145 -0)
📝 packages/shared/src/index.ts (+1 -0)
➕ packages/shared/src/schemas/library-folder.schema.ts (+79 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #4554

Why this change

  • Library folders were stored only in client-side storage, so they were lost after clearing browser data and were not shared across devices connected to the same Marinara server.
  • This change makes library folders behave consistently with other server-backed resources.

What changed

  • Added a shared schema for library folders.
  • Added server-side storage and API routes for library folders.
  • Updated the client to use the server API for library folders.
  • Added support for migrating existing local folder data to the server.
  • Registered library folders with the existing file-backed storage system.
  • Included library folders in admin data reset.

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

  • Created, renamed, moved, and deleted library folders.
  • Verified that folders persist after restarting the server.
  • Verified that folders persist after clearing browser data.
  • Verified that folders are available from another device connected to the same server.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

N/A

Summary by CodeRabbit

  • New Features
    • Library folders are now stored and synchronized through the server.
    • Create, rename, collapse, reorder, and delete folders across supported library areas.
    • Move multiple library items between folders or back to the uncategorized view.
    • Existing locally stored folders are migrated automatically, with retries if migration fails.
  • Bug Fixes
    • Folder changes remain consistent across sessions and devices.
    • Invalid folder operations return clear validation or not-found errors.
    • Removing a library area now also removes its associated folders.

🔄 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/4555 **Author:** [@minikkeuen](https://github.com/minikkeuen) **Created:** 8/4/2026 **Status:** ✅ Merged **Merged:** 8/4/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `library-folder-persistence` --- ### 📝 Commits (5) - [`5c72d58`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5c72d588c1e257fad0b85555646f94129f8df1cb) feat: persist library folders in server storage - [`449a340`](https://github.com/Pasta-Devs/Marinara-Engine/commit/449a340d0a1bcfefa40c0f74aaf3a228b213e5eb) Merge remote-tracking branch 'origin/staging' into library-folder-persistence - [`483b5d8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/483b5d8f8487cbe6ff48578eac32be960c7566b2) fix: harden library folder persistence - [`6847082`](https://github.com/Pasta-Devs/Marinara-Engine/commit/68470827aae0b2a76275a10a6799193e4aceeea1) fix: harden library folder migration - [`41a3a4d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/41a3a4d7bb19c9bc0346dcde6b6785861259857f) Merge branch 'staging' into library-folder-persistence ### 📊 Changes **10 files changed** (+382 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/hooks/use-library-folders.ts` (+71 -53) 📝 `packages/server/src/db/file-backed-store.ts` (+1 -0) 📝 `packages/server/src/db/schema/index.ts` (+1 -0) ➕ `packages/server/src/db/schema/library-folders.ts` (+16 -0) 📝 `packages/server/src/routes/admin.routes.ts` (+9 -0) 📝 `packages/server/src/routes/index.ts` (+2 -0) ➕ `packages/server/src/routes/library-folders.routes.ts` (+57 -0) ➕ `packages/server/src/services/storage/library-folders.storage.ts` (+145 -0) 📝 `packages/shared/src/index.ts` (+1 -0) ➕ `packages/shared/src/schemas/library-folder.schema.ts` (+79 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #4554 ## Why this change - Library folders were stored only in client-side storage, so they were lost after clearing browser data and were not shared across devices connected to the same Marinara server. - This change makes library folders behave consistently with other server-backed resources. ## What changed - Added a shared schema for library folders. - Added server-side storage and API routes for library folders. - Updated the client to use the server API for library folders. - Added support for migrating existing local folder data to the server. - Registered library folders with the existing file-backed storage system. - Included library folders in admin data reset. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [ ] 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 - Created, renamed, moved, and deleted library folders. - Verified that folders persist after restarting the server. - Verified that folders persist after clearing browser data. - Verified that folders are available from another device connected to the same server. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) N/A <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Library folders are now stored and synchronized through the server. * Create, rename, collapse, reorder, and delete folders across supported library areas. * Move multiple library items between folders or back to the uncategorized view. * Existing locally stored folders are migrated automatically, with retries if migration fails. * **Bug Fixes** * Folder changes remain consistent across sessions and devices. * Invalid folder operations return clear validation or not-found errors. * Removing a library area now also removes its associated folders. <!-- 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-23 04:10:16 +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#6423
No description provided.