Skip to content

Synchronize expanded drawing layout updates - #674

Merged
jserv merged 1 commit into
sysprog21:mainfrom
Ericko00o:fix/641-expanded-callback
Nov 17, 2026
Merged

jserv merged 1 commit into
sysprog21:mainfrom
Ericko00o:fix/641-expanded-callback

Conversation

@Ericko00o

@Ericko00o Ericko00o commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Shrinking the Example drawing after a viewport resize can clamp the saved scroll position if it is restored before the drawer measures the docked height. An optional synchronous callback updates the drawer and Jim's stage on expand and shrink, so the docked height is ready before scroll restoration. This removes the two observers on data-expanded. The stage returns fit for #713 to use; its hidden observers are still needed for the ending and report overlays.

Validation: all 62 focused Chromium tests passed. Five separate delay probes failed at the intended assertions for stage layout, Escape, horizontal scroll, outer panel scroll, and programmatic shrink(). The Rust gate passed on the current head with a receipt (optional cargo-deny skipped). The prior full scripts/test.sh ran on Linux before the rebase onto the gate evidence workflow: the static browser suite had 3,451 passes and 30 skips (Java and ffmpeg unavailable). Four tooling gates failed locally and reproduced on upstream main at 21c45b1 in the same environment.

Close #641


Summary by cubic

Synchronizes expanded drawing layout updates so shrinking the Example drawing measures the docked height before restoring scroll, fixing the strip's scroll position after a resize while expanded.

  • Replaces the data-expanded mutation observers and queueMicrotask in shrinkBoard with a new synchronous onExpandedChange callback that runs the drawer's paint and Jim's fitJimStage before scroll restoration.
  • mountInterviewDrawer and compactJimStageBesideNarrowPanel now return paint and fit so callers can invoke them directly; mountExampleBoard accepts the new onExpandedChange option.
  • Strengthens layout tests to assert that stage compaction and scroll restoration finish before the expand/shrink click or Escape handler returns.

Closes #641.

Written for commit 5362abe. Summary will update on new commits.

View guided diff

cubic-dev-ai[bot]

This comment was marked as resolved.

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarify what prevented scripts/test.sh from completing, resolve the local Python/task-tools setup issues, and rerun the full test suite so we can confidently verify the changes.

jserv

This comment was marked as outdated.

jserv

This comment was marked as resolved.

@xubo9367 xubo9367 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 8ad41ac on Ubuntu with Node.js v22.23.4 and npm 10.9.9.

Ran:
node --test tests/browser/interview-layout.test.js tests/browser/example-board.test.js tests/browser/example-board-ui.test.js

Result: 56 passed, 0 failed, 0 skipped.

The two inline suggestions concern regression coverage for synchronous shrink behavior: Jim's stage restoration and horizontal scroll restoration. For each, an immediate assertion passed on the original implementation and failed with the corresponding update deferred.

The full scripts/test.sh gate was not run. All temporary local changes were restored.

Comment thread tests/browser/interview-layout.test.js Resolved
Comment thread web/example-board.js Resolved
Chuyutseng

This comment was marked as resolved.

jianjian0504

This comment was marked as resolved.

@Ericko00o
Ericko00o force-pushed the fix/641-expanded-callback branch from 8ad41ac to 5479d46 Compare November 17, 2026 14:34
@Ericko00o
Ericko00o requested a review from alanhc as a code owner November 17, 2026 14:34
@Ericko00o

Copy link
Copy Markdown
Contributor Author

Rebased on upstream main at 21c45b1. The earlier task-tools setup created a Windows venv at Scripts/python.exe, while scripts/test.sh looked for bin/python. A Linux venv let the full gate run through. The four local failures (test-gate-tests, review-memory-tests, git-hooks, and shell-syntax) also reproduced on upstream main in the same environment. The static browser suite had 3,451 passes, 0 failures, and 30 skips for missing Java or ffmpeg. All 62 focused Chromium tests passed without skips.

Shrinking the Example drawing relies on observer microtasks running
before scroll restoration. Notify the drawer and Jim's stage directly
so the docked height is measured before restoring scroll, including
after a resize while expanded. Keep the layout unchanged and check
that the updates finish synchronously.

Close sysprog21#641

Change-Id: Ie4c4deaf15d7942c276b53dc1c6f3be8cf296a2c
@Ericko00o
Ericko00o force-pushed the fix/641-expanded-callback branch from 5479d46 to 5362abe Compare November 17, 2026 14:42
@jserv
jserv dismissed their stale review November 17, 2026 15:04

No merge conflicts at the current head.

@jserv
jserv added this pull request to the merge queue Nov 17, 2026
@jserv

jserv commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Thank @Ericko00o for contributing!

Merged via the queue into sysprog21:main with commit 465d881 Nov 17, 2026
18 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tell the drawer and Jim's stage about an expanded Example drawing with a callback, not observers

5 participants