[GH-ISSUE #3119] [Issue]: "Manage Chat Files" drawer is fully built but has no button to open it (dead code) #1670

Closed
opened 2026-10-21 05:41:33 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @kolacheee on GitHub (Jun 30, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3119

Originally assigned to: @SpicyMarinara on GitHub.

What's wrong

The "Manage Chat Files" drawer (ChatFilesDrawer) is fully built and ships in the bundle, but there's no way for a user to open it. There's no toolbar button, slash command, or shortcut that triggers it, so a complete feature is dead code in the running app.

The drawer is meant to let you browse, switch between, rename, export, import, and delete the saved chat files for the current character — Marinara's equivalent of SillyTavern's "Manage chat files" (the component header even says so).

How to reproduce (try it yourself)

  1. Open any chat (roleplay or conversation).
  2. Look through the chat toolbar / overflow menu for a way to open chat-file management (the way Gallery, Lorebook, Branch, etc. each have a button).

You'll see: there's no entry point anywhere — the drawer can never appear.
Expected: a toolbar button opens ChatFilesDrawer so you can switch between / rename / delete / import / export the chat files in the current group, like SillyTavern's "Manage chat files."

To confirm the component itself is complete: temporarily make it render — e.g. change ChatConversationSurface.tsx:192 from filesOpen={false} to filesOpen={true}, or initialize filesOpen to true in ChatArea.tsx:427 — and the working drawer appears.

Where it is

  • The component is fully implemented: packages/client/src/components/chat/ChatFilesDrawer.tsx (ChatFilesDrawer, line 29) — import/switch/export/delete/rename of the group's chats, with the header comment "Manage Chat Files … Like SillyTavern's 'Manage chat files' feature" (lines 1-4).
  • It's rendered only when filesOpen is true: packages/client/src/components/chat/ChatCommonOverlays.tsx:314 — {filesOpen && <ChatFilesDrawer chat={chat} open={filesOpen} onClose={onCloseFiles} />}.
  • But the state is never opened: packages/client/src/components/chat/ChatArea.tsx:427 declares const [filesOpen, setFilesOpen] = useState(false), and setFilesOpen is only ever called with false (514 reset, 2463/2662 close). setFilesOpen(true) appears nowhere, and there is an onCloseFiles prop but no onOpenFiles.
  • The conversation surface doesn't even wire the state: packages/client/src/components/chat/ChatConversationSurface.tsx:192 hard-codes filesOpen={false} and :210 onCloseFiles={() => undefined}.

For contrast, the sibling Gallery drawer is wired correctly and is the pattern to copy: galleryOpen state (ChatArea.tsx:428) is opened via setGalleryOpen(true) (493), threaded through an onOpenGallery prop, and triggered by <ChatToolbarButton icon={<Image/>} title="Gallery" onClick={onOpenGallery} /> (ChatRoleplaySurface.tsx:1551). Files has every equivalent piece except the open-prop and the button.

What's happening

The drawer was implemented and its render + close paths were wired, but the open trigger (a toolbar button + an onOpenFiles handler that calls setFilesOpen(true)) was never added, and the conversation surface passes a hard-coded false. So filesOpen is permanently false.

Suggested fix

Mirror the Gallery wiring for Files:

  1. Add a handleOpenFiles (or reuse setFilesOpen(true)) in ChatArea.tsx and pass it down as an onOpenFiles prop alongside the existing onCloseFiles.
  2. Thread onOpenFiles through ChatRoleplaySurface and ChatConversationSurface (and replace the hard-coded filesOpen={false} / onCloseFiles={() => undefined} in ChatConversationSurface.tsx:192/210 with the real state + handlers).
  3. Add a <ChatToolbarButton> (e.g. a FileText / FolderOpen icon, title "Chat Files") next to the Gallery button that calls onOpenFiles.

No changes to ChatFilesDrawer itself are needed — it already accepts chat / open / onClose.

Reported on v2.0.8; confirmed still present on current main (v2.0.9).


AI-investigated against the current tree (v2.0.9) from the user's report; cited lines read and confirmed. Please verify before fixing.

Originally created by @kolacheee on GitHub (Jun 30, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3119 Originally assigned to: @SpicyMarinara on GitHub. **What's wrong** The "Manage Chat Files" drawer (`ChatFilesDrawer`) is fully built and ships in the bundle, but there's **no way for a user to open it**. There's no toolbar button, slash command, or shortcut that triggers it, so a complete feature is dead code in the running app. The drawer is meant to let you browse, switch between, rename, export, import, and delete the saved chat files for the current character — Marinara's equivalent of SillyTavern's "Manage chat files" (the component header even says so). **How to reproduce (try it yourself)** 1. Open any chat (roleplay or conversation). 2. Look through the chat toolbar / overflow menu for a way to open chat-file management (the way Gallery, Lorebook, Branch, etc. each have a button). **You'll see:** there's no entry point anywhere — the drawer can never appear. **Expected:** a toolbar button opens `ChatFilesDrawer` so you can switch between / rename / delete / import / export the chat files in the current group, like SillyTavern's "Manage chat files." To confirm the component itself is complete: temporarily make it render — e.g. change `ChatConversationSurface.tsx:192` from `filesOpen={false}` to `filesOpen={true}`, or initialize `filesOpen` to `true` in `ChatArea.tsx:427` — and the working drawer appears. **Where it is** - The component is fully implemented: `packages/client/src/components/chat/ChatFilesDrawer.tsx` (`ChatFilesDrawer`, line 29) — import/switch/export/delete/rename of the group's chats, with the header comment "Manage Chat Files … Like SillyTavern's 'Manage chat files' feature" (lines 1-4). - It's rendered only when `filesOpen` is true: `packages/client/src/components/chat/ChatCommonOverlays.tsx:314` — `{filesOpen && <ChatFilesDrawer chat={chat} open={filesOpen} onClose={onCloseFiles} />}`. - But the state is never opened: `packages/client/src/components/chat/ChatArea.tsx:427` declares `const [filesOpen, setFilesOpen] = useState(false)`, and `setFilesOpen` is only ever called with **`false`** (514 reset, 2463/2662 close). `setFilesOpen(true)` appears nowhere, and there is an `onCloseFiles` prop but no `onOpenFiles`. - The conversation surface doesn't even wire the state: `packages/client/src/components/chat/ChatConversationSurface.tsx:192` hard-codes `filesOpen={false}` and `:210` `onCloseFiles={() => undefined}`. For contrast, the sibling **Gallery** drawer is wired correctly and is the pattern to copy: `galleryOpen` state (`ChatArea.tsx:428`) is opened via `setGalleryOpen(true)` (493), threaded through an `onOpenGallery` prop, and triggered by `<ChatToolbarButton icon={<Image/>} title="Gallery" onClick={onOpenGallery} />` (`ChatRoleplaySurface.tsx:1551`). Files has every equivalent piece **except** the open-prop and the button. **What's happening** The drawer was implemented and its render + close paths were wired, but the open trigger (a toolbar button + an `onOpenFiles` handler that calls `setFilesOpen(true)`) was never added, and the conversation surface passes a hard-coded `false`. So `filesOpen` is permanently `false`. **Suggested fix** Mirror the Gallery wiring for Files: 1. Add a `handleOpenFiles` (or reuse `setFilesOpen(true)`) in `ChatArea.tsx` and pass it down as an `onOpenFiles` prop alongside the existing `onCloseFiles`. 2. Thread `onOpenFiles` through `ChatRoleplaySurface` and `ChatConversationSurface` (and replace the hard-coded `filesOpen={false}` / `onCloseFiles={() => undefined}` in `ChatConversationSurface.tsx:192/210` with the real state + handlers). 3. Add a `<ChatToolbarButton>` (e.g. a `FileText` / `FolderOpen` icon, title "Chat Files") next to the Gallery button that calls `onOpenFiles`. No changes to `ChatFilesDrawer` itself are needed — it already accepts `chat` / `open` / `onClose`. Reported on v2.0.8; confirmed still present on current `main` (v2.0.9). --- *AI-investigated against the current tree (v2.0.9) from the user's report; cited lines read and confirmed. Please verify before fixing.*
bsakaguchi 2026-10-21 05:41:33 +07:00
  • closed this issue
  • added the
    in-pr
    label
Author
Owner

@SpicyMarinara commented on GitHub (Jul 2, 2026):

Replaced by the Branches menu, that one was obsolete. I'll remove the leftover code.

<!-- gh-comment-id:4864228667 --> @SpicyMarinara commented on GitHub (Jul 2, 2026): Replaced by the Branches menu, that one was obsolete. I'll remove the leftover code.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 2, 2026):

Codex is taking this in branch codex/issue-sweep-3119-3135 for a staging-targeted cleanup sweep.

<!-- gh-comment-id:4864514461 --> @SpicyMarinara commented on GitHub (Jul 2, 2026): Codex is taking this in branch codex/issue-sweep-3119-3135 for a staging-targeted cleanup sweep.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 2, 2026):

Fix is ready in PR #3138 with CI passing. This issue will close automatically when the PR merges into staging.

<!-- gh-comment-id:4864746776 --> @SpicyMarinara commented on GitHub (Jul 2, 2026): Fix is ready in PR #3138 with CI passing. This issue will close automatically when the PR merges into staging.
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#1670
No description provided.