mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2675] [Bug]: Inconsistent Chat Sidebar Position Update #1321
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#1321
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 @Gunterlie on GitHub (Jun 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2675
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Navigating to a chat does not consistently update its position in the sidebar (sorted by
updatedAt):Root Cause
The jump for RP chats is an unintentional side effect of the background persistence logic in
ChatArea.tsx. When navigating to an RP/visual_novel chat with no saved background in metadata:chatBackground = defaultRoleplayBackgroundsavedBackground (null) !== nextBackgroundand firesupdateMeta.mutate({ id, background: nextBackground })patchMetadatacall touchesupdatedAtby defaultchatKeys.list()is invalidated → list refetches → chat sorts to topAfter the first visit the background is saved, so no write fires on subsequent navigations — the RP chat stops jumping.
Conversation chats have no equivalent write on navigation.
Files Involved
packages/client/src/components/chat/ChatArea.tsx— background restore/persist effectspackages/server/src/services/storage/chats.storage.ts—patchMetadata/touchUpdatedAtpackages/client/src/components/layout/ChatSidebar.tsx— sorts byupdatedAt@SpicyMarinara commented on GitHub (Jun 21, 2026):
Fixed in the issue sweep branch by adding an explicit chat touch path when a chat is opened, so sidebar recency sorting no longer depends on incidental metadata writes from roleplay backgrounds. Final validation and PR are coming after the full issue pass.