Skip to content

Keep constrained drawings clear of captions - #713

Open
EricHuang0302 wants to merge 10 commits into
sysprog21:mainfrom
EricHuang0302:fix-constrained-drawing-captions
Open

EricHuang0302 wants to merge 10 commits into
sysprog21:mainfrom
EricHuang0302:fix-constrained-drawing-captions

Conversation

@EricHuang0302

@EricHuang0302 EricHuang0302 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Expanded Example drawings can put label controls beneath Jim's caption card. When the card cannot fit beside the drawing, place it below the editor and reserve its 40dvh height cap. Stack the workspace when the sidebar's current width and the editor's minimum width cannot fit side by side.

The constrained editor follows the viewport budget without a rem-based height floor. Drawing tools stay on a horizontally scrollable row, and captions come first in the capped, scrollable card. Explicit expansion and relocated divider focus bring the editor into view; ordinary resizing preserves the reading position. Shrinking and ending/report transitions restore placement and inertness.

The docked card puts captions before the turn controls in the document, so Tab follows the displayed order. The floating card keeps its original order. The two 1024×800 cases cover normal expansion and divider focus separately, with no test scroll before checking the editor and canvas.

On 5a96bbc4, 205 related browser tests passed with no skips. Linux Rust gate passed with three test threads, one Tokio worker and a one-second DNS retry setting, with desktop and cargo-deny skipped. The full macOS run reported LiveKit fixture failures. The 900×700 transcript case also passes on Linux. Drawing toggles preserve the caption scroll offset, and 900×320 at 32px retains a usable canvas with page scrolling. The browser tests use the real page with a test fixture and do not join a live interview.

Earlier 900px layout comparison, before the caption-sizing refinement
Before After
900px before: caption card overlaps drawing 900px after: caption card below drawing
Earlier enlarged-font layout comparison
Before After
Enlarged font before: narrow drawing Enlarged font after: stacked layout preserves drawing width

Close #704

cubic-dev-ai[bot]

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as outdated.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

@EricHuang0302
EricHuang0302 force-pushed the fix-constrained-drawing-captions branch from 752980d to d992bfb Compare November 16, 2026 16:31
@EricHuang0302

Copy link
Copy Markdown
Contributor Author

Rebased onto upstream/main at 9f9adee and folded the fixups into two functional commits: narrow-screen caption layout, then enlarged-font stacking. Both pass their layout tests independently; the final tree passes all 85 related tests, and the combined #674 runtime passes all 26 layout tests.

jserv

This comment was marked as resolved.

@EricHuang0302
EricHuang0302 force-pushed the fix-constrained-drawing-captions branch from d992bfb to fcb70ed Compare November 16, 2026 17:02
@EricHuang0302

Copy link
Copy Markdown
Contributor Author

CI failed only on a 4s token-request timeout in the Python pending-judge startup test. node --test tests/browser/start-language.test.js passes 13/13 locally. Could a maintainer rerun the failed browser job? My account cannot rerun upstream workflows.

jserv

This comment was marked as resolved.

jserv

This comment was marked as outdated.

Chuyutseng

This comment was marked as resolved.

jserv

This comment was marked as outdated.

@jserv

jserv commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@EricHuang0302 Yes, wherever the card sits in its own row. At 1024px and above, .drawing-captions-below still turns on when the stack or an enlarged root font leaves the card no room beside the editor, which is the 1024x800 at 32px case from #704. There .editor-panel[data-example-drawing="true"] keeps max(34rem, calc(100dvh - 2rem)), so the card sits a viewport below the canvas, which is what the 900px fix removed.

Move the height: max(34rem, calc(100dvh - 3rem - var(--jim-stage-height, 0px))) rule out of @media (max-width: 1023px) so it follows the class and not the width. The unclassed two-column layout, where the card sits beside the editor, keeps its height.

Then assert in the [1024, 800, false, 32, true] and [1024, 800, true, 32, true] cases that the canvas and #captions-bar are both in the viewport after one scroll to the editor, as the 900px case does.

ChenYingHan1121

This comment was marked as resolved.

jserv

This comment was marked as outdated.

EricHuang0302 and others added 3 commits November 21, 2026 21:16
Place a cramped caption card below the expanded drawing and reserve its
measured height at stacked widths. Refresh floating placement after mode
changes and preserve ending/report inertness without moving the stage.

Extend label, caption and overlay checks on the real page at stacked
widths while keeping the desktop reservation where it fits.

Change-Id: Ibe7a5a4b784f54b2a6669939cfd9919811dfeabf
Use the configured sidebar track and editor minimum to decide when the
workspace must stack. Transfer focus before hiding the divider and
scroll only on explicit expansion, preserving reading position on
resize.

Keep captions below the editor in the forced stack, restore the original
columns on shrink, and cover the enlarged-font and resize cases.

Close sysprog21#704

Change-Id: I1dd7c99308814ea54153cb628450d64613747227
Reserve the caption card's 40dvh cap for the editor instead of its live
height, so captions that stream in no longer move the text controls
while a pointer is pressed on them. Apply the height whenever the card
sits below the editor, not only under 1024px.

Give the captions a floor of the heading plus one line, so a short
viewport scrolls the card instead of squeezing the text away.

Close sysprog21#704

Change-Id: Ifb8a5fe63f17ce2defaae652d491f6cd4a8fdda1
@jserv

jserv commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

@EricHuang0302 Asking again for my 2026-11-18 comment (#713 (comment)), which this head (fcb70edd) still does not carry:

  • Move height: max(34rem, calc(100dvh - 3rem - var(--jim-stage-height, 0px))) out of @media (max-width: 1023px) in web/styles.css, so it follows .drawing-captions-below rather than the width. The unclassed two-column layout keeps its height.
  • In the [1024, 800, false, 32, true] and [1024, 800, true, 32, true] cases, assert that the canvas and #captions-bar are both in the viewport after one scroll to the editor, as the 900px case does.

Push both to this branch together with the rebase.

@EricHuang0302
EricHuang0302 force-pushed the fix-constrained-drawing-captions branch from fcb70ed to 831f200 Compare November 21, 2026 17:05
@jserv
jserv dismissed stale reviews from themself November 21, 2026 17:07

No merge conflicts at the current head.

jserv

This comment was marked as outdated.

@EricHuang0302

Copy link
Copy Markdown
Contributor Author

The height rule now follows .drawing-captions-below at all widths. The requested 32px viewport assertion is still unmet: the 34rem editor minimum alone is 1088px. The current test checks the canvas start and card placement instead. Should this minimum be relaxed for that case?

The gate note for 831f200a is now pushed. Could you rerun the failed check? My account cannot rerun upstream workflows.

jserv

This comment was marked as resolved.

jserv

This comment was marked as resolved.

Remove the rem-based panel floor and assert full canvas and caption
visibility at 32px. Keep drawing tools on a scrollable row and captions
first so short windows retain usable drawing space.

Reuse the expanded drawing state and let placement alone manage the
scrollable card class.

Scroll relocated divider focus into view without moving readers on
ordinary resize.

Change-Id: I7c9c26c4937d772dfd470746b4c257391ba5f98d

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 3 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

View guided diff | Re-trigger cubic

Comment thread web/interview.js Resolved
Comment thread web/styles.css Resolved
@jserv

jserv commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Some review comments on this pull request are not settled yet. Please refine the change per the review comments listed below, reply on each thread with what you changed or why you did not, and mark each thread resolved yourself once it is settled (Resolve conversation, at the bottom of the thread). The pull request stays blocked while review threads are open.

Not addressed at the current head:

Checked at c3aeed5.

Comment thread tests/browser/interview-layout.test.js Resolved
EricHuang0302 added 2 commits November 22, 2026 10:44
Use the same resize fixture to check reading position and focus.

Change-Id: I2f6951d378e01ae2a9a02052be233d6115e1de5b
Place captions before the turn row so Tab follows the visual order.
Scale constrained cards with enlarged fonts and reserve a caption line
below the Unclear control. Keep toolbar focus rings inside the
scrollport.

Change-Id: I4f89d10d73df843841ee8069efcd0f0adcc1d626

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 3 files (changes from recent commits).

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="tests/browser/interview-layout.test.js">

<violation number="1" location="tests/browser/interview-layout.test.js:1173">
P3: For width 900, this scrolls the editor into view before measuring it, so the editor and canvas bounds checks no longer prove that expansion brought them into view. Measure before the `scrollIntoView` call, as the 1024px cases do, and keep the scroll only for later interactions.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread tests/browser/interview-layout.test.js Resolved
Preserve the floating card and its transcript scroll behavior.

Change-Id: I2a55a4315e22c0457b70c5de533e6f60ee067a2e

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread web/interview.js Resolved
Restore the caption scroll offset after moving its controls.

Change-Id: Id7031d84488b2efcfe7ba93f72fc4216342ac67b
Comment thread web/styles.css Resolved
Comment thread tests/browser/interview-layout.test.js Resolved
EricHuang0302 added 2 commits November 22, 2026 11:53
Reserve canvas height and verify docking after overlays close.

Change-Id: I0ce1ee2fe5e564355ab5c02527b5144a0a015316
Center the canvas after each draft interaction before clicking again.

Change-Id: I74f60e94dac01675c06374b5531b1955aaeeaf9f
@EricHuang0302

Copy link
Copy Markdown
Contributor Author

The 900×320 failure comes from click coordinates above the viewport after earlier draft interactions. Centering the canvas before each click fixes it locally, with all 205 related browser tests passing.

The test-only fix is ready, but the pre-push Rust gate repeatedly fails in unchanged startup_media.rs:496 (forwarding is still backpressured), so I cannot attach a passing gate note for the new tree yet. Is there a known workaround for this fixture?

await canvas.evaluate((node) => node.scrollIntoView({ block: "center" }));
const rect = await canvas.boundingBox();
assert.ok(rect.y >= 0 && rect.y + rect.height <= height);

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.

Keep drawing text controls clear of captions in constrained layouts

5 participants