[PR #1587] [MERGED] Restore practical Knip helper wiring #5127

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1587
Author: @Xelvanis
Created: 5/29/2026
Status: ✅ Merged
Merged: 5/29/2026
Merged by: @Xelvanis

Base: refactor ← Head: restore/knip-command-help-slice


📝 Commits (9)

  • 0f5645b Restore help label helper and narrow exports
  • 8d2adb2 Restore UI store constants in callers
  • 7dd4ea8 Restore TTS config schema boundary
  • 38b76fc Restore agent retry failure toast formatting
  • 82b339a Restore tracker temperature unit options
  • f38178e Harden TTS config read normalization
  • 4432a1b Reject malformed TTS config responses
  • c3df033 Merge remote-tracking branch 'origin/refactor' into restore/knip-command-help-slice
  • f16ba5b Bump UI store migration version

📊 Changes

15 files changed (+238 additions, -114 deletions)

View changed files

📝 src/engine/contracts/types/tts.ts (+5 -7)
📝 src/features/runtime/generation/hooks/use-generate.ts (+17 -16)
📝 src/features/runtime/tracker/components/TrackerSidebarHeader.tsx (+7 -4)
📝 src/features/shell/settings/components/SettingsPanel.tsx (+62 -35)
📝 src/features/shell/settings/components/settings/TTSConfigCard.tsx (+6 -3)
📝 src/shared/api/integration-utility-api.ts (+0 -1)
📝 src/shared/api/tts-api.test.ts (+51 -2)
📝 src/shared/api/tts-api.ts (+28 -3)
📝 src/shared/hooks/use-tts.ts (+1 -6)
➕ src/shared/lib/agent-failures.test.ts (+30 -0)
📝 src/shared/lib/slash-commands.ts (+10 -10)
📝 src/shared/lib/tts-service.ts (+1 -1)
📝 src/shared/stores/ui.store.ts (+2 -11)
📝 src/shared/stores/ui/model.ts (+13 -14)
📝 src/shared/stores/ui/persistence.ts (+5 -1)

📄 Description

Linked issue

Refs #1566

Why this change

This is another restore-first slice for the remaining full Knip follow-up queue. The branch restores practical helper/schema usage where the behavior already exists, and narrows exports only where the code is private to its owner.

What changed

  • Restored LabelWithHelp usage in the TTS config card and kept TTS API-key masking imported from the engine contract owner.
  • Routed TTS config reads/writes through ttsConfigSchema, with read-side per-field recovery for malformed persisted fields and strict rejection of malformed native response shapes.
  • Restored shared tracker constants into settings and tracker header callers for panel sizes, image dimensions, collapsed-section normalization, and temperature units.
  • Restored formatted agent retry failure toast copy and added tests for single/multiple failed retry summaries.
  • Narrowed slash command, TTS hook, integration utility, and UI store exports where the remaining surface is private implementation detail.

Refactor impact

Primary owner:

Shared API, shared UI/store helpers, shell settings, runtime generation, and tracker UI.

Impact areas reviewed:

  • TTS settings load/save and TTS config contract normalization.
  • Agent retry failure display and retry result side effects.
  • Tracker settings/sidebar controls and persisted UI-state normalization.
  • Slash command public completion/matching surface.
  • Shared API/helper export surfaces reported by Knip.

Boundary notes:

  • Engine contract remains React-free; TTS schema stays in src/engine/contracts/types/tts.ts.
  • Feature/UI code continues to call shared API/hooks instead of raw Tauri or remote-runtime fetch.
  • src/shared/api/tts-api.ts remains the Tauri command boundary for TTS config, voices, and speak calls.
  • No Rust, command registration, or remote runtime allowlist changes in this slice.

Pressure points touched:

  • None of the named broad pressure points (ModeSurface, GameSurface, shared mode UI, src-tauri/src/lib.rs, import modules) were edited.

Validation

  • pnpm check passes locally
  • 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
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

Automated/local validation run on this branch:

  • pnpm test -- src/shared/api/tts-api.test.ts
  • pnpm test -- src/shared/lib/agent-failures.test.ts
  • pnpm test -- src/shared/lib/agent-failures.test.ts src/features/runtime/generation/hooks/use-generate.test.ts src/shared/api/tts-api.test.ts
  • pnpm typecheck
  • pnpm lint:eslint
  • pnpm check:architecture
  • pnpm check:unused
  • pnpm build
  • git diff --check
  • Targeted Knip spot-checks for restored export names were quiet where run.

Manual/native QA not performed:

  • No native Tauri click-through pass for Settings -> tracker/TTS controls.
  • No browser screenshot/recording evidence added.

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

No docs or changelog files were changed. There is no CHANGELOG.md in this checkout, and this slice does not change documented run commands, architecture, or contributor workflow.

UI evidence

No screenshots or recordings added. The visible controls are existing settings/tracker/TTS surfaces with helper/contract wiring restored behind them.

Summary by CodeRabbit

  • Bug Fixes

    • Improved TTS configuration validation and normalization to prevent malformed settings.
    • Enhanced agent failure handling with better error classification and reporting.
  • Refactor

    • Reorganized shared UI constants and types for improved maintainability.
    • Streamlined internal API exports and module dependencies.
    • Simplified temperature unit and image dimension configuration logic.
  • Tests

    • Expanded TTS API test coverage for configuration updates and validation scenarios.
    • Added test coverage for agent failure formatting.

Review Change Stack


🔄 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/1587 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/29/2026 **Status:** ✅ Merged **Merged:** 5/29/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `restore/knip-command-help-slice` --- ### 📝 Commits (9) - [`0f5645b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0f5645ba49bf98d7aa4889713df59136a3cd44c8) Restore help label helper and narrow exports - [`8d2adb2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8d2adb22e33e3e57e5758eb64422d2beae58092e) Restore UI store constants in callers - [`7dd4ea8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7dd4ea8fbb2eb443260360222a97d0ab46ac194a) Restore TTS config schema boundary - [`38b76fc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/38b76fcd3d618b09ac306c0f13588aef9dc83a69) Restore agent retry failure toast formatting - [`82b339a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/82b339a174fc75c9f3ebec544bc634fad83ff221) Restore tracker temperature unit options - [`f38178e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f38178e9421fc99d5e1e119df07fc5af21156ecd) Harden TTS config read normalization - [`4432a1b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4432a1be236b7fc19c299f7ddc813a908b50190d) Reject malformed TTS config responses - [`c3df033`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c3df03399565b692a2edca5b9cb8218f2893d9e0) Merge remote-tracking branch 'origin/refactor' into restore/knip-command-help-slice - [`f16ba5b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f16ba5bd6ac3907703da8967cc7ea25be9b53908) Bump UI store migration version ### 📊 Changes **15 files changed** (+238 additions, -114 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/contracts/types/tts.ts` (+5 -7) 📝 `src/features/runtime/generation/hooks/use-generate.ts` (+17 -16) 📝 `src/features/runtime/tracker/components/TrackerSidebarHeader.tsx` (+7 -4) 📝 `src/features/shell/settings/components/SettingsPanel.tsx` (+62 -35) 📝 `src/features/shell/settings/components/settings/TTSConfigCard.tsx` (+6 -3) 📝 `src/shared/api/integration-utility-api.ts` (+0 -1) 📝 `src/shared/api/tts-api.test.ts` (+51 -2) 📝 `src/shared/api/tts-api.ts` (+28 -3) 📝 `src/shared/hooks/use-tts.ts` (+1 -6) ➕ `src/shared/lib/agent-failures.test.ts` (+30 -0) 📝 `src/shared/lib/slash-commands.ts` (+10 -10) 📝 `src/shared/lib/tts-service.ts` (+1 -1) 📝 `src/shared/stores/ui.store.ts` (+2 -11) 📝 `src/shared/stores/ui/model.ts` (+13 -14) 📝 `src/shared/stores/ui/persistence.ts` (+5 -1) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Refs #1566 ## Why this change This is another restore-first slice for the remaining full Knip follow-up queue. The branch restores practical helper/schema usage where the behavior already exists, and narrows exports only where the code is private to its owner. ## What changed - Restored `LabelWithHelp` usage in the TTS config card and kept TTS API-key masking imported from the engine contract owner. - Routed TTS config reads/writes through `ttsConfigSchema`, with read-side per-field recovery for malformed persisted fields and strict rejection of malformed native response shapes. - Restored shared tracker constants into settings and tracker header callers for panel sizes, image dimensions, collapsed-section normalization, and temperature units. - Restored formatted agent retry failure toast copy and added tests for single/multiple failed retry summaries. - Narrowed slash command, TTS hook, integration utility, and UI store exports where the remaining surface is private implementation detail. ## Refactor impact Primary owner: Shared API, shared UI/store helpers, shell settings, runtime generation, and tracker UI. Impact areas reviewed: - TTS settings load/save and TTS config contract normalization. - Agent retry failure display and retry result side effects. - Tracker settings/sidebar controls and persisted UI-state normalization. - Slash command public completion/matching surface. - Shared API/helper export surfaces reported by Knip. Boundary notes: - Engine contract remains React-free; TTS schema stays in `src/engine/contracts/types/tts.ts`. - Feature/UI code continues to call shared API/hooks instead of raw Tauri or remote-runtime fetch. - `src/shared/api/tts-api.ts` remains the Tauri command boundary for TTS config, voices, and speak calls. - No Rust, command registration, or remote runtime allowlist changes in this slice. Pressure points touched: - None of the named broad pressure points (`ModeSurface`, `GameSurface`, shared mode UI, `src-tauri/src/lib.rs`, import modules) were edited. ## Validation <!-- Check only what you personally ran or manually verified. Treat unchecked items as explicit TODOs. --> - [x] `pnpm check` passes locally - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `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 - [ ] Playwright, screenshot, or recording evidence added for UI changes - [ ] Remote runtime smoke checked when relevant ### Manual verification notes Automated/local validation run on this branch: - `pnpm test -- src/shared/api/tts-api.test.ts` - `pnpm test -- src/shared/lib/agent-failures.test.ts` - `pnpm test -- src/shared/lib/agent-failures.test.ts src/features/runtime/generation/hooks/use-generate.test.ts src/shared/api/tts-api.test.ts` - `pnpm typecheck` - `pnpm lint:eslint` - `pnpm check:architecture` - `pnpm check:unused` - `pnpm build` - `git diff --check` - Targeted Knip spot-checks for restored export names were quiet where run. Manual/native QA not performed: - No native Tauri click-through pass for Settings -> tracker/TTS controls. - No browser screenshot/recording evidence added. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims No docs or changelog files were changed. There is no `CHANGELOG.md` in this checkout, and this slice does not change documented run commands, architecture, or contributor workflow. ## UI evidence No screenshots or recordings added. The visible controls are existing settings/tracker/TTS surfaces with helper/contract wiring restored behind them. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved TTS configuration validation and normalization to prevent malformed settings. * Enhanced agent failure handling with better error classification and reporting. * **Refactor** * Reorganized shared UI constants and types for improved maintainability. * Streamlined internal API exports and module dependencies. * Simplified temperature unit and image dimension configuration logic. * **Tests** * Expanded TTS API test coverage for configuration updates and validation scenarios. * Added test coverage for agent failure formatting. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1587?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- 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:13:33 +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#5127
No description provided.