Skip to content

3D engine that AI agents drive

Fit the Object studio toolbar at 1024 px (#2245)

Nguyen Xuan Anbd36796603fb
diff --git a/changes/2245.md b/changes/2245.md
new file mode 100644
index 00000000..6ba7af03
--- /dev/null
+++ b/changes/2245.md
@@ -0,0 +1 @@
+- Fit the Object studio toolbar on one row at 1024 px so Reset view and Export GLB no longer wrap or clip (#2245).
diff --git a/scripts/smoke-scenes.mjs b/scripts/smoke-scenes.mjs
index e74cab63..02dca8dd 100644
--- a/scripts/smoke-scenes.mjs
+++ b/scripts/smoke-scenes.mjs
@@ -24,6 +24,24 @@ try {
await page.setViewportSize(size);
await page.goto('http://127.0.0.1:5179/object.html');
await page.waitForSelector('#benchmark');
+ const toolbarProblems = await page.evaluate(() => {
+ const bar = document.querySelector('.toolbar').getBoundingClientRect();
+ const items = [...document.querySelectorAll('.toolbar .brand, .toolbar .studio-nav a, .toolbar-actions button')];
+ const boxes = items.map((item) => ({ name: item.textContent.trim(), box: item.getBoundingClientRect() }));
+ const problems = [];
+ for (const [index, { name, box }] of boxes.entries()) {
+ if (box.left < bar.left - 0.5 || box.right > bar.right + 0.5) problems.push(`${name} overflows the toolbar`);
+ if (box.height > 0 && box.height < 32) problems.push(`${name} is under 32 px tall`);
+ for (const other of boxes.slice(index + 1)) {
+ if (box.left < other.box.right && box.right > other.box.left && box.top < other.box.bottom && box.bottom > other.box.top) problems.push(`${name} overlaps ${other.name}`);
+ }
+ }
+ const actions = [...document.querySelectorAll('.toolbar-actions button')];
+ if (actions.some((button) => button.getBoundingClientRect().height > 50)) problems.push('a toolbar button label wraps');
+ if (document.documentElement.scrollWidth > window.innerWidth) problems.push('the page scrolls sideways');
+ return problems;
+ });
+ assert.deepEqual(toolbarProblems, [], `Object studio toolbar does not fit at ${size.width}x${size.height}.`);
const overlaps = await page.evaluate(() => {
const panel = document.querySelector('.controls').getBoundingClientRect();
const footerItems = ['#benchmark', '#cpu', '#parts'].map((selector) => document.querySelector(selector).getBoundingClientRect());
diff --git a/src/style.css b/src/style.css
index b3d43429..06b2170e 100644
--- a/src/style.css
+++ b/src/style.css
@@ -17,7 +17,8 @@ button:disabled { opacity: 0.6; cursor: wait; }
.studio-nav { display: flex; gap: 6px; }
.studio-nav a { text-decoration: none; color: #a6b1b6; font-size: 13px; padding: 9px 12px; border-radius: 7px; }
.studio-nav a[aria-current] { color: #edf0ef; background: #ffffff09; }
-.toolbar-actions { margin-left: auto; display: flex; gap: 10px; }
+.toolbar-actions { margin-left: auto; display: flex; flex-shrink: 0; gap: 10px; }
+.toolbar-actions button { white-space: nowrap; min-height: 40px; }
.primary { background: #b7eddf; color: #19312c; font-weight: 600; }
.primary:hover { background: #cdf7ec; }
.primary span { margin-left: 14px; }
@@ -71,6 +72,12 @@ h2 { font-weight: 500; font-size: 20px; margin: 0 0 15px; }
.controls input[type=range] { margin-bottom:16px; }
}
@media (max-width: 1100px) {
+ .toolbar { inset-inline: 24px; gap: 12px; }
+ .studio-nav { gap: 2px; }
+ body .studio-nav a { padding-inline: 8px; }
+ .toolbar-actions { gap: 6px; }
+ .toolbar-actions button { padding-inline: 12px; }
+ .primary span { margin-left: 8px; }
.object-info { top: 19%; max-width: 250px; }
h1 { font-size: 35px; }
.object-info p { font-size: 12px; }