Skip to content

Commit 39b7e4a

Browse files
committed
fix(web): adapt session launcher cards to narrow panes
1 parent 4521ccd commit 39b7e4a

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

packages/web/src/styles/components.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4694,12 +4694,14 @@ textarea.input {
46944694
}
46954695

46964696
.agent-draft-launcher {
4697+
container-type: inline-size;
46974698
background:
46984699
radial-gradient(circle at center, rgba(108, 182, 255, 0.08), transparent 30%), transparent;
46994700
}
47004701

47014702
.agent-draft-content {
47024703
width: min(680px, calc(100% - 48px));
4704+
max-width: 100%;
47034705
align-items: stretch;
47044706
gap: var(--sp-4);
47054707
padding: var(--sp-8) var(--sp-6);
@@ -4735,6 +4737,7 @@ textarea.input {
47354737

47364738
.agent-provider-card {
47374739
height: auto;
4740+
min-width: 0;
47384741
align-items: flex-start;
47394742
justify-content: flex-start;
47404743
padding: var(--sp-4);
@@ -4777,6 +4780,7 @@ textarea.input {
47774780
.agent-provider-card-body {
47784781
display: flex;
47794782
flex-direction: column;
4783+
width: 100%;
47804784
gap: 6px;
47814785
min-width: 0;
47824786
}
@@ -4846,6 +4850,18 @@ textarea.input {
48464850
margin-left: auto;
48474851
align-self: center;
48484852
color: var(--text-tertiary);
4853+
flex-shrink: 0;
4854+
}
4855+
4856+
@container (max-width: 36rem) {
4857+
.agent-draft-content {
4858+
width: 100%;
4859+
padding-inline: var(--sp-4);
4860+
}
4861+
4862+
.agent-draft-providers {
4863+
grid-template-columns: 1fr;
4864+
}
48494865
}
48504866

48514867
.session-card {

packages/web/src/styles/components.theme.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,23 @@ describe("components.css theme-sensitive surfaces", () => {
154154
expect(stylesheet).not.toContain("\n.agent-provider-card[disabled] {\n");
155155
});
156156

157+
it("keeps draft launcher provider cards adaptive inside narrow panes", () => {
158+
const launcher = getLastRuleBlock(".agent-draft-launcher");
159+
const content = getLastRuleBlock(".agent-draft-content");
160+
const providerCard = getLastRuleBlock(".agent-provider-card");
161+
const providerBody = getLastRuleBlock(".agent-provider-card-body");
162+
const providerArrow = getLastRuleBlock(".agent-provider-card-arrow");
163+
164+
expect(launcher).toContain("container-type: inline-size");
165+
expect(content).toContain("max-width: 100%");
166+
expect(providerCard).toContain("min-width: 0");
167+
expect(providerBody).toContain("width: 100%");
168+
expect(providerArrow).toContain("flex-shrink: 0");
169+
expect(stylesheet).toMatch(
170+
/@container\s*\(max-width:\s*36rem\)\s*\{[\s\S]*?\.agent-draft-providers\s*\{[\s\S]*?grid-template-columns:\s*1fr;[\s\S]*?\}/
171+
);
172+
});
173+
157174
it("keeps mobile sheet bodies as flex columns so sheet content can fill the viewport", () => {
158175
const sheetBody = getLastRuleBlock(".mobile-sheet__body");
159176
const sheetBodyChildren = getLastRuleBlock(".mobile-sheet__body > *");

0 commit comments

Comments
 (0)