[PR #2060] [MERGED] fix(otome-forge): a long line in the dialogue box shows every row on iPhone (0.6.24) #2097

Closed
opened 2026-11-07 16:39:28 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/2060
Author: @SpicyMarinara
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/otome-cut-off-lines


📝 Commits (3)

  • 0587885 fix(otome-forge): a long line in the dialogue box shows every row on iPhone (#2057)
  • d5c28dc chore(otome-forge): release 0.6.24
  • 4b55d4a Merge branch 'staging' into fix/otome-cut-off-lines

📊 Changes

13 files changed (+130 additions, -42 deletions)

View changed files

➕ artifacts/otome-forge-0.6.24.zip (+0 -0)
📝 catalog/preview/catalog.json (+6 -6)
📝 catalog/preview/notes.json (+6 -6)
📝 catalog/preview/v2/catalog.json (+6 -6)
📝 catalog/preview/v2/notes.json (+6 -6)
📝 catalog/preview/v3/catalog.json (+6 -6)
📝 catalog/preview/v3/notes.json (+6 -6)
📝 packages/otome-forge/CHANGELOG.md (+4 -0)
📝 packages/otome-forge/client.js (+1 -1)
📝 packages/otome-forge/manifest.json (+3 -3)
📝 packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/reader/DialogueBox.tsx (+11 -1)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/package-otome-forge-reader.e2e.ts (+74 -0)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #2057

Why this change

On an iPhone, a long narration line in a Closer scene came back cut off mid-word: "…where the rope sawed i". After that came blank space where the rest of the line belonged, with only its final "." visible. The Log showed the same line in full. So the saved text was intact; only the dialogue box's drawing was wrong.

What it isn't:

  • The reveal logic is correct. The typed part and the hidden rest slice the same Array.from(text), nothing rewrites the text, and the 0.6.20 paused logic only holds a line at 0 behind a CG's pan.
  • A stalled reveal would keep the final "." hidden too. A stall frozen at "sawed i" showed "sawed in" with no ".", so it can't produce the screenshot.

What it is: every 40 ms the box changed text in place inside .of-line, an overflow-y: auto scroll box. On iOS every scroller has its own composited layer, and WebKit treats two kinds of repaint differently:

  • Text changed in place is clipped. After line layout, WebKit repaints only the part of the box on screen (RenderBlockFlow::layoutBlock: repaintRect.moveBy(-scrollPosition()); repaintRect.intersect(borderBoxSize)). Rows that type while out of view are never redrawn and keep their blank pixels.
  • A removed element isn't clipped inside a composited scroller. When the line finishes, the removed .of-line-rest span repaints its own area, and by then it holds only ".".

That matches the screenshot exactly: the line laid out in full, its end blank, and only the "." drawn. The rows most likely went out of view because the player touched or scrolled the box while the end typed.

What changed

Package: otome-forge (Otome Hearth) 0.6.24. One client file changed, plus tests. Server, prompts and saves are untouched. sources/forge-kit and Gacha Forge are unchanged.

  • screens/reader/DialogueBox.tsx: the reveal span is keyed by ${lineKey}:${visible}, so each step of the typing replaces the span instead of changing its text. WebKit repaints a removed span's whole area, rows out of view included, so every row is drawn.
    • The new span is laid out in the same place, so the box's height and scroll position don't move.
    • The follow-scroll still works, because restRef attaches to each new span. Thought brackets, data-done and the screen-reader text are unchanged.
    • Every reader line goes through this box: beats, CG beats, Confrontations, Closers, routes and dates.
  • Clicks while a line types: the span takes no pointer events, so a held click lands on the line's <p>, which is never replaced, and still shows the line whole.
    • Review found this: with the span replaced every tick, a mouse click held for 80–150 ms never fired, because the element it was pressed on was gone by mouseup.
    • A finished line keeps normal pointer events, so its text stays selectable.

Release: 0.6.24 with a CHANGELOG entry. The rebuilt client.js, manifest, preview catalogs and artifacts/otome-forge-0.6.24.zip agree.

Package and security impact

  • Affected package IDs: otome-forge (0.6.23 → 0.6.24).
  • Engine compatibility impact: none.
  • New or changed permissions/entrypoints: none.
  • Restart, storage, update, or uninstall impact: none.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

What the agent ran locally:

  • Regression suites: all 621 Otome TypeScript regressions and 12 .mjs regressions pass.
  • Typecheck: 0 strict errors in 90 server and 140 client files.
  • Other checks: Prettier and git diff --check pass.
  • New browser proofs in tests/package-otome-forge-reader.e2e.ts, both using the maintainer's exact 498-character line on a fake clock, on desktop-chromium and mobile-chromium at 390 px:
    • "a long line types as new text at every step, never text changed in place". A MutationObserver records every change to the line. The test asserts that no text changed in place, that the span was replaced more than 5 times, that the finished line equals the text, and that .of-line-rest is gone. With the source change reverted it fails on both projects, each reporting 450 in-place changes.
    • "a click held on a typing line still shows it whole": a 200 ms mouse hold on the typing line, then release, shows it whole. Without the pointer-events part it fails on both projects.
  • Browser runs:
    • Before the rebase: the reader file 60/60, the loop, presentation and main package files 138/138.
    • On 0.6.24: results for the full reader suite are posted in a comment below.
  • Independent review:
    • Two review agents, one on the root cause and one on regressions, agreed on the root cause.
    • The regressions review found the held-click problem, fixed above with its proof.

Not proven on a device. No iOS simulator or device was available. Desktop WebKit and Chromium don't show the paint fault, and a browser test can check the page's structure but not what the screen draws.

For a human to verify:

  • On an iPhone, in Safari or the installed web app, play a narration beat with a line longer than the dialogue box. The maintainer's line works: "…where the rope sawed in, weeping at the edges. Heat climbs from your chest into your throat." Let it type on its own. Manually verify every row shows once the box has scrolled to its end.
  • On the iPhone, touch the box and scroll back up while that line types, so its end types out of view. When it finishes, scroll down. Manually verify the last rows are drawn, not blank with a lone ".".
  • On the iPhone, try the same line in a Closer scene and under a story CG. Manually verify the box waits behind the pan, then types from the top, with every row shown.
  • On the iPhone, manually verify typing still looks smooth, with no flicker, and that the follow-scroll keeps the newest row at the bottom edge while you don't touch the box.
  • On a desktop browser, click once on a line while it types. Manually verify it shows whole.

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

The package CHANGELOG describes the change.

🤖 Generated with Claude Code


🔄 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-Agents/pull/2060 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/otome-cut-off-lines` --- ### 📝 Commits (3) - [`0587885`](https://github.com/Pasta-Devs/Marinara-Agents/commit/0587885db08ad5632b76b3fbbc709a7067ffed16) fix(otome-forge): a long line in the dialogue box shows every row on iPhone (#2057) - [`d5c28dc`](https://github.com/Pasta-Devs/Marinara-Agents/commit/d5c28dc22c7c5871ba35b4783d4a42274938fa98) chore(otome-forge): release 0.6.24 - [`4b55d4a`](https://github.com/Pasta-Devs/Marinara-Agents/commit/4b55d4af9d42944b42b87298e83f329ef8cd3555) Merge branch 'staging' into fix/otome-cut-off-lines ### 📊 Changes **13 files changed** (+130 additions, -42 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/otome-forge-0.6.24.zip` (+0 -0) 📝 `catalog/preview/catalog.json` (+6 -6) 📝 `catalog/preview/notes.json` (+6 -6) 📝 `catalog/preview/v2/catalog.json` (+6 -6) 📝 `catalog/preview/v2/notes.json` (+6 -6) 📝 `catalog/preview/v3/catalog.json` (+6 -6) 📝 `catalog/preview/v3/notes.json` (+6 -6) 📝 `packages/otome-forge/CHANGELOG.md` (+4 -0) 📝 `packages/otome-forge/client.js` (+1 -1) 📝 `packages/otome-forge/manifest.json` (+3 -3) 📝 `packages/otome-forge/src/engine/packages/client/src/features/otome-forge/screens/reader/DialogueBox.tsx` (+11 -1) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/package-otome-forge-reader.e2e.ts` (+74 -0) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #2057 ## Why this change On an iPhone, a long narration line in a Closer scene came back cut off mid-word: "…where the rope sawed i". After that came blank space where the rest of the line belonged, with only its final "." visible. The Log showed the same line in full. So the saved text was intact; only the dialogue box's drawing was wrong. **What it isn't:** - The reveal logic is correct. The typed part and the hidden rest slice the same `Array.from(text)`, nothing rewrites the text, and the 0.6.20 `paused` logic only holds a line at 0 behind a CG's pan. - A stalled reveal would keep the final "." hidden too. A stall frozen at "sawed i" showed "sawed in" with no ".", so it can't produce the screenshot. **What it is:** every 40 ms the box changed text in place inside `.of-line`, an `overflow-y: auto` scroll box. On iOS every scroller has its own composited layer, and WebKit treats two kinds of repaint differently: - **Text changed in place is clipped.** After line layout, WebKit repaints only the part of the box on screen (`RenderBlockFlow::layoutBlock`: `repaintRect.moveBy(-scrollPosition()); repaintRect.intersect(borderBoxSize)`). Rows that type while out of view are never redrawn and keep their blank pixels. - **A removed element isn't clipped** inside a composited scroller. When the line finishes, the removed `.of-line-rest` span repaints its own area, and by then it holds only ".". That matches the screenshot exactly: the line laid out in full, its end blank, and only the "." drawn. The rows most likely went out of view because the player touched or scrolled the box while the end typed. ## What changed Package: `otome-forge` (Otome Hearth) **0.6.24**. One client file changed, plus tests. Server, prompts and saves are untouched. `sources/forge-kit` and Gacha Forge are unchanged. - **`screens/reader/DialogueBox.tsx`:** the reveal span is keyed by `${lineKey}:${visible}`, so each step of the typing replaces the span instead of changing its text. WebKit repaints a removed span's whole area, rows out of view included, so every row is drawn. - The new span is laid out in the same place, so the box's height and scroll position don't move. - The follow-scroll still works, because `restRef` attaches to each new span. Thought brackets, `data-done` and the screen-reader text are unchanged. - Every reader line goes through this box: beats, CG beats, Confrontations, Closers, routes and dates. - **Clicks while a line types:** the span takes no pointer events, so a held click lands on the line's `<p>`, which is never replaced, and still shows the line whole. - Review found this: with the span replaced every tick, a mouse click held for 80–150 ms never fired, because the element it was pressed on was gone by mouseup. - A finished line keeps normal pointer events, so its text stays selectable. **Release:** 0.6.24 with a CHANGELOG entry. The rebuilt `client.js`, manifest, preview catalogs and `artifacts/otome-forge-0.6.24.zip` agree. ## Package and security impact - Affected package IDs: `otome-forge` (0.6.23 → 0.6.24). - Engine compatibility impact: none. - New or changed permissions/entrypoints: none. - Restart, storage, update, or uninstall impact: none. ## Validation - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes What the agent ran locally: - **Regression suites:** all 621 Otome TypeScript regressions and 12 `.mjs` regressions pass. - **Typecheck:** 0 strict errors in 90 server and 140 client files. - **Other checks:** Prettier and `git diff --check` pass. - **New browser proofs** in `tests/package-otome-forge-reader.e2e.ts`, both using the maintainer's exact 498-character line on a fake clock, on desktop-chromium and mobile-chromium at 390 px: - "a long line types as new text at every step, never text changed in place". A MutationObserver records every change to the line. The test asserts that no text changed in place, that the span was replaced more than 5 times, that the finished line equals the text, and that `.of-line-rest` is gone. With the source change reverted it fails on both projects, each reporting 450 in-place changes. - "a click held on a typing line still shows it whole": a 200 ms mouse hold on the typing line, then release, shows it whole. Without the `pointer-events` part it fails on both projects. - **Browser runs:** - Before the rebase: the reader file 60/60, the loop, presentation and main package files 138/138. - On 0.6.24: results for the full reader suite are posted in a comment below. - **Independent review:** - Two review agents, one on the root cause and one on regressions, agreed on the root cause. - The regressions review found the held-click problem, fixed above with its proof. **Not proven on a device.** No iOS simulator or device was available. Desktop WebKit and Chromium don't show the paint fault, and a browser test can check the page's structure but not what the screen draws. For a human to verify: - On an iPhone, in Safari or the installed web app, play a narration beat with a line longer than the dialogue box. The maintainer's line works: "…where the rope sawed in, weeping at the edges. Heat climbs from your chest into your throat." Let it type on its own. Manually verify every row shows once the box has scrolled to its end. - On the iPhone, touch the box and scroll back up while that line types, so its end types out of view. When it finishes, scroll down. Manually verify the last rows are drawn, not blank with a lone ".". - On the iPhone, try the same line in a Closer scene and under a story CG. Manually verify the box waits behind the pan, then types from the top, with every row shown. - On the iPhone, manually verify typing still looks smooth, with no flicker, and that the follow-scroll keeps the newest row at the bottom edge while you don't touch the box. - On a desktop browser, click once on a line while it types. Manually verify it shows whole. ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation The package CHANGELOG describes the change. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:39:28 +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-Agents#2097
No description provided.