mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #370] [MERGED] fix(chat): hide deleted characters from group trigger response menu #4585
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#4585
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/370
Author: @cha1latte
Created: 5/3/2026
Status: ✅ Merged
Merged: 5/3/2026
Merged by: @SpicyMarinara
Base:
main← Head:fix/group-chat-trigger-response-deleted-chars📝 Commits (1)
51861a3fix(chat): hide deleted characters from group trigger response menu📊 Changes
2 files changed (+24 additions, -20 deletions)
View changed files
📝
packages/client/src/components/chat/ChatRoleplaySurface.tsx(+11 -9)📝
packages/client/src/components/chat/ConversationView.tsx(+13 -11)📄 Description
Summary
In group chats with Individual + Manual response mode, deleted character cards appeared as "Unknown" entries in the trigger response picker (the button between emote and send). Users had no way to remove them since the deleted characters no longer existed under Chat Settings → Characters.
This fix filters out IDs whose characters no longer exist before rendering the picker, matching the convention already used by the chat settings drawer.
Reported in: Discord
Why
The server's
DELETE /characters/:idroute intentionally does not cascade-cleanchat.characterIdsarrays in existing chats. The client convention is to tolerate dangling IDs by filtering on render — this is whatChatSettingsDrawer.tsx:1383-1384already does (if (!c) return null).The trigger response picker was the one render path that didn't follow this convention. Instead of filtering, it mapped every ID and fell back to
name: "Unknown", producing visible-but-uninteractable phantom entries.What changed
Two files, identical fix pattern:
ChatRoleplaySurface.tsx—chatCharactersprop now.filter()s bycharacterMap.has(id)before mapping.ConversationView.tsx— same filter applied to the conversation-mode surface.No server changes. No schema changes. No new tests (no automated test suite for this surface).
Edge cases
chatCharacters.length > 1after filtering).chatCharIds.lengthand can be off-by-one when stale IDs exist. Will file as a separate follow-up.Test plan
Manual verification on Windows test install (port 7820), Roleplay mode group chat, Individual + Manual response order:
pnpm checkpasses locallyScreenshots
Before (current bug — two deleted characters appear as "Unknown"):

After (this PR — only valid characters listed):

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