Skip to content

Commit 6d88e59

Browse files
committed
test(console): the floating record drawer keeps its own radius
The record drawer is a floating card that sets sm:rounded-xl; the pin now proves the console's dialog corner rule does not match it, so its own radius wins. The changeset no longer lists it among the square drawers. Claude-Session: https://claude.ai/code/session_01L6bhgWpXbemoAH9WZiykjb Co-authored-by: Claude <noreply@anthropic.com>
1 parent e4f0273 commit 6d88e59

2 files changed

Lines changed: 39 additions & 1 deletion

File tree

‎.changeset/35411-edge-sheet-square-corners.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ fix(console): full-height edge drawers have square corners
77
Clause-②: no
88
Metadata-protocol: none
99

10-
- The console stylesheet gave every dialog surface a 1.25rem corner radius, which also rounded the left and right drawers (the notification center, the record drawer, the side form drawer and every other full-height Sheet). Those drawers sit against the top, side and bottom of the window, so the rounding showed as a notch at their inner corners. The rule now skips full-height edge sheets; they render with square corners. Centred dialogs and bottom sheets keep the rounded corners. Drawer width, animation and content are unchanged.
10+
- The console stylesheet gave every dialog surface a 1.25rem corner radius, which also rounded the left and right drawers (the notification center, the side form drawer and every other full-height Sheet). Those drawers sit against the top, side and bottom of the window, so the rounding showed as a notch at their inner corners. The rule now skips full-height edge sheets; they render with square corners. The record drawer, a floating card, now shows its own corner radius instead of the global one. Centred dialogs and bottom sheets keep the rounded corners. Drawer width, animation and content are unchanged.

‎ui/apps/console/src/__tests__/edgeSheetSquareCorners-35411.test.tsx‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
* edge variants by the `inset-y-0` class their variant carries, while centred
99
* dialogs and bottom sheets keep the radius.
1010
*
11+
* The record drawer is the exception: it is a floating card (objectstack#35854)
12+
* that sets its own radius, so the global rule must not override it either.
13+
*
1114
* The selector is read from the shipped stylesheet and matched against the DOM
1215
* the real primitives render, so a change to either side is seen here.
1316
*/
@@ -20,6 +23,7 @@ import {
2023
Dialog,
2124
DialogContent,
2225
DialogTitle,
26+
NavigationOverlay,
2327
Sheet,
2428
SheetContent,
2529
SheetTitle,
@@ -79,3 +83,37 @@ describe('edge sheets are not rounded by the dialog corner rule (#35411)', () =>
7983
expect(screen.getByRole('dialog').matches(roundingSelector())).toBe(true);
8084
});
8185
});
86+
87+
describe('the record drawer keeps its own floating-card radius (#35411, #35854)', () => {
88+
// Renders the real NavigationOverlay drawer. Its own radius is asserted on
89+
// the className it ships: the test DOM has no compiled Tailwind, so the
90+
// utility's computed value is not readable here.
91+
function renderRecordDrawer(): HTMLElement {
92+
render(
93+
<NavigationOverlay
94+
isOpen
95+
isOverlay
96+
selectedRecord={{ id: 'r1' }}
97+
mode="drawer"
98+
close={() => {}}
99+
setIsOpen={() => {}}
100+
title="Lead"
101+
width="720px"
102+
mainContent={<div />}
103+
>
104+
{() => <div>record body</div>}
105+
</NavigationOverlay>,
106+
);
107+
return screen.getByRole('dialog', { name: 'Lead' });
108+
}
109+
110+
it('is not matched by the global rounding rule', () => {
111+
const card = renderRecordDrawer();
112+
expect(card.hasAttribute('data-record-drawer-card')).toBe(true);
113+
expect(card.matches(roundingSelector())).toBe(false);
114+
});
115+
116+
it('carries its own radius class', () => {
117+
expect(renderRecordDrawer().className.split(/\s+/)).toContain('sm:rounded-xl');
118+
});
119+
});

0 commit comments

Comments
 (0)