mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2271] [Issue]: 09-CHAT-STORAGE-sidebar-summaries-folders loses folder cleanup/order semantics #1108
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1108
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2271
Originally assigned to: @Promansis on GitHub.
Summary
09-CHAT-STORAGE-sidebar-summaries-foldersparity gap from #2268 Batch 3: refactor chat folders use generic storage CRUD, so legacy folder defaults/order, delete cleanup, and move semantics are not preserved.Expected behavior
Chat sidebar folders should preserve legacy behavior:
color,sortOrder, andcollapsed, inserts the new folder at the top, and shifts existing folder order.folderIdvalues.Actual behavior
Refactor folder hooks call generic storage APIs for
chat-foldersand generic chat patching for moves. Thechat-foldersstorage contract has no create defaults and no delete cleanup, so newly-created folders can miss expected fields/order and deleting a folder can leave chats pointing at a deleted folder. The sidebar groups any chat with a truthyfolderIdintofolderChatsMap, but only renders folders that still exist, so stale folder IDs can hide chats from the rendered unfiled/folder lists.Steps to reproduce
useCreateFolder,useDeleteFolder, anduseMoveChatinsrc/features/catalog/chats/hooks/use-chat-folders.ts.chat-folderscollection contract and generic create/delete paths insrc-tauri/src/commands/storage/contracts.rsandsrc-tauri/src/commands/storage/commands/entities.rs.main.Impact area
Environment
refactor@37585ab9static trace; legacy sourcemain/ legacy checkout7c6190aaLogs, screenshots, or video
Static proof only from the parityscan receipt:
src/features/catalog/chats/hooks/use-chat-folders.ts:22,src/features/catalog/chats/hooks/use-chat-folders.ts:48,src/features/catalog/chats/hooks/use-chat-folders.ts:71.chat-folderscontract hasEMPTY_DEFAULTSandEMPTY_CLEANUP:src-tauri/src/commands/storage/contracts.rs:377.src-tauri/src/commands/storage/commands/entities.rs:417,src-tauri/src/commands/storage/commands/entities.rs:509.chat-foldershas none:src-tauri/src/commands/storage/commands/entities.rs:748.src/app/shell/ChatSidebar.tsx:389,src/app/shell/ChatSidebar.tsx:1188.packages/server/src/services/storage/chat-folders.storage.ts:20.packages/server/src/services/storage/chat-folders.storage.ts:62.packages/server/src/routes/chat-folders.routes.ts:70.Regression notes
Worked in legacy
main: dedicatedchat-foldersroutes/storage handled create defaults/order, delete cleanup, and folder move validation. Refactor current implementation appears to route these through generic storage without equivalentchat-foldersdefaults or cleanup.Acceptance criteria:
color,sortOrder,collapsed,createdAt, andupdatedAtcompatible with legacy expectations.folderId: null; no chat disappears due to a stale folder ID.Additional context
Source surface:
09-CHAT-STORAGE-sidebar-summaries-foldersin #2268.Batch 3 also scanned
09-CHAT-PERF-message-pagination-count-projection; that surface was no-gap/refactor-better and should not get an issue.Follow-up not filed here: legacy branch-sibling propagation during folder moves was observed, but branch/chat-file grouping is tracked by a separate #2268 surface, so this issue keeps acceptance criteria to the sidebar folder contract.
Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: