[PR #1817] [MERGED] Tighten chat settings metadata typing #5287

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1817
Author: @Xelvanis
Created: 6/1/2026
Status: ✅ Merged
Merged: 6/1/2026
Merged by: @Xelvanis

Base: refactor ← Head: chore/chat-settings-metadata-typing


📝 Commits (3)

  • 761470c Tighten chat settings metadata typing
  • 514f355 Address chat settings review findings
  • 69a3d0a Skip malformed schedule metadata entries

📊 Changes

1 file changed (+245 additions, -108 deletions)

View changed files

📝 src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx (+245 -108)

📄 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

  • Confirmed PR branch diff against origin/refactor is one file: src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx.
  • Ran git diff --check origin/refactor...HEAD.
  • Ran strict explicit-any grep over src/**/*.ts and src/**/*.tsx; remaining hits are prose/comment strings only.
  • Ran pnpm typecheck.
  • Ran pnpm check:architecture.
  • Ran pnpm check after the final refactor-based branch; 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.

Summary by CodeRabbit

  • Bug Fixes

    • Improved consistency of toggle states across chat settings for group chat, autonomous messaging, function calling, and context limits.
    • Added live Discord webhook URL validation in settings.
  • Refactor

    • Streamlined internal chat settings handling and metadata management for improved reliability.

🔄 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/1817 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/1/2026 **Status:** ✅ Merged **Merged:** 6/1/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `chore/chat-settings-metadata-typing` --- ### 📝 Commits (3) - [`761470c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/761470c7335c766b2eb9c3032193ddbbce99333a) Tighten chat settings metadata typing - [`514f355`](https://github.com/Pasta-Devs/Marinara-Engine/commit/514f3550bfc02cdb57aeb34300911d777d1bd50f) Address chat settings review findings - [`69a3d0a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/69a3d0a361a7fa7cc3397aa0c8ae973d02b1e256) Skip malformed schedule metadata entries ### 📊 Changes **1 file changed** (+245 additions, -108 deletions) <details> <summary>View changed files</summary> 📝 `src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx` (+245 -108) </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 - Confirmed PR branch diff against `origin/refactor` is one file: `src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx`. - Ran `git diff --check origin/refactor...HEAD`. - Ran strict explicit-`any` grep over `src/**/*.ts` and `src/**/*.tsx`; remaining hits are prose/comment strings only. - Ran `pnpm typecheck`. - Ran `pnpm check:architecture`. - Ran `pnpm check` after the final refactor-based branch; 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. - [x] 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 is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved consistency of toggle states across chat settings for group chat, autonomous messaging, function calling, and context limits. * Added live Discord webhook URL validation in settings. * **Refactor** * Streamlined internal chat settings handling and metadata management for improved reliability. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <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:56 +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#5287
No description provided.