Skip to content

Open-source AI browser agent for Chrome and Firefox (monorepo) 🧠

Side panel: wrap the toolbar at 150%/175% without reordering focusable controls

Claude8b327cdc2738
diff --git a/src/chrome/styles/sidepanel.css b/src/chrome/styles/sidepanel.css
index c8b022fbd..e2a69f3bd 100644
--- a/src/chrome/styles/sidepanel.css
+++ b/src/chrome/styles/sidepanel.css
@@ -3455,9 +3455,10 @@ html[dir="rtl"] .composer-toolbar .provider-picker-menu {
}
/* Narrow panel at a large UI scale (150%/175% leave ~160-200px inside the
- composer): the model picker takes its own row, so the fixed-width controls
- (attach, status, permissions, mic, send) can no longer squeeze it to a few
- pixels. The second row keeps them right-aligned through the spacer. */
+ composer): the model picker fills the first row next to the attach button, so
+ the fixed-width controls (status, permissions, mic, send) wrap to a second row
+ instead of squeezing it to a few pixels. The DOM order is unchanged, so
+ keyboard focus follows the visual order. */
html[data-ui-scale="150"] .composer-toolbar,
html[data-ui-scale="175"] .composer-toolbar {
flex-wrap: wrap;
@@ -3466,8 +3467,8 @@ html[data-ui-scale="175"] .composer-toolbar {
html[data-ui-scale="150"] .composer-toolbar .provider-picker,
html[data-ui-scale="175"] .composer-toolbar .provider-picker {
- order: -1;
- flex: 1 1 100%;
+ /* 100% minus the 28px attach button and the 6px gap */
+ flex: 1 1 calc(100% - 34px);
max-width: none;
}
diff --git a/src/firefox/styles/sidepanel.css b/src/firefox/styles/sidepanel.css
index 652543a94..59edd5825 100644
--- a/src/firefox/styles/sidepanel.css
+++ b/src/firefox/styles/sidepanel.css
@@ -3281,9 +3281,10 @@ html[dir="rtl"] .composer-toolbar .provider-picker-menu {
}
/* Narrow panel at a large UI scale (150%/175% leave ~160-200px inside the
- composer): the model picker takes its own row, so the fixed-width controls
- (attach, status, permissions, mic, send) can no longer squeeze it to a few
- pixels. The second row keeps them right-aligned through the spacer. */
+ composer): the model picker fills the first row next to the attach button, so
+ the fixed-width controls (status, permissions, mic, send) wrap to a second row
+ instead of squeezing it to a few pixels. The DOM order is unchanged, so
+ keyboard focus follows the visual order. */
html[data-ui-scale="150"] .composer-toolbar,
html[data-ui-scale="175"] .composer-toolbar {
flex-wrap: wrap;
@@ -3292,8 +3293,8 @@ html[data-ui-scale="175"] .composer-toolbar {
html[data-ui-scale="150"] .composer-toolbar .provider-picker,
html[data-ui-scale="175"] .composer-toolbar .provider-picker {
- order: -1;
- flex: 1 1 100%;
+ /* 100% minus the 28px attach button and the 6px gap */
+ flex: 1 1 calc(100% - 34px);
max-width: none;
}
diff --git a/test/sidepanel-permission-gate-ui.mjs b/test/sidepanel-permission-gate-ui.mjs
index 657ef03ab..8e01996f1 100644
--- a/test/sidepanel-permission-gate-ui.mjs
+++ b/test/sidepanel-permission-gate-ui.mjs
@@ -209,6 +209,15 @@ for (const [build, engine, api] of [['chrome', chromium, 'chrome'], ['firefox',
assert.ok(rects.permission.top >= rects.picker.bottom - 1, 'permission and mic controls sit below the picker, not on top of it');
assert.ok(rects.mic.top >= rects.picker.bottom - 1);
assert.ok(rects.permission.right <= rects.wrapper.right && rects.mic.right <= rects.wrapper.right, 'controls stay inside the composer');
+ // No visual reordering: tabbing through the toolbar reads top-to-bottom, left-to-right.
+ const order = await page.evaluate(() => [...document.querySelectorAll('.composer-toolbar button:not([hidden]), .composer-toolbar [tabindex]:not([tabindex="-1"])')]
+ .filter((el) => el.getBoundingClientRect().width > 0)
+ .map((el) => { const r = el.getBoundingClientRect(); return { id: el.id, top: Math.round((r.top + r.bottom) / 2), left: Math.round(r.left) }; }));
+ for (let i = 1; i < order.length; i++) {
+ const before = order[i - 1], after = order[i];
+ assert.ok(after.top > before.top + 8 || (Math.abs(after.top - before.top) <= 8 && after.left >= before.left),
+ `DOM order matches visual order (${before.id} then ${after.id})`);
+ }
}, { width: 360 });
});
});