You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "Astro-Han (via GitHub)" <gi...@apache.org> on 2026/09/08 19:25:20 UTC
[PR] fix(ui): preserve transcript reading intent during layout changes [maka]
Astro-Han opened a new pull request, #5057:
URL: https://github.com/apache/maka/pull/5057
## Problem and behavior
Submitting a prompt while following the transcript can reverse the new row by 74–96px and silently cancel following. When the composer contracts 190px and the answer then grows 22px, the browser has already clamped the offset by 190px; the old classifier sees only the net 168px contraction and mistakes the difference for reader input. Lazy layout also substitutes estimated answer heights before the tail is positioned.
Input and explicit navigation now establish reading intent; layout geometry alone cannot change it. Only the currently streaming answer bypasses lazy layout so tail positioning sees its real height. Historical Turns, the outer active Turn, and completed blocks remain skippable.
## Implementation
- Replace the net-height/offset classifier and rounding allowance in the existing `TranscriptScrollAuthority` with input provenance. Keep one scroll authority and one tail writer.
- Handle wheel, keyboard scrolling, native scrollbar operations, and touch panning, respecting nested scroll consumption, editable controls, and prevented defaults. Explicit navigation clears preceding input provenance.
- Move the history loader's separate wheel interpretation into the authority. Input requests nearby history before movement; resulting scroll reports the reading position, preserving early loading.
- Retire input after `scrollend` and a rendering step without continuation. Chrome can emit a preceding scrollbar animation's end while a subsequent keyboard animation still moves. This acknowledgement schedules no scrolling and uses no timeout-based ignore interval. Native track clicks also require acknowledging defaults that begin after pointerup.
- Apply the existing live-streaming marker to the streaming answer boundary and make only that boundary eager.
## Validation
Base: `9cb5cc93c03f8d07550e739164d5e33168892563`.
- The no-input shrink/grow regression fails on the original authority. Its paired case supplies identical geometry with reader input and requires following to stop.
- Original short/eight-line submissions reverse by 74–96px. A separate 80-line case exposes a 74px reversal when only the outer active Turn is eager. Making the streaming answer eager fixes all three; an ablation confirms the outer exception can be removed.
- 421 UI tests and 27 Desktop send/reading-position tests pass, together with story typecheck, production Storybook build, and scoped Biome checks.
- Headless browser coverage includes short/eight/80-line submission, streaming growth, history insertion at and above the top, docking, nested scrolling, and cold scrolling through oversized historical/live Turns with actual skipped blocks.
- Native headless Chrome checks pass for wheel reversal during content changes, returning to the tail, PageUp/End including focused buttons, prevented delegated widget keys, native scrollbar track clicks immediately followed by End, and touch panning. Native scrollbars were explicitly enabled for the track-click check.
- Remove three obsolete geometry-classifier tests and arithmetic-bound assertions from the old rounding probe. Retain its native layout protection in the intent probe; existing tests now distinguish reader input from geometry-only events.
## Performance and scope
The change moves layout of the streaming answer into the first render instead of correcting an estimate later. It preserves lazy layout for historical/completed content. Exploratory measurements do not establish a consistent speedup, and no latency improvement is claimed.
Submission stories use the real Composer/ChatView/authority with a simulated session in production Storybook (Chrome 152, 1512×772), sample 40 animation frames, and assert both <=4px reversal and final tail distance. Storybook's highlight observer is disabled in the measurement harness because its computed-style scanning distorts timing. These are not pixel-presentation or end-to-end Host/IPC latency measurements.
The real Desktop symptom before the first answer arrives remains unverified end to end. This PR fixes the demonstrated layout reversal and false loss of following. Composer draft ownership and clear-on-admission semantics are unchanged. Draft for review; no automatic merge.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] fix(ui): preserve transcript intent and layout through submission [maka]
Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener commented on code in PR #5057:
URL: https://github.com/apache/maka/pull/5057#discussion_r3967351625
##########
patches/@astryxdesign+core+0.5.2.patch:
##########
@@ -1,3 +1,23 @@
+diff --git a/node_modules/@astryxdesign/core/dist/Chat/ChatComposerInput.js b/node_modules/@astryxdesign/core/dist/Chat/ChatComposerInput.js
+--- a/node_modules/@astryxdesign/core/dist/Chat/ChatComposerInput.js
++++ b/node_modules/@astryxdesign/core/dist/Chat/ChatComposerInput.js
+@@ -25,1 +25,1 @@
Review Comment:
**[P3] These four hunks are hand-authored rather than produced by `patch-package`, so the next regeneration will silently drop them.**
Every other hunk in this file carries an `index <sha>..<sha> 100644` line and six to seven lines of context. The four added here — both `ChatComposerInput` files — have no `index` line and zero to one line of context. That is the signature of a hand-edited patch inside a generated artifact.
**The behaviour is fine, and I want to be precise about that because my first reading was wrong.** I suspected the patch simply would not apply: `git apply --check` rejects it, and system `patch(1)` rejects three of the four hunks even with `-l` (ignore whitespace) and `-F 3` (fuzz). None of that turned out to be about this patch. The `git apply` failure is an artifact of `node_modules` being untracked, so it resolves content through the index and finds nothing. And rewriting the *same* edit with normal context applies cleanly, which isolates the cause as format rather than content — the line numbers and payloads are all correct against the installed `0.5.2` (`dist` lines 25 and 210, `src` lines 30 and 405).
What settles it is the applier this repository actually uses. Running `patch-package`'s own parser and applier directly against the tree in dry-run mode reports success with zero errors, so `npm ci` is unaffected:
```
patch-package dry run: applied, errors = 0
```
So this is not a correctness problem, and it is not P2. What remains are two maintenance costs:
1. **Regeneration loses the edit.** The next person to run `npx patch-package @astryxdesign/core` — to add an unrelated fix, or to rebase onto a new version — regenerates this file in the standard format from whatever is in `node_modules`. If the layout-effect change is not applied there at that moment, these four hunks vanish silently, and the composer regresses to the stale-frame behaviour this PR fixes.
2. **The file loses independent verification.** A checked-in vendor patch is one of the few places where a cheap second opinion is available; right now neither `patch(1)` nor `git apply` can validate it.
**Minimal fix:** apply the `useLayoutEffect` change to `node_modules` locally, run `npx patch-package @astryxdesign/core`, and replace these four hunks with the generated output. The diff is purely formatting — no behaviour changes.
The `patches/README.md` entry itself is good: it states the mechanism and the frame it removes, and records that the echo and selection guards are untouched.
> **Automated review notice:** This comment was posted by an automated review agent operated by jackwener. It is not an independent human review and does not replace one.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [PR] fix(ui): preserve transcript intent and layout through submission [maka]
Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han merged PR #5057:
URL: https://github.com/apache/maka/pull/5057
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org