Skip to content

feat: re-enable adaptive scaling for small viewports (Related to #6603)#6617

Open
gourijain029-del wants to merge 1 commit intosugarlabs:masterfrom
gourijain029-del:feat/mobile-scaling-6603
Open

feat: re-enable adaptive scaling for small viewports (Related to #6603)#6617
gourijain029-del wants to merge 1 commit intosugarlabs:masterfrom
gourijain029-del:feat/mobile-scaling-6603

Conversation

@gourijain029-del
Copy link
Copy Markdown
Contributor

Re-enables the commented-out adaptive scaling logic in _onResize so blocks automatically scale down on small screens instead of staying at a fixed 1.0 scale.

Changes

Single file: js/activity.js

  • _onResize: replace hardcoded turtleBlocksScale = 1.0 with adaptive scaling for screens narrower than 495px (min 0.5)
  • Fix mobileSize undefined reference with inline dimension check
  • repositionBlocks: use 170px left margin on mobile vs 100px on desktop
  • Use platform.mobile flag to consistently call setMobile(true)

Testing

  • ✅ All tests pass (93/93)
  • ✅ iPhone SE (375px) — blocks scale down to fit
  • ✅ iPhone 12 pro (390px) — blocks scale down
  • ✅ iPad Mini (768px) — normal scale, no change

Demo

Screen.Recording.2026-04-15.at.12.10.44.AM.mov

Category

  • Bug Fix
  • Feature
  • Performance
  • Tests
  • Documentation

Related

Part of #6603. Companion PRs: pinch-to-zoom, mobile-editing-layout, mobile-palette-drawer, touch-drag-threshold, widget-touch-handlers.

…rlabs#6603)

- _onResize: replace hardcoded turtleBlocksScale=1.0 with adaptive
  scaling for small screens (smallSide < cellSize*9), min 0.5
- Fix mobileSize undefined reference; use inline dimension check
- repositionBlocks: use 170px left margin on mobile vs 100px desktop
- Use platform.mobile flag to consistently call setMobile(true)
@github-actions github-actions bot added feature Adds new functionality size/S Small: 10-49 lines changed area/javascript Changes to JS source files labels Apr 14, 2026
@github-actions
Copy link
Copy Markdown
Contributor

✅ All Jest tests passed! This PR is ready to merge.

Copy link
Copy Markdown
Contributor

@stutijain2006 stutijain2006 left a comment

Choose a reason for hiding this comment

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

When I am checking on responsive one, and for various screen sizes, the block sizes are not getting scaling accordingly. And the size remains same for all screen size.

Image

See to it, and fix this and this remains same for all screen size.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/javascript Changes to JS source files feature Adds new functionality size/S Small: 10-49 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants