[PR #1780] [MERGED] Remove explicit any types from UI cleanup paths #5280

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

📋 Pull Request Information

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

Base: refactor ← Head: chore/ui-explicit-any-types


📝 Commits (2)

  • e9d54d2 Remove explicit any types from UI cleanup paths
  • 8c1ff19 Address UI cleanup review findings

📊 Changes

16 files changed (+190 additions, -104 deletions)

View changed files

📝 src/engine/agents-runtime/pipeline/agent-pipeline.ts (+11 -1)
📝 src/engine/contracts/types/agent.ts (+2 -3)
📝 src/features/catalog/characters/components/CharacterEditor.tsx (+3 -2)
📝 src/features/catalog/characters/components/CharacterSpritesTab.tsx (+11 -14)
📝 src/features/catalog/personas/components/sprites/PersonaSpritesTab.tsx (+10 -13)
📝 src/features/catalog/presets/components/ChoiceSelectionModal.tsx (+42 -27)
📝 src/features/catalog/presets/components/PresetsPanel.tsx (+15 -5)
📝 src/features/catalog/presets/hooks/use-presets.ts (+25 -9)
➕ src/features/catalog/presets/lib/choice-selections.ts (+15 -0)
📝 src/features/modes/roleplay/hooks/use-scene.ts (+18 -2)
📝 src/features/shell/connections/components/ConnectionsPanel.tsx (+1 -1)
📝 src/features/shell/settings/components/SettingsPanel.tsx (+8 -2)
📝 src/shared/components/ui/SpriteFrameEditor.tsx (+5 -4)
📝 src/shared/components/ui/SpriteGenerationModal.tsx (+10 -17)
📝 src/shared/components/ui/sprite-wand-cleanup/useSpriteCleanupEditor.ts (+5 -4)
➕ src/shared/lib/error-message.ts (+9 -0)

📄 Description

Linked issue

N/A

Why this change

  • Reduce remaining explicit any usage before stricter linting by replacing local casts with typed guards and shared error-message helpers.

What changed

  • Added a shared helper for reading messages from unknown errors.
  • Typed sprite generation, cleanup, and frame-editing error paths.
  • Replaced preset choice casts with guarded parsing and typed preset query data.
  • Removed related explicit any callbacks/casts in character save, shell settings/connections, roleplay scene cache updates, and agent pipeline result handling.
  • Tightened the agent context abort signal type.

Refactor impact

Primary owner:

Catalog UI, shared UI helpers, shell UI, roleplay hook, and engine agent contracts.

Impact areas reviewed:

  • Preset choice parsing and chat metadata choice application
  • Character/persona sprite generation and cleanup error paths
  • Agent pipeline result text extraction and abort signal typing
  • Roleplay scene cached metadata updates
  • Shell settings import and duplicate connection callbacks

Boundary notes:

  • Engine changes stay React-free and do not import feature or shared API adapters.
  • Shared helper is feature-neutral under src/shared/lib.
  • Feature changes stay in React UI owners; no new raw Tauri/runtime calls.
  • Rust and remote runtime not touched.

Pressure points touched:

  • None.

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

  • pnpm check passed locally.
  • pnpm typecheck passed locally before the full gate.
  • pnpm check:architecture passed locally before the full gate.
  • git diff --check passed locally.
  • Targeted touched-area explicit-any grep returned no hits.
  • Browser/Tauri manual verification not run; no visible UI behavior change claimed.

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 type-safety cleanup only; no new discoverable user feature.

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 release-note changes needed; this is internal type-safety cleanup and does not change user-facing documentation or release claims.

UI evidence

N/A; no visible UI behavior change claimed.

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved error message consistency and clarity across character sprites, personas, and preset operations.
    • Enhanced data validation for preset choices and metadata to prevent processing errors.
  • Refactor

    • Standardized internal error handling with improved type safety throughout the application, reducing potential runtime issues.

🔄 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/1780 **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/ui-explicit-any-types` --- ### 📝 Commits (2) - [`e9d54d2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e9d54d2b4048400b06b897e7c3249a9fa0e3e7d2) Remove explicit any types from UI cleanup paths - [`8c1ff19`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8c1ff19e757eb654afade589b07ae585694c797d) Address UI cleanup review findings ### 📊 Changes **16 files changed** (+190 additions, -104 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/agents-runtime/pipeline/agent-pipeline.ts` (+11 -1) 📝 `src/engine/contracts/types/agent.ts` (+2 -3) 📝 `src/features/catalog/characters/components/CharacterEditor.tsx` (+3 -2) 📝 `src/features/catalog/characters/components/CharacterSpritesTab.tsx` (+11 -14) 📝 `src/features/catalog/personas/components/sprites/PersonaSpritesTab.tsx` (+10 -13) 📝 `src/features/catalog/presets/components/ChoiceSelectionModal.tsx` (+42 -27) 📝 `src/features/catalog/presets/components/PresetsPanel.tsx` (+15 -5) 📝 `src/features/catalog/presets/hooks/use-presets.ts` (+25 -9) ➕ `src/features/catalog/presets/lib/choice-selections.ts` (+15 -0) 📝 `src/features/modes/roleplay/hooks/use-scene.ts` (+18 -2) 📝 `src/features/shell/connections/components/ConnectionsPanel.tsx` (+1 -1) 📝 `src/features/shell/settings/components/SettingsPanel.tsx` (+8 -2) 📝 `src/shared/components/ui/SpriteFrameEditor.tsx` (+5 -4) 📝 `src/shared/components/ui/SpriteGenerationModal.tsx` (+10 -17) 📝 `src/shared/components/ui/sprite-wand-cleanup/useSpriteCleanupEditor.ts` (+5 -4) ➕ `src/shared/lib/error-message.ts` (+9 -0) </details> ### 📄 Description ## Linked issue N/A ## Why this change - Reduce remaining explicit `any` usage before stricter linting by replacing local casts with typed guards and shared error-message helpers. ## What changed - Added a shared helper for reading messages from unknown errors. - Typed sprite generation, cleanup, and frame-editing error paths. - Replaced preset choice casts with guarded parsing and typed preset query data. - Removed related explicit `any` callbacks/casts in character save, shell settings/connections, roleplay scene cache updates, and agent pipeline result handling. - Tightened the agent context abort signal type. ## Refactor impact Primary owner: Catalog UI, shared UI helpers, shell UI, roleplay hook, and engine agent contracts. Impact areas reviewed: - Preset choice parsing and chat metadata choice application - Character/persona sprite generation and cleanup error paths - Agent pipeline result text extraction and abort signal typing - Roleplay scene cached metadata updates - Shell settings import and duplicate connection callbacks Boundary notes: - Engine changes stay React-free and do not import feature or shared API adapters. - Shared helper is feature-neutral under `src/shared/lib`. - Feature changes stay in React UI owners; no new raw Tauri/runtime calls. - Rust and remote runtime not touched. Pressure points touched: - None. ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] `pnpm check` passes locally before PR push/handoff, including the unused-code check - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [x] `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 - `pnpm check` passed locally. - `pnpm typecheck` passed locally before the full gate. - `pnpm check:architecture` passed locally before the full gate. - `git diff --check` passed locally. - Targeted touched-area explicit-`any` grep returned no hits. - Browser/Tauri manual verification not run; no visible UI behavior change claimed. ## 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 type-safety cleanup only; no new discoverable user feature. ## 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 release-note changes needed; this is internal type-safety cleanup and does not change user-facing documentation or release claims. ## UI evidence N/A; no visible UI behavior change claimed. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Bug Fixes** * Improved error message consistency and clarity across character sprites, personas, and preset operations. * Enhanced data validation for preset choices and metadata to prevent processing errors. * **Refactor** * Standardized internal error handling with improved type safety throughout the application, reducing potential runtime issues. <!-- 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:52 +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#5280
No description provided.