Skip to content

Commit 3f9075e

Browse files
author
Carl
committed
Give subgroup emoji a little breathing room
Signed-off-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz>
1 parent 435d1db commit 3f9075e

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

‎src/bundled/channels/Channels.module.css‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@
258258
text-overflow: ellipsis;
259259
white-space: nowrap;
260260
}
261+
.sectionLabel [data-sidebar-group-icon] {
262+
margin-inline-end: var(--space-1);
263+
}
261264
.sectionChevron {
262265
display: inline-grid;
263266
width: var(--space-6);

‎tests/browser/fixture.mjs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ export const test = base.extend({
224224
order: 1,
225225
icon: ":unavailable_icon:",
226226
},
227+
{ id: "laptop", name: "Laptop", order: 2, icon: "👨‍💻" },
227228
]
228229
: []),
229230
],

‎tests/browser/navigation-group-icons.spec.mjs‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,29 @@ test("group icons resolve custom media without overlapping labels, and the creat
6666
)
6767
.toBe(true);
6868
await expect(section.locator("summary [data-loading]")).toHaveCount(0);
69+
for (const key of ["work", "laptop"]) {
70+
const summary = page.locator(
71+
`[data-sidebar-section="group:${key}"] summary`,
72+
);
73+
const layout = await summary.evaluate((element) => {
74+
const icon = element.querySelector("[data-sidebar-group-icon]");
75+
const title = document.createRange();
76+
title.selectNodeContents(icon.nextSibling);
77+
return {
78+
gap:
79+
title.getBoundingClientRect().left -
80+
icon.getBoundingClientRect().right,
81+
height: element.getBoundingClientRect().height,
82+
};
83+
});
84+
expect(layout.gap).toBe(4);
85+
expect(layout.height).toBe(28);
86+
}
87+
await page
88+
.locator('[data-sidebar-section="group:laptop"] summary')
89+
.screenshot({
90+
path: testInfo.outputPath("group-emoji-spacing.png"),
91+
});
6992
const row = section.locator('[data-channel-id="beta"]');
7093
await row.focus();
7194
await page.keyboard.press("Shift+F10");

0 commit comments

Comments
 (0)