[GH-ISSUE #3575] [issue]: Setup wizard Name field reverts when opening the Connection dropdown (Roleplay / Conversation) #1936

Closed
opened 2026-10-21 05:43:57 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @yozlet on GitHub (Jul 13, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3575

Summary

In the New Roleplay (and New Conversation) setup wizard, replacing the default Name and then clicking the Connection dropdown causes the Name field to snap back to the default (New Roleplay / New Conversation) as soon as the dropdown opens — before any connection is selected.

[NOTE: The initial investigation & recommendations were made by Prof. Mari (Nemotron 3 Ultra), then reviewed & refined by Cursor (Grok 4.5 Medium) and me.]

Expected behavior

The Name field should keep the typed value when focus moves to the Connection dropdown (and when a connection is later selected).

Actual behavior

Opening the Connection dropdown blurs the Name field. The Name input remounts and shows the previous default chat name again. The typed name is discarded from the field (a rename mutation may still be in flight / later succeed for the sidebar, but the visible wizard field has already reset).

Steps to reproduce

  1. Open Marinara → RP tab → New Roleplay (or CONVO → New Conversation).
  2. On the Name & Connection step, replace the default Name with e.g. Test.
  3. Click the Connection dropdown to open it (do not select a value yet).
  4. Observe: Name reverts to New Roleplay / New Conversation.

Environment

  • Marinara Engine version: 2.2.0
  • Install type: Docker
  • OS + version: macOS (darwin 25)
  • Browser or app shell: Desktop browser / Cursor embedded browser

Logs, screenshots, or video

N/A — reproducible in UI. Trigger is opening Connection, not selecting a connection.

Additional context

Root cause: ChatSetupWizard.tsx uses an uncontrolled Name input with:

  • key={userEditedName ? "user" : chat.name}
  • defaultValue={chat.name}
  • onBlur → setUserEditedName(true) + updateChat.mutate({ name })

Flipping userEditedName changes the React key, remounting the input while chat.name is still the default (useUpdateChat is not optimistic). Same pattern exists for both Roleplay and Conversation Name fields.

Not affected: New Game setup (GameSetupWizard) uses controlled gameName state and does not show this reset on connection interaction.

Files:

  • packages/client/src/components/chat/ChatSetupWizard.tsx (Roleplay ~2208–2218; Conversation ~1067–1077)
  • packages/client/src/hooks/use-chats.ts (useUpdateChat)

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @yozlet on GitHub (Jul 13, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3575 ## Summary In the New Roleplay (and New Conversation) setup wizard, replacing the default Name and then clicking the Connection dropdown causes the Name field to snap back to the default (`New Roleplay` / `New Conversation`) as soon as the dropdown opens — before any connection is selected. _[NOTE: The initial investigation & recommendations were made by Prof. Mari (Nemotron 3 Ultra), then reviewed & refined by Cursor (Grok 4.5 Medium) and me.]_ ## Expected behavior The Name field should keep the typed value when focus moves to the Connection dropdown (and when a connection is later selected). ## Actual behavior Opening the Connection dropdown blurs the Name field. The Name input remounts and shows the previous default chat name again. The typed name is discarded from the field (a rename mutation may still be in flight / later succeed for the sidebar, but the visible wizard field has already reset). ## Steps to reproduce 1. Open Marinara → **RP** tab → **New Roleplay** (or **CONVO** → **New Conversation**). 2. On the Name & Connection step, replace the default Name with e.g. `Test`. 3. Click the **Connection** dropdown to open it (do not select a value yet). 4. Observe: Name reverts to `New Roleplay` / `New Conversation`. ## Environment - Marinara Engine version: 2.2.0 - Install type: Docker - OS + version: macOS (darwin 25) - Browser or app shell: Desktop browser / Cursor embedded browser ## Logs, screenshots, or video N/A — reproducible in UI. Trigger is opening Connection, not selecting a connection. ## Additional context **Root cause:** `ChatSetupWizard.tsx` uses an uncontrolled Name input with: - `key={userEditedName ? "user" : chat.name}` - `defaultValue={chat.name}` - `onBlur` → `setUserEditedName(true)` + `updateChat.mutate({ name })` Flipping `userEditedName` changes the React `key`, remounting the input while `chat.name` is still the default (`useUpdateChat` is not optimistic). Same pattern exists for both Roleplay and Conversation Name fields. **Not affected:** New Game setup (`GameSetupWizard`) uses controlled `gameName` state and does not show this reset on connection interaction. **Files:** - `packages/client/src/components/chat/ChatSetupWizard.tsx` (Roleplay ~2208–2218; Conversation ~1067–1077) - `packages/client/src/hooks/use-chats.ts` (`useUpdateChat`) ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:43:57 +07:00
  • closed this issue
  • added the
    bug
    label
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#1936
No description provided.