[PR #1894] [MERGED] Improve refactor build performance #5336

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1894
Author: @TheLonelyDevil9
Created: 6/2/2026
Status: ✅ Merged
Merged: 6/2/2026
Merged by: @TheLonelyDevil9

Base: refactor ← Head: refactor-build-performance-sweep


📝 Commits (2)

  • 5625c5e Improve refactor build performance
  • e3bc279 Address lazy overlay and bar edge cases

📊 Changes

19 files changed (+323 additions, -218 deletions)

View changed files

📝 CONTRIBUTING.md (+1 -0)
📝 README.md (+1 -0)
📝 custom_components/marinara_engine/manifest.json (+1 -1)
📝 src/features/modes/game-assets/components/AssetGrid.tsx (+2 -10)
📝 src/features/modes/game-assets/components/FolderTree.tsx (+1 -1)
📝 src/features/modes/game-assets/components/GameAssetsBrowserView.test.tsx (+0 -10)
📝 src/features/modes/game-assets/components/GameAssetsBrowserView.tsx (+1 -1)
➕ src/features/modes/game/assets.ts (+1 -0)
📝 src/features/modes/game/components/GameCharacterSheet.tsx (+20 -9)
📝 src/features/modes/game/components/GameCombatUI.tsx (+23 -9)
📝 src/features/modes/game/components/GameSurface.tsx (+218 -143)
📝 src/features/modes/game/index.ts (+1 -1)
📝 src/features/modes/game/lib/game-audio.ts (+12 -2)
📝 src/features/modes/shared/chat-ui/components/SummaryPopover.tsx (+28 -22)
📝 src/features/runtime/tracker/components/TrackerProfileStats.css (+3 -1)
📝 src/features/runtime/tracker/components/quest-tracker/QuestRow.css (+3 -1)
📝 src/features/runtime/tracker/components/quest-tracker/QuestRow.tsx (+2 -4)
📝 src/features/runtime/tracker/components/tracker-data-sidebar.stats.tsx (+1 -1)
📝 src/styles/globals.css (+4 -2)

📄 Description

Linked issue

None.

Why this change

Refactor builds were carrying avoidable game-mode bundle weight and layout work in hot UI paths. This change trims initial game-surface payload, avoids layout-bound progress bar animation, and makes branch-specific docs point contributors at the active refactor line.

What changed

  • Lazy-loads heavy game overlays from GameSurface, including session history, journal, checkpoints, inventory, readable documents, and the first-game tutorial.
  • Adds a game asset helper entrypoint so the game-assets browser can import pure selection helpers without pulling through the game-mode barrel.
  • Changes game/combat/tracker progress fills from animated width updates to transform: scaleX(...) updates.
  • Memoizes summary metadata derivations used by the shared summary popover.
  • Handles non-promise audio.play() returns in the game audio unlock path.
  • Marks refactor docs as authoritative for current work and updates the Home Assistant integration docs link to the refactor branch.

Refactor impact

Primary owner:

game mode, game assets, shared mode UI, runtime tracker, repo docs

Impact areas reviewed:

  • Game mode bundle/chunk output
  • Game assets browser imports and tests
  • Game character/combat stat bar rendering
  • Runtime tracker stat/progress bar rendering
  • Shared summary popover derived metadata
  • Docs branch guidance and Home Assistant documentation link

Boundary notes:

  • No engine, shared API, Rust command, storage, provider transport, or remote-runtime boundary changes.
  • Game-assets now imports asset-selection helpers through a small game-owned entrypoint instead of the full game barrel.

Pressure points touched:

  • GameSurface
  • game asset import modules
  • shared mode UI summary popover
  • runtime tracker bars
  • global game stat-bar CSS

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • corepack pnpm typecheck
  • corepack pnpm build
  • corepack pnpm test (62 test files, 240 tests)
  • corepack pnpm lint:eslint
  • corepack pnpm check:docs
  • corepack pnpm check:architecture
  • corepack pnpm check:unused
  • corepack pnpm check:discovery
  • corepack pnpm check:line-endings
  • corepack pnpm perf:size
  • corepack pnpm exec prettier --check --ignore-unknown on touched files
  • git diff --check
  • Browser smoke: Vite app booted at 127.0.0.1:5173, title rendered as Marinara Engine, no browser console errors after boot and shallow Game starter click.
  • Bundle comparison against origin/refactor: GameSurface dropped from 652.16 kB raw / 179.47 kB gzip to 588.92 kB raw / 165.59 kB gzip, removing the Vite >650 kB chunk warning for that chunk.
  • npx --yes pnpm@10.33.2 check completed line endings, architecture, and frontend, then stopped at check:rust because cargo is not available on PATH in this environment.
  • Follow-up validation after reviewer-observation fixes: corepack pnpm typecheck.
  • Follow-up validation after reviewer-observation fixes: corepack pnpm test -- src/features/modes/game-assets/components/GameAssetsBrowserView.test.tsx (Vitest ran 62 test files, 240 tests).
  • Follow-up validation after reviewer-observation fixes: corepack pnpm exec prettier --check --ignore-unknown on touched files.
  • Follow-up validation after reviewer-observation fixes: corepack pnpm build.
  • Follow-up browser smoke: Vite app booted at localhost:1420, title rendered as Marinara Engine, and no browser console warnings or errors were reported.

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:

  • This is a performance/refactor/docs guidance change and does not add a discoverable 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

UI evidence

No screenshot included. The UI-facing changes are progress bar animation internals and lazy-loaded overlays; browser smoke verified app boot and starter Game path without console errors.

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Improved media playback handling for better browser compatibility.
  • Performance

    • Optimized progress bar animations for smoother, GPU-accelerated transitions.
    • Implemented lazy loading for game UI panels to reduce initial load time.
    • Enhanced component memoization to minimize unnecessary re-renders.
  • Documentation

    • Updated documentation links to reference the current refactor branch.

🔄 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/1894 **Author:** [@TheLonelyDevil9](https://github.com/TheLonelyDevil9) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@TheLonelyDevil9](https://github.com/TheLonelyDevil9) **Base:** `refactor` ← **Head:** `refactor-build-performance-sweep` --- ### 📝 Commits (2) - [`5625c5e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5625c5ea782b8ae109e6c5568adc6c10440ceb3a) Improve refactor build performance - [`e3bc279`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e3bc279432abbb68ccb5643e8073a0e3d081ed7d) Address lazy overlay and bar edge cases ### 📊 Changes **19 files changed** (+323 additions, -218 deletions) <details> <summary>View changed files</summary> 📝 `CONTRIBUTING.md` (+1 -0) 📝 `README.md` (+1 -0) 📝 `custom_components/marinara_engine/manifest.json` (+1 -1) 📝 `src/features/modes/game-assets/components/AssetGrid.tsx` (+2 -10) 📝 `src/features/modes/game-assets/components/FolderTree.tsx` (+1 -1) 📝 `src/features/modes/game-assets/components/GameAssetsBrowserView.test.tsx` (+0 -10) 📝 `src/features/modes/game-assets/components/GameAssetsBrowserView.tsx` (+1 -1) ➕ `src/features/modes/game/assets.ts` (+1 -0) 📝 `src/features/modes/game/components/GameCharacterSheet.tsx` (+20 -9) 📝 `src/features/modes/game/components/GameCombatUI.tsx` (+23 -9) 📝 `src/features/modes/game/components/GameSurface.tsx` (+218 -143) 📝 `src/features/modes/game/index.ts` (+1 -1) 📝 `src/features/modes/game/lib/game-audio.ts` (+12 -2) 📝 `src/features/modes/shared/chat-ui/components/SummaryPopover.tsx` (+28 -22) 📝 `src/features/runtime/tracker/components/TrackerProfileStats.css` (+3 -1) 📝 `src/features/runtime/tracker/components/quest-tracker/QuestRow.css` (+3 -1) 📝 `src/features/runtime/tracker/components/quest-tracker/QuestRow.tsx` (+2 -4) 📝 `src/features/runtime/tracker/components/tracker-data-sidebar.stats.tsx` (+1 -1) 📝 `src/styles/globals.css` (+4 -2) </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 None. ## Why this change Refactor builds were carrying avoidable game-mode bundle weight and layout work in hot UI paths. This change trims initial game-surface payload, avoids layout-bound progress bar animation, and makes branch-specific docs point contributors at the active refactor line. ## What changed - Lazy-loads heavy game overlays from `GameSurface`, including session history, journal, checkpoints, inventory, readable documents, and the first-game tutorial. - Adds a game asset helper entrypoint so the game-assets browser can import pure selection helpers without pulling through the game-mode barrel. - Changes game/combat/tracker progress fills from animated `width` updates to `transform: scaleX(...)` updates. - Memoizes summary metadata derivations used by the shared summary popover. - Handles non-promise `audio.play()` returns in the game audio unlock path. - Marks `refactor` docs as authoritative for current work and updates the Home Assistant integration docs link to the `refactor` branch. ## Refactor impact Primary owner: game mode, game assets, shared mode UI, runtime tracker, repo docs Impact areas reviewed: - Game mode bundle/chunk output - Game assets browser imports and tests - Game character/combat stat bar rendering - Runtime tracker stat/progress bar rendering - Shared summary popover derived metadata - Docs branch guidance and Home Assistant documentation link Boundary notes: - No engine, shared API, Rust command, storage, provider transport, or remote-runtime boundary changes. - Game-assets now imports asset-selection helpers through a small game-owned entrypoint instead of the full game barrel. Pressure points touched: - `GameSurface` - game asset import modules - shared mode UI summary popover - runtime tracker bars - global game stat-bar CSS ## Validation - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `corepack pnpm typecheck` - `corepack pnpm build` - `corepack pnpm test` (`62` test files, `240` tests) - `corepack pnpm lint:eslint` - `corepack pnpm check:docs` - `corepack pnpm check:architecture` - `corepack pnpm check:unused` - `corepack pnpm check:discovery` - `corepack pnpm check:line-endings` - `corepack pnpm perf:size` - `corepack pnpm exec prettier --check --ignore-unknown` on touched files - `git diff --check` - Browser smoke: Vite app booted at `127.0.0.1:5173`, title rendered as `Marinara Engine`, no browser console errors after boot and shallow Game starter click. - Bundle comparison against `origin/refactor`: `GameSurface` dropped from `652.16 kB` raw / `179.47 kB` gzip to `588.92 kB` raw / `165.59 kB` gzip, removing the Vite >650 kB chunk warning for that chunk. - `npx --yes pnpm@10.33.2 check` completed line endings, architecture, and frontend, then stopped at `check:rust` because `cargo` is not available on PATH in this environment. - Follow-up validation after reviewer-observation fixes: `corepack pnpm typecheck`. - Follow-up validation after reviewer-observation fixes: `corepack pnpm test -- src/features/modes/game-assets/components/GameAssetsBrowserView.test.tsx` (Vitest ran `62` test files, `240` tests). - Follow-up validation after reviewer-observation fixes: `corepack pnpm exec prettier --check --ignore-unknown` on touched files. - Follow-up validation after reviewer-observation fixes: `corepack pnpm build`. - Follow-up browser smoke: Vite app booted at `localhost:1420`, title rendered as `Marinara Engine`, and no browser console warnings or errors were reported. ## 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: - This is a performance/refactor/docs guidance change and does not add a discoverable 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 ## UI evidence No screenshot included. The UI-facing changes are progress bar animation internals and lazy-loaded overlays; browser smoke verified app boot and starter Game path without console errors. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Bug Fixes** * Improved media playback handling for better browser compatibility. * **Performance** * Optimized progress bar animations for smoother, GPU-accelerated transitions. * Implemented lazy loading for game UI panels to reduce initial load time. * Enhanced component memoization to minimize unnecessary re-renders. * **Documentation** * Updated documentation links to reference the current refactor branch. <!-- 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:15:22 +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#5336
No description provided.