Repository navigation
Conversation
Jim's stage floats over the editor, and the editor did not know it was there: at 1366 px the end of a long line, and the caret typing past column 95, scrolled to the textarea's edge under the stage, and the last rows could not be scrolled out from under the compact card. The stage's placement now also measures how much of the editor it covers. Beside the floating stage a transparent border keeps that width out of the text layers' scroll range, since a textarea leaves its right padding out of it and a narrower box would not take a click beside the code. Under the compact card they pad their bottom instead, with scroll-padding keeping the caret above it, because the card grows with the captions and a shorter text area would resize while Jim speaks. An editor that runs past the window reserves nothing, as the page itself scrolls any row out from under the fixed card. Close sysprog21#512 Change-Id: I2f74b83f4191e33b46b50f51ec0f27dea4b24407
There was a problem hiding this comment.
2 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="web/interview.js">
<violation number="1" location="web/interview.js:5863">
P2: The reservation uses a stale stage rectangle after `.scrollable` can reposition the stage. Re-read `getBoundingClientRect()` after toggling `.scrollable`, otherwise an oversized compact card can reserve the fixed-bottom position while it is actually rendered at the toolbar anchor.</violation>
<violation number="2" location="web/interview.js:5883">
P2: The reservation is computed from viewport positions, but it only refreshes on resize, not on scroll. When the editor panel or page scrolls, `covers` can flip while `--jim-stage-reserve-right` and `--jim-stage-reserve-bottom` keep their old values, so the caret can sit under the stage. Re-run the reservation on scroll of the editor panel, or compute it without depending on the viewport position.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
| const stack = nodes.editorStack; | ||
| if (!stack.isConnected) return; | ||
| const editor = stack.getBoundingClientRect(); | ||
| const covers = |
There was a problem hiding this comment.
P2: The reservation is computed from viewport positions, but it only refreshes on resize, not on scroll. When the editor panel or page scrolls, covers can flip while --jim-stage-reserve-right and --jim-stage-reserve-bottom keep their old values, so the caret can sit under the stage. Re-run the reservation on scroll of the editor panel, or compute it without depending on the viewport position.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At web/interview.js, line 5883:
<comment>The reservation is computed from viewport positions, but it only refreshes on resize, not on scroll. When the editor panel or page scrolls, `covers` can flip while `--jim-stage-reserve-right` and `--jim-stage-reserve-bottom` keep their old values, so the caret can sit under the stage. Re-run the reservation on scroll of the editor panel, or compute it without depending on the viewport position.</comment>
<file context>
@@ -5857,14 +5860,44 @@ function placeJimStageBelowToolbar(toolbar) {
+ const stack = nodes.editorStack;
+ if (!stack.isConnected) return;
+ const editor = stack.getBoundingClientRect();
+ const covers =
+ editor.top >= 0 &&
+ editor.bottom <= window.innerHeight &&
</file context>
| "scrollable", | ||
| stage.top < 0 || stage.bottom > window.innerHeight, | ||
| ); | ||
| reserveJimStageInEditor(stage); |
There was a problem hiding this comment.
P2: The reservation uses a stale stage rectangle after .scrollable can reposition the stage. Re-read getBoundingClientRect() after toggling .scrollable, otherwise an oversized compact card can reserve the fixed-bottom position while it is actually rendered at the toolbar anchor.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At web/interview.js, line 5863:
<comment>The reservation uses a stale stage rectangle after `.scrollable` can reposition the stage. Re-read `getBoundingClientRect()` after toggling `.scrollable`, otherwise an oversized compact card can reserve the fixed-bottom position while it is actually rendered at the toolbar anchor.</comment>
<file context>
@@ -5857,14 +5860,44 @@ function placeJimStageBelowToolbar(toolbar) {
"scrollable",
stage.top < 0 || stage.bottom > window.innerHeight,
);
+ reserveJimStageInEditor(stage);
};
const observer = new window.ResizeObserver(place);
</file context>
| reserveJimStageInEditor(stage); | |
| reserveJimStageInEditor(nodes.jimStage.getBoundingClientRect()); |
Jim's stage floats over the editor, and the editor did not know it was there. At 1366x900 the end of a line longer than about 95 columns, and the caret typing there, scrolled to the textarea's right edge at x 1349, under the stage that starts at x 1174; at 1100x800 the last rows could not be scrolled out from under the compact card. As accepted in #512, this keeps the floating stage, the captions, the self-view and the shell layout as they are and changes only the editor's scroll range.
placeJimStageBelowToolbar()already observes the stage. It now also callsreserveJimStageInEditor(), which writes what the stage covers to the editor stack:--jim-stage-reserve-rightbeside the floating stage, plus a 6 px gap, or--jim-stage-reserve-bottomunder the compact card. It also observes the editor stack, because the test drawer's splitter moves the editor's bottom under the card without resizing the window or the stage.Beside the floating stage the reservation is a transparent right border on
#editorand#editor-highlight, not the right padding #512 proposed. Chromium leaves a textarea's right padding out of its scroll range: with 191 px of right padding the end of a long line still scrolled to x 1349.6. A narrower box would work for scrolling but leaves the strip beside the code outside the textarea, so a click there blurred the editor; a border still takes that click. Under the compact card both text layers and the gutter pad their bottom instead, andscroll-padding-bottomkeeps the caret above the card while typing, because the card grows with the captions and a border there would resize the text area while Jim speaks. An editor that runs past the window, as under the stacked sidebar on a narrow screen, reserves nothing: the fixed card's overlap there depends on the page's scroll, and the page already scrolls any row out from under it.The three points raised in #512:
docs/avatar-contract.mdnow says so.at <width>px the caret at the end of a long line scrolls clear of Jim's stageruns at 1920, 1366 and 1100. It types a 302-character line, presses Home to check that the line is longer than the editor, presses End so the browser scrolls to it, then checks where the last glyph is painted on#editor-highlightand that#editor, which holds the caret, and#editor-linesscrolled exactly as far. At 1100 the stage is the compact card, so the check there is that the row ends above the card rather than left of it, which is what the bottom reservation provides; the test shrinks the drawer first, because on the test page the card otherwise covers only 13 px of the editor, less than its own bottom padding. With thereserveJimStageInEditor(stage)call removed it fails at all three widths: the line ends at 1903.6 under the stage from 1728 at 1920, at 1349.6 under the stage from 1174 at 1366, and the last row ends at 658.2 under the card from 606.6 at 1100.a click beside the code below Jim's floating stage stays in the editorpins the click. Removing the border,scroll-padding-bottom, the gutter's bottom padding or the editor-stack observer each fails one of the new tests. Removing the guard for an editor that runs past the window fails only the existinga stacked expanded drawing keeps the panel's available width, which then times out on an unstable Expand drawing button; there is no direct test of that guard.Before and after at 1366x900 and 1100x800, on the test page with a long line as the caret's row:
./scripts/test.shat this head, with Git 2.56.1: every gate passes except two that fail on this machine for reasons outside the change.git-hooksfails 2 of 482 checks becauseshfmt,commentflowandruffare not installed;browser-testsfails onlya formatter that cannot load changes nothing, and the next press loads itintests/browser/format-shortcut.test.js, which fails the same way with this change reverted and passes onmainin CI. Not run here: Java, ffmpeg and desktop tests, and the formatters and linters listed above. Not checked: Firefox and Safari, whose caret reveal may ignorescroll-padding-bottom(the last rows stay reachable by scrolling either way), and a live interview with captions growing the card.#713 also changes
placeJimStageBelowToolbar(), returningplaceand changing itsscrollablecondition, so whichever of the two lands second rebases.Close #512
Summary by cubic
Keeps the editor's scroll range clear of Jim's stage, so the caret and the end of a long line no longer scroll under it. This changes only the editor's scroll range; the floating stage, captions, self-view, and shell layout stay as accepted in #512.
scroll-padding-bottomkeeps the caret above the card while it grows with the captions; a border there would resize the text area.The three points from #512 are covered: the test drawer's right side stays for #790, the uniform right strip is documented in
docs/avatar-contract.md, and caret tests run at 1920, 1366, and 1100 px plus a click test.Closes #512.
Written for commit 7d26ed9. Summary will update on new commits.