Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions src/chrome/styles/sidepanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -2437,14 +2437,36 @@ body {
white-space: nowrap;
}

@media (max-width: 520px) {
.selection-scope-banner {
grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
align-items: start;
}

.selection-scope-banner-copy {
grid-column: 2 / -1;
}

#selection-scope-restore {
grid-column: 2;
width: 100%;
}

#selection-scope-new-conversation {
grid-column: 3;
width: 100%;
}
}

@media (max-width: 340px) {
.selection-scope-banner {
grid-template-columns: auto minmax(0, 1fr);
}

.selection-scope-banner button {
#selection-scope-restore,
#selection-scope-new-conversation {
grid-column: 2;
justify-self: start;
width: 100%;
}
}

Expand Down
26 changes: 24 additions & 2 deletions src/firefox/styles/sidepanel.css
Original file line number Diff line number Diff line change
Expand Up @@ -2274,14 +2274,36 @@ body {
white-space: nowrap;
}

@media (max-width: 520px) {
.selection-scope-banner {
grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
align-items: start;
}

.selection-scope-banner-copy {
grid-column: 2 / -1;
}

#selection-scope-restore {
grid-column: 2;
width: 100%;
}

#selection-scope-new-conversation {
grid-column: 3;
width: 100%;
}
}

@media (max-width: 340px) {
.selection-scope-banner {
grid-template-columns: auto minmax(0, 1fr);
}

.selection-scope-banner button {
#selection-scope-restore,
#selection-scope-new-conversation {
grid-column: 2;
justify-self: start;
width: 100%;
}
}

Expand Down
3 changes: 2 additions & 1 deletion test/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -36088,7 +36088,8 @@ test('selected-text scope is a durable visible sidepanel state with a New conver
assert.match(banner, /data-i18n="sp\.selection_scope\.title"[\s\S]*?data-i18n="sp\.selection_scope\.description"[\s\S]*?id="selection-scope-new-conversation"[\s\S]*?data-i18n="sp\.btn\.clear"/, `${label}: selected-text notice and escape action should stay localized`);
assert.match(css, /\.selection-scope-banner \{[\s\S]*?var\(--warning\)[\s\S]*?var\(--bg-secondary\)/, `${label}: scope notice should use warning—not destructive—color semantics`);
assert.match(css, /\.selection-scope-banner button:disabled \{[\s\S]*?cursor: not-allowed;[\s\S]*?opacity:/, `${label}: busy scope recovery should look unavailable`);
assert.match(css, /@media \(max-width: 340px\) \{[\s\S]*?\.selection-scope-banner \{[\s\S]*?grid-template-columns: auto minmax\(0, 1fr\);/, `${label}: selected-text notice should reflow in narrow browser panels`);
assert.match(css, /@media \(max-width: 520px\) \{[\s\S]*?\.selection-scope-banner \{[\s\S]*?grid-template-columns: auto minmax\(0, 1fr\) minmax\(0, 1fr\);[\s\S]*?\.selection-scope-banner-copy \{[\s\S]*?grid-column: 2 \/ -1;[\s\S]*?#selection-scope-restore \{[\s\S]*?grid-column: 2;[\s\S]*?#selection-scope-new-conversation \{[\s\S]*?grid-column: 3;/, `${label}: common narrow sidepanels should give the notice a full row above two equal-width actions`);
assert.match(css, /@media \(max-width: 340px\) \{[\s\S]*?\.selection-scope-banner \{[\s\S]*?grid-template-columns: auto minmax\(0, 1fr\);[\s\S]*?#selection-scope-restore,[\s\S]*?#selection-scope-new-conversation \{[\s\S]*?grid-column: 2;[\s\S]*?width: 100%;/, `${label}: very narrow sidepanels should stack both scope actions below the notice`);
const baseBannerRuleIndex = css.indexOf('.selection-scope-banner {');
const narrowBannerRuleIndex = css.indexOf('.selection-scope-banner {', baseBannerRuleIndex + 1);
assert.ok(baseBannerRuleIndex >= 0 && narrowBannerRuleIndex > baseBannerRuleIndex, `${label}: narrow selected-text layout should follow and override the base banner grid`);
Expand Down
Loading