Skip to content

fix(ui): Make office canvas responsive - remove fixed size, add aspect-ratio and 98% width - #6

Merged
Silvertree2010 merged 1 commit into
Silvertree2010:mainfrom
Prin-Ing:patch-3
Oct 30, 2026
Merged

Silvertree2010 merged 1 commit into
Silvertree2010:mainfrom
Prin-Ing:patch-3

Conversation

@Prin-Ing

Copy link
Copy Markdown
Contributor

Summary

Make the main office canvas responsive and prevent clipping.

Changes

File: ui/index.html

  1. CSS (L206)

    • Before: canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
    • After: canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; aspect-ratio: 200 / 129; width: 98%; }
  2. HTML (L461)

    • Before: <canvas id="cv" width="400" height="258"></canvas>
    • After: <canvas id="cv"></canvas>
-canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
+canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; aspect-ratio: 200 / 129; width: 98%; }

-<canvas id="cv" width="400" height="258"></canvas>
+<canvas id="cv"></canvas>

Why

  • Fixed 400x258 attributes caused overflow/clipping inside .stage on smaller viewports
  • width: 98% makes it fit parent with margin
  • aspect-ratio: 200/129 preserves original office ratio (400/258)
  • pixelated / crisp-edges keeps pixel art sharp

How to test

  1. Run apollo-office
  2. Resize browser window
  3. Verify canvas scales, keeps ratio, stays sharp, no overflow

AI Disclosure: Code changes authored manually. AI was only used to format this PR description.

## Summary
Make the main office canvas responsive and prevent clipping.

## Changes
**File:** `ui/index.html`

1. **CSS (L206)**
   - Before: `canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }`
   - After: `canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; aspect-ratio: 200 / 129; width: 98%; }`

2. **HTML (L461)**
   - Before: `<canvas id="cv" width="400" height="258"></canvas>`
   - After: `<canvas id="cv"></canvas>`

```diff
-canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
+canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; aspect-ratio: 200 / 129; width: 98%; }

-<canvas id="cv" width="400" height="258"></canvas>
+<canvas id="cv"></canvas>
```

## Why
- Fixed 400x258 attributes caused overflow/clipping inside `.stage` on smaller viewports
- `width: 98%` makes it fit parent with margin
- `aspect-ratio: 200/129` preserves original office ratio (400/258)
- `pixelated / crisp-edges` keeps pixel art sharp

## How to test
1. Run `apollo-office`
2. Resize browser window
3. Verify canvas scales, keeps ratio, stays sharp, no overflow

---
**AI Disclosure:** Code changes authored manually. AI was only used to format this PR description.
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0eb5f75b-711c-4c0b-8ffd-30fb4380d9de
Commits

Reviewing files that changed from the base of the PR and between 5dbafee and 23c73be.

Files selected for processing: 1
  • ui/index.html
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Silvertree2010
Silvertree2010 merged commit e553d51 into Silvertree2010:main Oct 30, 2026
1 check passed
@Silvertree2010

Copy link
Copy Markdown
Owner

Thanks for the fix, @Prin-Ing! Merged and shipped in v0.8.3.

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.

2 participants