[PR #2012] [MERGED] Limit mounted chat transcript rows #5388

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2012
Author: @Promansis
Created: 6/3/2026
Status: ✅ Merged
Merged: 6/3/2026
Merged by: @Promansis

Base: refactor ← Head: fix/issue-2007-chat-dom-growth


📝 Commits (3)

  • 00bfb6f Limit mounted chat transcript rows
  • 34c825e Fix transcript window tail reset
  • 9c737cb Merge upstream refactor into transcript window branch

📊 Changes

4 files changed (+199 additions, -26 deletions)

View changed files

📝 src/features/modes/conversation/components/ConversationView.tsx (+80 -11)
📝 src/features/modes/roleplay/components/ChatRoleplaySurface.tsx (+67 -15)
📝 src/features/modes/shared/chat-ui/index.ts (+1 -0)
➕ src/features/modes/shared/chat-ui/lib/transcript-render-window.ts (+51 -0)

📄 Description

Linked issue

Closes #2007

Why this change

  • Long conversation and roleplay transcripts could keep too many loaded message rows mounted at once, increasing DOM size and making long chats heavier to render and interact with.

What changed

  • Added a shared transcript render-window helper that caps mounted transcript message rows to 160 while preserving loaded transcript data for mode logic.
  • Updated Conversation mode to render a bounded message window with Older Messages / Newer Messages paging through already-loaded transcript chunks.
  • Updated Roleplay mode with the same bounded row mounting while keeping roleplay-specific UI, sprites, trackers, CYOA, and actions in the roleplay owner.

Refactor impact

Primary owner:

shared mode UI helper, conversation mode UI, roleplay mode UI

Impact areas reviewed:

  • Conversation transcript rendering, message numbering, split assistant blocks, message selection order indexes, and load-more controls.
  • Roleplay transcript rendering, message numbering, grouping, message depth, CYOA placement, streaming rows, and load-more controls.
  • Shared chat-ui public exports and dependency-boundary rules.

Boundary notes:

  • No engine, shared API, storage, generation, prompt assembly, Rust capability, or remote-runtime behavior changed.
  • Shared code is limited to mode-neutral transcript window math exported through src/features/modes/shared/chat-ui.
  • Conversation and roleplay keep separate surface owners; game mode is untouched.

Pressure points touched:

  • Shared mode UI public entrypoint and shared chat-ui helper.
  • Conversation and roleplay surface render loops.

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

  • Focused helper proof: 250 synthetic messages mount 160 latest rows (m90..m249) and Older Messages window moves to m10..m169 with newer rows tracked as hidden after the current window.
  • pnpm check passed locally after fixing the unused export reported by knip.
  • Browser/manual transcript scrolling proof was not run.

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/DOM-growth bugfix for existing conversation and roleplay transcript surfaces.

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

  • Not captured. The fix is structural DOM bounding for existing transcript surfaces.

🔄 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/2012 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/3/2026 **Status:** ✅ Merged **Merged:** 6/3/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/issue-2007-chat-dom-growth` --- ### 📝 Commits (3) - [`00bfb6f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/00bfb6f3f99ad79720e5661a94e697ff70e5ae61) Limit mounted chat transcript rows - [`34c825e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/34c825e0ca5544f532ac5728eb3a00281ef70fed) Fix transcript window tail reset - [`9c737cb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9c737cb1c9878cf698eb2659c0c88da3b6b49b7a) Merge upstream refactor into transcript window branch ### 📊 Changes **4 files changed** (+199 additions, -26 deletions) <details> <summary>View changed files</summary> 📝 `src/features/modes/conversation/components/ConversationView.tsx` (+80 -11) 📝 `src/features/modes/roleplay/components/ChatRoleplaySurface.tsx` (+67 -15) 📝 `src/features/modes/shared/chat-ui/index.ts` (+1 -0) ➕ `src/features/modes/shared/chat-ui/lib/transcript-render-window.ts` (+51 -0) </details> ### 📄 Description ## Linked issue Closes #2007 ## Why this change - Long conversation and roleplay transcripts could keep too many loaded message rows mounted at once, increasing DOM size and making long chats heavier to render and interact with. ## What changed - Added a shared transcript render-window helper that caps mounted transcript message rows to 160 while preserving loaded transcript data for mode logic. - Updated Conversation mode to render a bounded message window with Older Messages / Newer Messages paging through already-loaded transcript chunks. - Updated Roleplay mode with the same bounded row mounting while keeping roleplay-specific UI, sprites, trackers, CYOA, and actions in the roleplay owner. ## Refactor impact Primary owner: shared mode UI helper, conversation mode UI, roleplay mode UI Impact areas reviewed: - Conversation transcript rendering, message numbering, split assistant blocks, message selection order indexes, and load-more controls. - Roleplay transcript rendering, message numbering, grouping, message depth, CYOA placement, streaming rows, and load-more controls. - Shared chat-ui public exports and dependency-boundary rules. Boundary notes: - No engine, shared API, storage, generation, prompt assembly, Rust capability, or remote-runtime behavior changed. - Shared code is limited to mode-neutral transcript window math exported through `src/features/modes/shared/chat-ui`. - Conversation and roleplay keep separate surface owners; game mode is untouched. Pressure points touched: - Shared mode UI public entrypoint and shared chat-ui helper. - Conversation and roleplay surface render loops. ## 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] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Focused helper proof: 250 synthetic messages mount 160 latest rows (`m90..m249`) and Older Messages window moves to `m10..m169` with newer rows tracked as hidden after the current window. - `pnpm check` passed locally after fixing the unused export reported by `knip`. - Browser/manual transcript scrolling proof was not run. ## 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/DOM-growth bugfix for existing conversation and roleplay transcript surfaces. ## 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 ## UI evidence - Not captured. The fix is structural DOM bounding for existing transcript surfaces. --- <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:51 +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#5388
No description provided.