Skip to content

Commit dc2b26c

Browse files
authored
fix(ui): align cloud machine summaries (#132350)
Co-authored-by: roboclaw-bot <[email protected]>
1 parent 9887bd4 commit dc2b26c

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

‎ui/src/pages/new-session/cloud-target.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,23 @@ describe("cloud target menu", () => {
4141
expect(container.querySelector(".session-menu__sub")?.textContent).toBe(expected);
4242
});
4343

44+
it("renders the default badge before the machine shape", () => {
45+
const container = document.createElement("div");
46+
render(
47+
renderCloudMachineMenuItems({
48+
machines: [{ id: "standard", label: "Standard", cpu: 32, memoryGb: 64, default: true }],
49+
selectedId: "standard",
50+
submitting: false,
51+
onSelect: vi.fn(),
52+
}),
53+
container,
54+
);
55+
56+
const badge = container.querySelector(".new-session-page__menu-facts");
57+
const shape = container.querySelector(".session-menu__sub");
58+
expect(badge?.compareDocumentPosition(shape as Node)).toBe(Node.DOCUMENT_POSITION_FOLLOWING);
59+
});
60+
4461
it("disables cloud profiles with the runtime preflight reason", () => {
4562
const container = document.createElement("div");
4663
render(

‎ui/src/pages/new-session/cloud-target.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ export function renderSessionMenuItem(params: SessionMenuItemOptions, submitting
4545
? html`<span class="session-menu__icon" aria-hidden="true">${params.icon}</span>`
4646
: nothing}
4747
<span class="session-menu__text">${params.label}</span>
48-
${params.sub ? html`<span class="session-menu__sub">${params.sub}</span>` : nothing}
4948
${params.facts?.length
5049
? html`<span class="new-session-page__menu-facts">
5150
${params.facts.map(
5251
(fact) => html`<span class="new-session-page__menu-fact">${fact}</span>`,
5352
)}
5453
</span>`
5554
: nothing}
55+
${params.sub ? html`<span class="session-menu__sub">${params.sub}</span>` : nothing}
5656
<span class="session-menu__check" aria-hidden="true"
5757
>${params.checked ? icons.check : nothing}</span
5858
>

0 commit comments

Comments
 (0)