[GH-ISSUE #1523] [Issue]: Chat settings preset dropdown can show every preset as Default #769

Closed
opened 2026-10-20 17:33:09 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Xelvanis on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1523

Originally assigned to: @Promansis on GitHub.

Summary

In the Chat Settings drawer, chat-settings presets can all appear as Default instead of their saved preset names.

Current code appears to treat raw truthy isDefault values as booleans in the dropdown, so imported or legacy rows with string values such as "false" can still render as default.

Expected behavior

The preset dropdown should display each preset's actual saved name unless it is truly the built-in/default preset.

Imported or migrated preset rows should be normalized so isDefault, default, isActive, and active are real booleans before UI display and selection logic runs.

Actual behavior

Reported behavior: every preset in the Chat Settings drawer dropdown shows as Default.

Current-code audit on latest origin/refactor found the drawer still renders options with raw truthiness:

<option key={p.id} value={p.id}>
  {p.isDefault ? "Default" : p.name}
</option>

The selected-preset fallback also uses presetList.find((p) => p.isDefault) without boolish coercion.

Steps to reproduce

  1. Open a refactor build with chat preset rows whose boolean flags are stored as strings, such as imported legacy rows with isDefault: "false".
  2. Open a Roleplay or Conversation chat.
  3. Open the Chat Settings drawer.
  4. Inspect the chat-settings preset dropdown.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: origin/refactor at e79891d9
  • Run mode: code audit against refactor UI/storage path; original report came from Roleplay use
  • OS + version: not OS-specific
  • Node + pnpm versions: not captured
  • Rust version, if relevant: not captured
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: not relevant

Logs, screenshots, or video

Code paths inspected:

  • src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx
  • src/features/catalog/chat-presets/hooks/use-chat-presets.ts
  • src-tauri/src/commands/storage/shared.rs
  • src-tauri/src/commands/storage/profile/legacy.rs

Relevant findings:

  • The drawer renders p.isDefault ? "Default" : p.name directly.
  • The selected-preset fallback uses raw p.isDefault.
  • useChatPresets returns storage rows without normalizing boolean-ish fields.
  • with_entity_defaults currently normalizes chat-presets JSON object fields, but does not coerce isDefault, default, isActive, or active to booleans.

Regression notes

Unknown. Reported during Roleplay audit on the refactor branch.

Additional context

Likely fix areas:

  • normalize boolean-ish chat-preset flags at the storage/import boundary, and/or
  • use existing boolish-style coercion in the drawer and chat-preset hooks.

Template check

Please uncheck 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 @Xelvanis on GitHub (May 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1523 Originally assigned to: @Promansis on GitHub. ## Summary In the Chat Settings drawer, chat-settings presets can all appear as `Default` instead of their saved preset names. Current code appears to treat raw truthy `isDefault` values as booleans in the dropdown, so imported or legacy rows with string values such as `"false"` can still render as default. ## Expected behavior The preset dropdown should display each preset's actual saved name unless it is truly the built-in/default preset. Imported or migrated preset rows should be normalized so `isDefault`, `default`, `isActive`, and `active` are real booleans before UI display and selection logic runs. ## Actual behavior Reported behavior: every preset in the Chat Settings drawer dropdown shows as `Default`. Current-code audit on latest `origin/refactor` found the drawer still renders options with raw truthiness: ```tsx <option key={p.id} value={p.id}> {p.isDefault ? "Default" : p.name} </option> ``` The selected-preset fallback also uses `presetList.find((p) => p.isDefault)` without boolish coercion. ## Steps to reproduce 1. Open a refactor build with chat preset rows whose boolean flags are stored as strings, such as imported legacy rows with `isDefault: "false"`. 2. Open a Roleplay or Conversation chat. 3. Open the Chat Settings drawer. 4. Inspect the chat-settings preset dropdown. ## Impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [x] Chat mode - [x] Roleplay mode - [ ] Game mode - [x] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `origin/refactor` at `e79891d9` - Run mode: code audit against refactor UI/storage path; original report came from Roleplay use - OS + version: not OS-specific - Node + pnpm versions: not captured - Rust version, if relevant: not captured - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: not relevant ## Logs, screenshots, or video Code paths inspected: - `src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx` - `src/features/catalog/chat-presets/hooks/use-chat-presets.ts` - `src-tauri/src/commands/storage/shared.rs` - `src-tauri/src/commands/storage/profile/legacy.rs` Relevant findings: - The drawer renders `p.isDefault ? "Default" : p.name` directly. - The selected-preset fallback uses raw `p.isDefault`. - `useChatPresets` returns storage rows without normalizing boolean-ish fields. - `with_entity_defaults` currently normalizes `chat-presets` JSON object fields, but does not coerce `isDefault`, `default`, `isActive`, or `active` to booleans. ## Regression notes Unknown. Reported during Roleplay audit on the refactor branch. ## Additional context Likely fix areas: - normalize boolean-ish chat-preset flags at the storage/import boundary, and/or - use existing boolish-style coercion in the drawer and chat-preset hooks. ## Template check Please uncheck 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-20 17:33:09 +07:00
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#769
No description provided.