Keep the editor's code clear of Jim's stage
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 calls reserveJimStageInEditor(), which writes what the stage covers to the editor stack: --jim-stage-reserve-right beside the floating stage, plus a 6 px gap, or --jim-stage-reserve-bottom under 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 #editor and #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, and scroll-padding-bottom keeps 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:
- The test drawer. This change reserves space in the editor only; the right side of Add a case and Test results under the compact card is left for #790.
- The right reservation is written once for the whole editor, so rows below the floating stage also end at the stage's column and leave an empty strip under it. "Placement and pose" in
docs/avatar-contract.mdnow says so. - The caret test.
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 editor pins 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 existing a 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.sh at this head, with Git 2.56.1: every gate passes except two that fail on this machine for reasons outside the change. git-hooks fails 2 of 482 checks because shfmt, commentflow and ruff are not installed; browser-tests fails only a formatter that cannot load changes nothing, and the next press loads it in tests/browser/format-shortcut.test.js, which fails the same way with this change reverted and passes on main in 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 ignore scroll-padding-bottom (the last rows stay reachable by scrolling either way), and a live interview with captions growing the card.
#713 also changes placeJimStageBelowToolbar(), returning place and changing its scrollable condition, 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.
- Beside the floating stage a transparent border reserves the width, with a 6 px gap; right padding doesn't scroll in a textarea, and a narrower box wouldn't take a click beside the code.
- Under the compact card the text layers and gutter pad their bottom, and
scroll-padding-bottomkeeps the caret above the card while it grows with the captions; a border there would resize the text area. - An editor-stack observer updates the reservation when the test drawer's splitter moves the editor; an editor running past the window reserves nothing, since the page scrolls rows out from under the fixed card.
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.