Skip to content

fix(docs): prevent squished puzzle canvases on narrow viewports - #8

Merged
ShadowNineX merged 3 commits into
mainfrom
copilot/fix-squished-tiles-issue
Apr 29, 2026
Merged

fix(docs): prevent squished puzzle canvases on narrow viewports#8
ShadowNineX merged 3 commits into
mainfrom
copilot/fix-squished-tiles-issue

Conversation

Copilot AI commented Apr 29, 2026

Copy link
Copy Markdown

Puzzle demos on the docs site rendered squished (compressed horizontally) on narrow viewports such as phones.

Root cause

docs/src/styles/demos.css set max-width: 100% on .demo-canvas .konvajs-content. When the viewport was narrower than a canvas's intrinsic width (e.g. 800px), the browser shrank the wrapper's CSS width while Konva's inline height style stayed fixed. Since Konva's layered <canvas> elements are absolutely positioned inside that wrapper, only one axis was scaled — distorting the aspect ratio.

This is a docs-only issue; the library itself is unaffected.

Changes

  • docs/src/styles/demos.css — drop the max-width: 100% rule on .konvajs-content. The pre-existing .demo-canvas { overflow-x: auto } already provides a horizontal scrollbar on narrow viewports without distorting aspect ratio.
-.demo-canvas .konvajs-content {
-  max-width: 100%;
-}

Notes for reviewers

  • The Responsive sample is unaffected: it programmatically refits via responsive.resize(container.offsetWidth, …) on resize / DOMContentLoaded, and .demo-canvas (the container it measures) still has max-width: 100%, so offsetWidth continues to clamp to viewport width.
  • Browser-based visual verification was not possible in this environment (Playwright held an unreleasable lock on its user-data-dir). Worth a manual check at ~390px width on /samples/basic/ and friends before merging.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • iojs.org
    • Triggering command: /usr/bin/curl curl -q --fail --compressed -L -s REDACTED -o - (dns block)
  • telemetry.astro.build
    • Triggering command: /home/REDACTED/.nvm/versions/node/v22.22.2/bin/node node /home/REDACTED/work/headbreaker/headbreaker/docs/node_modules/.bin/astro dev (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue Apr 29, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits April 29, 2026 17:44
Agent-Logs-Url: https://github.com/ShadowNineX/headbreaker/sessions/c6691f3e-db39-4a29-8d12-5b390ba52ed2

Co-authored-by: ShadowNineX <223153516+ShadowNineX@users.noreply.github.com>
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI changed the title [WIP] Fix squished tiles on docs page fix(docs): prevent squished puzzle canvases on narrow viewports Apr 29, 2026
Copilot AI requested a review from ShadowNineX April 29, 2026 17:46
@ShadowNineX
ShadowNineX marked this pull request as ready for review April 29, 2026 17:55

@ShadowNineX ShadowNineX left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

OK

@ShadowNineX
ShadowNineX merged commit 409c679 into main Apr 29, 2026
4 checks passed
@ShadowNineX
ShadowNineX deleted the copilot/fix-squished-tiles-issue branch April 29, 2026 17:56
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.

Squished tiles

2 participants