diff --git a/frontend/src/v2/__tests__/v2Primitives.test.tsx b/frontend/src/v2/__tests__/v2Primitives.test.tsx index 4486259e7..6438a2ff2 100644 --- a/frontend/src/v2/__tests__/v2Primitives.test.tsx +++ b/frontend/src/v2/__tests__/v2Primitives.test.tsx @@ -67,4 +67,23 @@ describe('D223 primitives', () => { expect(container.querySelector('details.v2p-disc')).not.toBeNull(); expect(container.querySelector('details.v2p-disc svg.chev path')?.getAttribute('d')).toBe('m6 9 6 6 6-6'); }); + + test('the Settings frame is built from v2p- primitives alone, in the artboard order', () => { + render(); + const frame = screen.getByTestId('v2p-settings-frame'); + const groups = Array.from(frame.querySelectorAll('.v2p-gtitle'), (n) => n.textContent); + expect(groups).toEqual(['Account', 'Access', 'Look']); + const classes = Array.from(frame.querySelectorAll('[class]')).flatMap((n) => Array.from(n.classList)); + expect(classes.filter((c) => c.startsWith('v2p-')).length).toBeGreaterThan(10); + expect(frame.querySelectorAll('details.v2p-disc')).toHaveLength(1); + }); + + test('the Settings frame fills its column to 760 and drops the value cell at 390', () => { + render(); + const frame = screen.getByTestId('v2p-settings-frame'); + expect(frame.style.width).toBe('100%'); + expect(frame.style.maxWidth).toBe('760px'); + expect(css).toMatch(/\.v2p-lrow \{ grid-template-columns: minmax\(0, 1fr\) auto;/); + expect(css).toMatch(/\.v2p-frame \.v2p-lrow \.vl[^}]*display: none/); + }); }); diff --git a/frontend/src/v2/primitives/V2PrimitivesPage.tsx b/frontend/src/v2/primitives/V2PrimitivesPage.tsx index 58305b742..60a6a8a90 100644 --- a/frontend/src/v2/primitives/V2PrimitivesPage.tsx +++ b/frontend/src/v2/primitives/V2PrimitivesPage.tsx @@ -1,5 +1,6 @@ import React from 'react'; import './primitives.css'; +import V2SettingsFrame from './V2SettingsFrame'; // TASK-730 (D223): the shared primitives rendered alone, so a surface can be // checked against the artboard frame without the shell around it. Served at @@ -21,6 +22,9 @@ const V2PrimitivesPage: React.FC = () => (
+
settings frame (d215 s-settings)
+ +
buttons
diff --git a/frontend/src/v2/primitives/V2SettingsFrame.tsx b/frontend/src/v2/primitives/V2SettingsFrame.tsx new file mode 100644 index 000000000..f76d4f2f5 --- /dev/null +++ b/frontend/src/v2/primitives/V2SettingsFrame.tsx @@ -0,0 +1,79 @@ +import React from 'react'; + +// TASK-730 (D223): the d215 Settings frame (#s-settings) rebuilt from the +// shared primitives alone. Same groups, rows and order as the artboard; the +// values are fixtures, so the structural diff is what this proves. +const seg = (items: string[], on: string, label: string) => ( +
+ {items.map((t) => ( + + ))} +
+); + +const V2SettingsFrame: React.FC = () => ( +
+
Account
+
+
+
alex-kim
+
@alex-kim · member
+
+ +
+
+
+
Email
+
[email]
+
+ +
+
+
+
Plan
+
Pro$12 a month
+
+
+
+ +
Access
+
+
+ + Devices + 1 CLI deviceused 1:21 AM + + +
alex-laptop · last used 1:21 AM
+
+
+
API token
+
None
+
+
+
+
Connectors
+
0 connected
+
+ +
+
+
+ +
Look
+
+
+
Language
+
+
{seg(['EN', '中文'], 'EN', 'Language')}
+
+
+
Theme
+
+
{seg(['Auto', 'Light', 'Dark'], 'Auto', 'Theme')}
+
+
+
+); + +export default V2SettingsFrame; diff --git a/frontend/src/v2/primitives/primitives.css b/frontend/src/v2/primitives/primitives.css index 4f8c63d70..62dfe5884 100644 --- a/frontend/src/v2/primitives/primitives.css +++ b/frontend/src/v2/primitives/primitives.css @@ -347,7 +347,10 @@ details.v2p-disc > summary .vl { font-size: 13.5px; color: var(--v2-ink-2); min- .v2p-ph { height: auto; min-height: 52px; flex-wrap: wrap; padding: 10px 14px; row-gap: 8px; } .v2p-ph h1 { font-size: 20px; white-space: normal; } .v2p-body { padding: 16px 14px; } - .v2p-lrow { grid-template-columns: minmax(0, 1fr); min-height: 48px; padding: 8px 12px; } + .v2p-lrow { grid-template-columns: minmax(0, 1fr) auto; min-height: 48px; padding: 8px 12px; } + /* d215's phone frame has no value cell: the label and the action carry the row. */ + .v2p-frame .v2p-lrow .vl, .v2p-frame details.v2p-disc > summary .vl { display: none; } + .v2p-frame details.v2p-disc > summary { grid-template-columns: minmax(0, 1fr) auto; } details.v2p-disc > summary { grid-template-columns: minmax(0, 1fr) auto auto; min-height: 48px; padding: 8px 12px; } .v2p-drawer:not(.v2p-drawer--inline) { width: 100%; border-radius: 0; } .v2p-cols { grid-template-columns: minmax(0, 1fr); }