Skip to content

Commit 128f890

Browse files
committed
fix monitoring settings layout spacing
1 parent e5add05 commit 128f890

3 files changed

Lines changed: 36 additions & 2 deletions

File tree

packages/web/src/styles/components.css

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,11 @@
997997
padding: var(--sp-4);
998998
}
999999

1000+
.settings-content--fill-height > .settings-content-surface--monitoring-dense {
1001+
flex: 0 0 auto;
1002+
min-height: 100%;
1003+
}
1004+
10001005
.settings-section {
10011006
max-width: 720px;
10021007
min-width: 0;
@@ -1675,6 +1680,11 @@
16751680
padding: var(--sp-3);
16761681
}
16771682

1683+
.monitoring-tree,
1684+
.monitoring-detail {
1685+
padding: var(--sp-3);
1686+
}
1687+
16781688
.monitoring-card__header {
16791689
display: flex;
16801690
align-items: flex-start;
@@ -16504,7 +16514,7 @@ body.is-dragging-pane .session-action-btn-drag {
1650416514
.workspace-search-panel__details--collapsed {
1650516515
min-height: 23px;
1650616516
align-items: center;
16507-
justify-items: start;
16517+
justify-items: end;
1650816518
}
1650916519

1651016520
.workspace-search-panel__details--collapsed .workspace-search-panel__filter--details {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3398,7 +3398,7 @@ describe("components.css theme-sensitive surfaces", () => {
33983398
expect(searchFilterDetails).toContain("background: transparent");
33993399
expect(searchInlineIcon).toContain("width: 11px");
34003400
expect(searchDetails).toContain("justify-items: stretch");
3401-
expect(searchDetailsCollapsed).toContain("justify-items: start");
3401+
expect(searchDetailsCollapsed).toContain("justify-items: end");
34023402
expect(searchDetailsCollapsed).toContain("align-items: center");
34033403
expect(searchDetailHeading).toContain("justify-content: space-between");
34043404
expect(searchDetailHeading).toContain("width: 100%");

packages/web/src/styles/monitoring.guard.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ const rawMonitoringFontSizePattern =
1111
const rawMonitoringRadiusPattern =
1212
/border-radius:\s*(?:\d+px|999px|9999px|\d+%|calc\([^)]*\d+px[^)]*\))/;
1313

14+
function escapeRegExp(value: string) {
15+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
16+
}
17+
18+
function getRuleBlock(selector: string) {
19+
const pattern = new RegExp(`${escapeRegExp(selector)}\\s*\\{([^}]*)\\}`);
20+
return componentsStyles.match(pattern)?.[1] ?? "";
21+
}
22+
1423
function getMonitoringOffenderBlocks(pattern: RegExp) {
1524
return Array.from(componentsStyles.matchAll(/([^{}]+)\{([^}]*)\}/g))
1625
.map((match) => ({
@@ -36,4 +45,19 @@ describe("monitoring style guardrails", () => {
3645
expect(componentsStyles).toMatch(rawMonitoringRadiusPattern);
3746
expect(getMonitoringOffenderBlocks(rawMonitoringRadiusPattern)).toEqual([]);
3847
});
48+
49+
it("lets the dense settings monitoring surface grow with dashboard content", () => {
50+
const denseFillHeightRule = getRuleBlock(
51+
".settings-content--fill-height > .settings-content-surface--monitoring-dense"
52+
);
53+
54+
expect(denseFillHeightRule).toContain("flex: 0 0 auto");
55+
expect(denseFillHeightRule).toContain("min-height: 100%");
56+
});
57+
58+
it("keeps monitoring data panels padded away from their borders", () => {
59+
const panelRule = getRuleBlock(".monitoring-tree,\n.monitoring-detail");
60+
61+
expect(panelRule).toContain("padding: var(--sp-3)");
62+
});
3963
});

0 commit comments

Comments
 (0)