[PR #1455] [MERGED] Split heavy chat UI imports #5097

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

📋 Pull Request Information

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

Base: refactor ← Head: chore/vite-code-splitting-warnings


📝 Commits (1)

  • ff302cf Split heavy chat UI imports

📊 Changes

5 files changed (+21 additions, -9 deletions)

View changed files

📝 src/features/modes/game/components/GameSurface.tsx (+10 -6)
➕ src/features/modes/shared/chat-ui/ChatGalleryDrawer.lazy.tsx (+8 -0)
📝 src/features/modes/shared/chat-ui/components/ChatGalleryDrawer.tsx (+1 -1)
📝 src/features/modes/shared/chat-ui/index.ts (+1 -1)
📝 src/shared/lib/draft-translation.ts (+1 -1)

📄 Description

Linked issue

N/A - local chore-list cleanup for Vite static/dynamic import warnings.

Why this change

  • Vite reported static/dynamic import conflicts for translate-text and ChatGalleryDrawer, preventing those modules from being split cleanly and keeping heavier UI/runtime code in earlier bundles.

What changed

  • Load translate-text dynamically from translateDraftText so draft translation no longer statically imports the translation command helper.
  • Add a lazy public ChatGalleryDrawer entrypoint and route the shared chat-ui barrel through it.
  • Preserve the public ChatGalleryDrawerProps type export as type-only API.
  • Wrap the game gallery drawer usage in Suspense and only mount it while the drawer is open.

Refactor impact

Primary owner:

Shared mode chat UI and game mode UI.

Impact areas reviewed:

  • Shared chat-ui barrel consumers
  • Game gallery drawer rendering path
  • Conversation, roleplay, and game draft translation callers
  • Vite import graph / bundle output

Boundary notes:

  • No engine, shared API, Rust, storage, provider, or remote-runtime behavior changed.
  • Changes stay in React feature/shared frontend helper code.

Pressure points touched:

  • GameSurface touched narrowly to wrap the gallery drawer lazy component.
  • Shared mode UI barrel touched to preserve lazy public import behavior.

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

  • git diff --check origin/refactor...HEAD passed.
  • pnpm check:architecture passed.
  • pnpm typecheck passed.
  • pnpm build passed.
  • Build output now emits split translate-text-...js and ChatGalleryDrawer-...js chunks.
  • The specific static/dynamic import conflict warnings are gone.
  • The pre-existing generic large main chunk warning remains.
  • Native Tauri/manual UI verification was not run.
  • graphify update . was not run because local Graphify output refresh is paused until tracked-output churn is fixed; graphify-out is clean.

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 note: no docs changes were made because this is an internal bundling/import-graph cleanup with no user-facing behavior change.

UI evidence

No screenshots or recordings. This PR does not intentionally change visible UI behavior.

Summary by CodeRabbit

  • Performance
    • Improved loading speed for chat gallery features.
    • Enhanced translation text processing efficiency.

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/1455 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/28/2026 **Status:** ✅ Merged **Merged:** 5/28/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `chore/vite-code-splitting-warnings` --- ### 📝 Commits (1) - [`ff302cf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ff302cf821d18bde22489c327866edfc10c476e8) Split heavy chat UI imports ### 📊 Changes **5 files changed** (+21 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `src/features/modes/game/components/GameSurface.tsx` (+10 -6) ➕ `src/features/modes/shared/chat-ui/ChatGalleryDrawer.lazy.tsx` (+8 -0) 📝 `src/features/modes/shared/chat-ui/components/ChatGalleryDrawer.tsx` (+1 -1) 📝 `src/features/modes/shared/chat-ui/index.ts` (+1 -1) 📝 `src/shared/lib/draft-translation.ts` (+1 -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 N/A - local chore-list cleanup for Vite static/dynamic import warnings. ## Why this change - Vite reported static/dynamic import conflicts for `translate-text` and `ChatGalleryDrawer`, preventing those modules from being split cleanly and keeping heavier UI/runtime code in earlier bundles. ## What changed - Load `translate-text` dynamically from `translateDraftText` so draft translation no longer statically imports the translation command helper. - Add a lazy public `ChatGalleryDrawer` entrypoint and route the shared chat-ui barrel through it. - Preserve the public `ChatGalleryDrawerProps` type export as type-only API. - Wrap the game gallery drawer usage in `Suspense` and only mount it while the drawer is open. ## Refactor impact Primary owner: Shared mode chat UI and game mode UI. Impact areas reviewed: - Shared chat-ui barrel consumers - Game gallery drawer rendering path - Conversation, roleplay, and game draft translation callers - Vite import graph / bundle output Boundary notes: - No engine, shared API, Rust, storage, provider, or remote-runtime behavior changed. - Changes stay in React feature/shared frontend helper code. Pressure points touched: - `GameSurface` touched narrowly to wrap the gallery drawer lazy component. - Shared mode UI barrel touched to preserve lazy public import behavior. ## 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 - `git diff --check origin/refactor...HEAD` passed. - `pnpm check:architecture` passed. - `pnpm typecheck` passed. - `pnpm build` passed. - Build output now emits split `translate-text-...js` and `ChatGalleryDrawer-...js` chunks. - The specific static/dynamic import conflict warnings are gone. - The pre-existing generic large main chunk warning remains. - Native Tauri/manual UI verification was not run. - `graphify update .` was not run because local Graphify output refresh is paused until tracked-output churn is fixed; `graphify-out` is clean. ## 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 Docs/release note: no docs changes were made because this is an internal bundling/import-graph cleanup with no user-facing behavior change. ## UI evidence No screenshots or recordings. This PR does not intentionally change visible UI behavior. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Performance** * Improved loading speed for chat gallery features. * Enhanced translation text processing efficiency. <!-- 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/1455?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:13 +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#5097
No description provided.