[PR #1816] [CLOSED] Tighten chat settings metadata typing #5288

Closed
opened 2026-10-22 04:14:57 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1816
Author: @Xelvanis
Created: 6/1/2026
Status: ❌ Closed

Base: refactor ← Head: chore/chat-settings-metadata-types-stacked


📝 Commits (2)

  • d1a5836 Replace UI explicit any usage
  • 6dd8afa Tighten chat settings metadata typing

📊 Changes

25 files changed (+496 additions, -260 deletions)

View changed files

📝 src/app/shell/ChatSidebar.tsx (+8 -4)
📝 src/engine/modes/game/prompts/gm-prompts.ts (+1 -1)
📝 src/features/catalog/characters/components/CharacterListRow.tsx (+7 -2)
📝 src/features/catalog/characters/hooks/use-characters-panel-data.ts (+7 -2)
📝 src/features/catalog/characters/lib/characters-panel-model.ts (+24 -14)
📝 src/features/modes/conversation/components/ChatConversationSurface.tsx (+1 -1)
📝 src/features/modes/conversation/components/ConversationAutonomousEffects.tsx (+1 -1)
📝 src/features/modes/conversation/components/ConversationInput.tsx (+14 -4)
📝 src/features/modes/conversation/components/ConversationMessage.tsx (+2 -12)
📝 src/features/modes/conversation/components/ConversationModeRoute.tsx (+6 -4)
📝 src/features/modes/conversation/components/ConversationView.tsx (+16 -12)
📝 src/features/modes/game/api/game-api.ts (+25 -10)
📝 src/features/modes/game/hooks/use-game.ts (+23 -11)
📝 src/features/modes/roleplay/components/ChatRoleplayPanels.tsx (+17 -10)
📝 src/features/modes/roleplay/components/ChatRoleplaySurface.tsx (+20 -10)
📝 src/features/modes/roleplay/components/EncounterModal.tsx (+26 -3)
📝 src/features/modes/roleplay/components/RoleplayModeRoute.tsx (+5 -1)
📝 src/features/modes/router/components/RecentChats.tsx (+7 -3)
📝 src/features/modes/shared/chat-ui/components/ChatInput.tsx (+13 -3)
📝 src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx (+178 -106)

...and 5 more files

📄 Description

Linked issue

N/A

Why this change

  • Chat settings still had broad metadata reads in the shared settings drawer. Tightening those reads closes the remaining explicit UI metadata typing cleanup while preserving existing bool-ish metadata compatibility.

What changed

  • Replaced the drawer metadata map with Record<string, unknown>.
  • Added local typed metadata readers for strings, arrays, records, numbers, choice selections, translation provider values, scoped regex mode, and character schedules.
  • Normalized settings toggles through the existing bool-ish reader so legacy/imported truthy metadata stays aligned with runtime behavior.
  • Replaced direct metadata casts/usages across prompt drafts, schedules, translation settings, tool/agent controls, context limits, and preset choices.

Refactor impact

Primary owner:

  • Shared mode UI: chat settings drawer.

Impact areas reviewed:

  • Chat, roleplay, and game settings surfaces that share ChatSettingsDrawer.
  • Runtime metadata boolean compatibility for agents/tools and related settings toggles.
  • Preset choices, translation fields, scoped regex mode, schedule editor input, and context limit reads.

Boundary notes:

  • Feature-only UI metadata parsing change.
  • No engine, shared API, Rust, Tauri command, or remote runtime boundary changes.

Pressure points touched:

  • Shared mode UI: src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx.
  • No ModeSurface, GameSurface, command registration, or import module changes.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • pnpm check passes locally before PR push/handoff, including the unused-code check
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Browser screenshot/recording evidence added when UI/browser state is the claim
  • Remote runtime smoke checked when relevant

Manual verification notes

  • Ran git diff --cached --check.
  • Ran pnpm typecheck.
  • Ran pnpm check:architecture.
  • Ran strict explicit-any grep over src/**/*.ts and src/**/*.tsx; remaining hits are prose/comment strings only.
  • Ran pnpm check after the final diff; it passed line endings, architecture, frontend typecheck, Rust workspace check, docs, discovery metadata, and unused-code checks.
  • Browser/Tauri manual verification not run; this is a metadata typing and compatibility cleanup with no intended visual layout change.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Internal shared drawer typing cleanup; no new feature or discoverable workflow.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

Docs/release notes:

  • No docs or release-note changes needed; behavior intent is compatibility-preserving internal cleanup.

UI evidence

  • Not added; no intended visual layout change.

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

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1816 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/1/2026 **Status:** ❌ Closed **Base:** `refactor` ← **Head:** `chore/chat-settings-metadata-types-stacked` --- ### 📝 Commits (2) - [`d1a5836`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d1a5836f6c2214b358ed32d6747dd057b3e59d6c) Replace UI explicit any usage - [`6dd8afa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6dd8afa37eaa52e5201183d6e6513292fbc6a5f2) Tighten chat settings metadata typing ### 📊 Changes **25 files changed** (+496 additions, -260 deletions) <details> <summary>View changed files</summary> 📝 `src/app/shell/ChatSidebar.tsx` (+8 -4) 📝 `src/engine/modes/game/prompts/gm-prompts.ts` (+1 -1) 📝 `src/features/catalog/characters/components/CharacterListRow.tsx` (+7 -2) 📝 `src/features/catalog/characters/hooks/use-characters-panel-data.ts` (+7 -2) 📝 `src/features/catalog/characters/lib/characters-panel-model.ts` (+24 -14) 📝 `src/features/modes/conversation/components/ChatConversationSurface.tsx` (+1 -1) 📝 `src/features/modes/conversation/components/ConversationAutonomousEffects.tsx` (+1 -1) 📝 `src/features/modes/conversation/components/ConversationInput.tsx` (+14 -4) 📝 `src/features/modes/conversation/components/ConversationMessage.tsx` (+2 -12) 📝 `src/features/modes/conversation/components/ConversationModeRoute.tsx` (+6 -4) 📝 `src/features/modes/conversation/components/ConversationView.tsx` (+16 -12) 📝 `src/features/modes/game/api/game-api.ts` (+25 -10) 📝 `src/features/modes/game/hooks/use-game.ts` (+23 -11) 📝 `src/features/modes/roleplay/components/ChatRoleplayPanels.tsx` (+17 -10) 📝 `src/features/modes/roleplay/components/ChatRoleplaySurface.tsx` (+20 -10) 📝 `src/features/modes/roleplay/components/EncounterModal.tsx` (+26 -3) 📝 `src/features/modes/roleplay/components/RoleplayModeRoute.tsx` (+5 -1) 📝 `src/features/modes/router/components/RecentChats.tsx` (+7 -3) 📝 `src/features/modes/shared/chat-ui/components/ChatInput.tsx` (+13 -3) 📝 `src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx` (+178 -106) _...and 5 more files_ </details> ### 📄 Description ## Linked issue N/A ## Why this change - Chat settings still had broad metadata reads in the shared settings drawer. Tightening those reads closes the remaining explicit UI metadata typing cleanup while preserving existing bool-ish metadata compatibility. ## What changed - Replaced the drawer metadata map with `Record<string, unknown>`. - Added local typed metadata readers for strings, arrays, records, numbers, choice selections, translation provider values, scoped regex mode, and character schedules. - Normalized settings toggles through the existing bool-ish reader so legacy/imported truthy metadata stays aligned with runtime behavior. - Replaced direct metadata casts/usages across prompt drafts, schedules, translation settings, tool/agent controls, context limits, and preset choices. ## Refactor impact Primary owner: - Shared mode UI: chat settings drawer. Impact areas reviewed: - Chat, roleplay, and game settings surfaces that share `ChatSettingsDrawer`. - Runtime metadata boolean compatibility for agents/tools and related settings toggles. - Preset choices, translation fields, scoped regex mode, schedule editor input, and context limit reads. Boundary notes: - Feature-only UI metadata parsing change. - No engine, shared API, Rust, Tauri command, or remote runtime boundary changes. Pressure points touched: - Shared mode UI: `src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx`. - No ModeSurface, GameSurface, command registration, or import module changes. ## Validation - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] `pnpm check` passes locally before PR push/handoff, including the unused-code check - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Browser screenshot/recording evidence added when UI/browser state is the claim - [ ] Remote runtime smoke checked when relevant ### Manual verification notes - Ran `git diff --cached --check`. - Ran `pnpm typecheck`. - Ran `pnpm check:architecture`. - Ran strict explicit-`any` grep over `src/**/*.ts` and `src/**/*.tsx`; remaining hits are prose/comment strings only. - Ran `pnpm check` after the final diff; it passed line endings, architecture, frontend typecheck, Rust workspace check, docs, discovery metadata, and unused-code checks. - Browser/Tauri manual verification not run; this is a metadata typing and compatibility cleanup with no intended visual layout change. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [ ] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Internal shared drawer typing cleanup; no new feature or discoverable workflow. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims Docs/release notes: - No docs or release-note changes needed; behavior intent is compatibility-preserving internal cleanup. ## UI evidence - Not added; no intended visual layout change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:14:57 +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#5288
No description provided.