Skip to content

Keep tall diagrams reachable in the preview - #37

Merged
konojunya merged 1 commit into
mainfrom
agent/preview-inner-scroll
Sep 6, 2026
Merged

Keep tall diagrams reachable in the preview#37
konojunya merged 1 commit into
mainfrom
agent/preview-inner-scroll

Conversation

@konojunya

Copy link
Copy Markdown
Member

Background

Tall downward diagrams were centered inside the preview scroll container. When the rendered image exceeded the available height, flex centering placed its leading edge outside the reachable scroll origin, so the diagram appeared clipped.

Implementation Approach

  • Give the preview scroll area an accessible region name.
  • Move centering to auto margins on the SVG trigger so small diagrams stay centered while oversized diagrams start at the scroll origin.
  • Remove height-based image constraints so tall diagrams fit the preview width and scroll vertically.
  • Keep the empty state centered independently.

Testing Approach

  • Added a focused component regression for the scroll container and safe-centering contract.
  • Ran npm run format, npm run lint, npm test, and npm run build.
  • Verified in Google Chrome at 320, 390, 1024, and 1440 CSS px.
  • With a 1440x900 viewport, the supplied tall topology produced scrollHeight 1133 > clientHeight 768, started at scrollTop 0, reached the 365 maximum, and responded to Page Down while the preview trigger was focused.
  • Confirmed a small diagram remains centered with equal horizontal and vertical margins and no page-level horizontal overflow.

Review Perspectives / Points of Concern

  • The trigger retains max-width: 100% so wide diagrams continue to fit the pane.
  • The expanded dialog remains unchanged and keeps its independent two-axis scroll behavior.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 6, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
stack-web 8154ff2 Commit Preview URL

Branch Preview URL
Sep 06 2026, 04:44 AM

@konojunya
konojunya merged commit 6c72df6 into main Sep 6, 2026
2 checks passed
@konojunya
konojunya deleted the agent/preview-inner-scroll branch September 6, 2026 05:02
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.

1 participant