From b74f7ff4c739f74e04370f8e7f1d2c3ab3de0a79 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 26 Nov 2026 11:41:32 +0000 Subject: [PATCH 1/2] test(studio): pin the title-row tenants outside studio-design, the counted accent and its dark scope; PageShell's row draws no lone hairline - S1: with no copilot served, the slot toggle ends the flow page's title row, not the top bar, and hides and shows the slot. - S2: PageShell's compact and list rows (and their embedded gate), the directory header and the diagnostics header end with Save and the assistant under Studio; controls outside Studio. - N1: two surfaces holding the accent on body, one unmounted, keep it. - N4: under the dark theme the surface root and body match the dark variant and carry the accent's dark declarations. - N3: PageShell passes `divider` from its own stats and actions. Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4 Co-authored-by: Claude --- .changeset/37520-pageshell-row-hairline.md | 10 ++ .../DiagnosticsPage.headerTone-12721.test.tsx | 50 ++++++++ ...oryPage.diagnosticsLinkTone-12768.test.tsx | 59 ++++++++- .../PageShell.narrowHeader-12306.test.tsx | 90 ++++++++++++- .../src/views/metadata-admin/PageShell.tsx | 9 +- ...tudioDesignSurface.graphite-37455.test.tsx | 118 ++++++++++++++++++ ...ignSurface.pillarsClaimSlot-12725.test.tsx | 45 +++++++ 7 files changed, 377 insertions(+), 4 deletions(-) create mode 100644 .changeset/37520-pageshell-row-hairline.md diff --git a/.changeset/37520-pageshell-row-hairline.md b/.changeset/37520-pageshell-row-hairline.md new file mode 100644 index 00000000000..6de7da5b4ff --- /dev/null +++ b/.changeset/37520-pageshell-row-hairline.md @@ -0,0 +1,10 @@ +--- +'@object-ui/app-shell': patch +--- + +fix(studio): a metadata page's title row with no buttons of its own draws no hairline before the AI assistant + +Clause-②: no +Metadata-protocol: none + +Under Studio, the AI assistant (or, with no assistant served, the right panel's show / hide button) ends every page's title row behind a thin divider that separates it from the page's own buttons. On a metadata list or item page with no stats and no buttons, that divider stood alone at the start of the group with nothing before it. It is now drawn only when the row has stats or buttons of its own, or while Save is shown, as the item header and the metadata directory already did. Outside Studio nothing changes. diff --git a/ui/packages/app-shell/src/views/metadata-admin/DiagnosticsPage.headerTone-12721.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/DiagnosticsPage.headerTone-12721.test.tsx index 2e3612e272a..32e5bef82d0 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/DiagnosticsPage.headerTone-12721.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/DiagnosticsPage.headerTone-12721.test.tsx @@ -11,6 +11,7 @@ * is read from the `/meta/diagnostics` envelope exactly as the page reads it. */ +import * as React from 'react'; import { describe, it, expect, vi, afterEach } from 'vitest'; import { render, screen, cleanup, fireEvent } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; @@ -31,6 +32,7 @@ vi.mock('./useMetadata', async (importActual) => { }); import { MetadataDiagnosticsPage } from './DiagnosticsPage'; +import { StudioTitleRowProvider } from '../studio-design/studioTitleRow'; afterEach(cleanup); @@ -105,3 +107,51 @@ describe('MetadataDiagnosticsPage header tone (objectui#12721)', () => { expect(screen.getByTestId('diagnostics-header-icon').getAttribute('class')).toMatch(/text-destructive/); }); }); + +// objectstack#37455 put the page's Save and the AI assistant at the end of the +// diagnostics title row under Studio; objectstack#37520 (S2) pins them there, +// after the severity switch and Refresh, behind a hairline. Stubs stand in for +// the surface's controls. +describe('MetadataDiagnosticsPage under Studio: the page controls end its title row (objectstack#37520)', () => { + const ASSISTANT = ( + + ); + + const titleRow = () => screen.getByRole('heading', { level: 1 }).parentElement as HTMLElement; + + it('the assistant is the row\'s last control, after Refresh, behind a hairline', async () => { + answer = () => envelope([]); + render( + + + + + , + ); + await screen.findByTestId('diagnostics-summary-badge'); + const row = titleRow(); + const ai = screen.getByTestId('topbar-ai-assistant'); + expect(row).toContainElement(ai); + expect(row).toContainElement(screen.getByRole('button', { name: 'Refresh' })); + expect(ai.previousElementSibling).toHaveAttribute('data-testid', 'studio-title-row-divider'); + // The row end is the row's last child: nothing comes after the assistant. + const end = row.lastElementChild as HTMLElement; + expect(end).toHaveAttribute('data-slot', 'studio-title-row-end'); + expect(end.lastElementChild).toBe(ai); + expect(screen.getAllByTestId('topbar-ai-assistant')).toHaveLength(1); + }); + + it('CONTROL: outside Studio the row ends with Refresh', async () => { + answer = () => envelope([]); + render( + + + , + ); + await screen.findByTestId('diagnostics-summary-badge'); + expect(titleRow().lastElementChild).toBe(screen.getByRole('button', { name: 'Refresh' })); + expect(screen.queryByTestId('topbar-ai-assistant')).toBeNull(); + }); +}); diff --git a/ui/packages/app-shell/src/views/metadata-admin/DirectoryPage.diagnosticsLinkTone-12768.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/DirectoryPage.diagnosticsLinkTone-12768.test.tsx index a2db13db0c4..4222ffdf192 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/DirectoryPage.diagnosticsLinkTone-12768.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/DirectoryPage.diagnosticsLinkTone-12768.test.tsx @@ -13,8 +13,9 @@ */ import '@testing-library/jest-dom/vitest'; +import * as React from 'react'; import { describe, it, expect, vi, afterEach } from 'vitest'; -import { render, screen, cleanup } from '@testing-library/react'; +import { render, screen, cleanup, within } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; import type { MetadataDiagnosticsSummary } from '@object-ui/data-objectstack'; import type { RichMetadataTypeEntry } from './useMetadata'; @@ -49,6 +50,7 @@ vi.mock('./useMetadata', async (importOriginal) => { }); import { MetadataDirectoryPage } from './DirectoryPage'; +import { StudioTitleRowProvider } from '../studio-design/studioTitleRow'; afterEach(() => { cleanup(); @@ -134,3 +136,58 @@ describe('DirectoryPage — the "View all issues" link takes the sweep\'s tone ( expect(screen.queryByRole('link', { name: /View all issues/ })).toBeNull(); }); }); + +// objectstack#37455 put the page's Save and the AI assistant at the end of the +// directory's title row under Studio; objectstack#37520 (S2) pins them there. +// The row has no actions of its own, so no hairline comes before the +// assistant unless Save does. Stubs stand in for the surface's controls. +describe('DirectoryPage under Studio: the page controls end its title row (objectstack#37520)', () => { + const SAVE = ( + + ); + const ASSISTANT = ( + + ); + + function renderUnderStudio(save: React.ReactNode) { + render( + + + + + , + ); + } + + const titleRow = () => screen.getByRole('heading', { level: 1 }).parentElement as HTMLElement; + const testIds = (el: Element) => + Array.from(el.querySelectorAll('[data-testid]')).map((n) => n.getAttribute('data-testid')); + + it('nothing unsaved: the assistant ends the title row, with no hairline before it', async () => { + answer = () => envelope([]); + renderUnderStudio(null); + await directoryLoaded(); + expect(testIds(titleRow())).toEqual(['topbar-ai-assistant']); + expect(screen.getAllByTestId('topbar-ai-assistant')).toHaveLength(1); + }); + + it('unsaved edits: Save, then the hairline, then the assistant', async () => { + answer = () => envelope([]); + renderUnderStudio(SAVE); + await directoryLoaded(); + expect(testIds(titleRow())).toEqual(['studio-save', 'studio-title-row-divider', 'topbar-ai-assistant']); + expect(within(titleRow()).getByRole('heading', { level: 1 })).toBeInTheDocument(); + }); + + it('CONTROL: outside Studio the title row holds the title alone', async () => { + answer = () => envelope([]); + renderDirectory(); + await directoryLoaded(); + expect(testIds(titleRow())).toEqual([]); + expect(screen.queryByTestId('topbar-ai-assistant')).toBeNull(); + }); +}); diff --git a/ui/packages/app-shell/src/views/metadata-admin/PageShell.narrowHeader-12306.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PageShell.narrowHeader-12306.test.tsx index 45bc6eaf7b7..9ce4dc3d3a4 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PageShell.narrowHeader-12306.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PageShell.narrowHeader-12306.test.tsx @@ -19,10 +19,12 @@ */ import '@testing-library/jest-dom/vitest'; +import * as React from 'react'; import { afterEach, describe, expect, it } from 'vitest'; -import { cleanup, render, screen } from '@testing-library/react'; +import { cleanup, render, screen, within } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; import { PageShell } from './PageShell'; +import { StudioTitleRowProvider } from '../studio-design/studioTitleRow'; afterEach(cleanup); @@ -105,3 +107,89 @@ describe('PageShell compact header wraps instead of squeezing the breadcrumb (ob expect(classes(actions)).not.toContain('shrink-0'); }); }); + +// objectstack#37455 put the page's Save and the AI assistant at the end of +// PageShell's rows under Studio; objectstack#37520 pins them there (S2) and +// the hairline before the assistant (N3). The surface hands the controls down +// through `StudioTitleRowProvider`; stubs stand in for them here. +const SAVE = ( + +); +const ASSISTANT = ( + +); + +function renderUnderStudio( + shell: Partial>, + save: React.ReactNode = null, +) { + render( + + + +
body
+
+
+
, + ); +} + +const testIds = (el: Element) => + Array.from(el.querySelectorAll('[data-testid]')).map((n) => n.getAttribute('data-testid')); + +const ACTION = ; + +describe('PageShell under Studio: the page controls end its rows (objectstack#37520)', () => { + it('the compact row: the page\'s actions, then Save, the hairline and the assistant, in the right-aligned group', () => { + renderUnderStudio({ itemName: 'showcase_contributor', actions: ACTION }, SAVE); + const meta = screen.getByTestId('page-shell-header-meta'); + const ai = within(meta).getByTestId('topbar-ai-assistant'); + const group = screen.getByTestId('page-action').parentElement as HTMLElement; + expect(group).toContainElement(ai); + expect(testIds(group)).toEqual(['page-action', 'studio-save', 'studio-title-row-divider', 'topbar-ai-assistant']); + expect(screen.getAllByTestId('topbar-ai-assistant')).toHaveLength(1); + }); + + it('an embedded compact row (a page inside another page) draws neither Save nor the assistant', () => { + renderUnderStudio({ itemName: 'showcase_contributor', actions: ACTION, embedded: true }, SAVE); + expect(screen.getByTestId('page-shell-header-meta')).toContainElement(screen.getByTestId('page-action')); + expect(screen.queryByTestId('studio-save')).toBeNull(); + expect(screen.queryByTestId('topbar-ai-assistant')).toBeNull(); + expect(screen.queryByTestId('studio-title-row-divider')).toBeNull(); + }); + + it('an embedded list row draws neither either', () => { + renderUnderStudio({ actions: ACTION, embedded: true }, SAVE); + expect(screen.getByTestId('page-action')).toBeInTheDocument(); + expect(screen.queryByTestId('studio-save')).toBeNull(); + expect(screen.queryByTestId('topbar-ai-assistant')).toBeNull(); + }); + + it.each([ + ['compact', { itemName: 'showcase_contributor' }], + ['list', {}], + ] as const)('N3 — a %s row with no stats, no actions and nothing unsaved: the assistant, no hairline before it', (_row, shell) => { + renderUnderStudio(shell); + expect(screen.getByTestId('topbar-ai-assistant')).toBeInTheDocument(); + expect(screen.queryByTestId('studio-title-row-divider')).toBeNull(); + }); + + it.each([ + ['compact', { itemName: 'showcase_contributor' }], + ['list', {}], + ] as const)('N3 CONTROL — a %s row with stats of its own: the hairline before the assistant', (_row, shell) => { + renderUnderStudio({ ...shell, stats: [{ label: 'Objects granted', value: 9 }] }); + const ai = screen.getByTestId('topbar-ai-assistant'); + expect(ai.previousElementSibling).toHaveAttribute('data-testid', 'studio-title-row-divider'); + }); + + it('N3 CONTROL — no actions but unsaved edits: Save, then the hairline, then the assistant', () => { + renderUnderStudio({ itemName: 'showcase_contributor' }, SAVE); + const ai = screen.getByTestId('topbar-ai-assistant'); + expect(testIds(ai.parentElement as HTMLElement)).toEqual(['studio-save', 'studio-title-row-divider', 'topbar-ai-assistant']); + }); +}); diff --git a/ui/packages/app-shell/src/views/metadata-admin/PageShell.tsx b/ui/packages/app-shell/src/views/metadata-admin/PageShell.tsx index 153da831eaa..6be3492eaf5 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PageShell.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PageShell.tsx @@ -242,6 +242,11 @@ export function PageShell({ // Setup catalog, not to the package-scoped Studio list of the same type. const [search] = useSearchParams(); const scopeSuffix = environmentScopeSuffix(search); + // objectstack#37520 (N3) — the hairline before the assistant separates it + // from the row's own stats and actions; a row with neither draws none, as + // the item header and the directory header already do (`StudioTitleRowEnd` + // still draws it before Save, which always counts as an action). + const rowHasOwnControls = (stats?.length ?? 0) > 0 || !!actions; return (
@@ -325,7 +330,7 @@ export function PageShell({ {/* objectstack#37455 — under Studio, the page's Save and the AI assistant end the title row (nothing elsewhere, nor embedded in another page). */} - {!embedded && } + {!embedded && }
@@ -382,7 +387,7 @@ export function PageShell({ ))} {actions} {/* objectstack#37455 — under Studio, the page's Save and the AI assistant end the title row. */} - {!embedded && } + {!embedded && } diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.graphite-37455.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.graphite-37455.test.tsx index 613d34bb141..dbe9f5f4e50 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.graphite-37455.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.graphite-37455.test.tsx @@ -19,6 +19,9 @@ */ import '@testing-library/jest-dom/vitest'; +import { readFileSync } from 'node:fs'; +import { dirname, resolve } from 'node:path'; +import { fileURLToPath } from 'node:url'; import * as React from 'react'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { cleanup, render, screen, waitFor } from '@testing-library/react'; @@ -78,6 +81,7 @@ import '@objectstack/lint'; import '@object-ui/plugin-detail'; import { StudioDesignSurface } from './StudioDesignSurface'; import { STUDIO_ACCENT, STUDIO_ACCENT_HSL } from './studio-tokens'; +import { useStudioAccentOnBody } from './studioAccent'; import { COMMAND_PALETTE_TESTID } from '../../context/CommandPaletteProvider'; const answer = (body: unknown) => ({ ok: true, status: 200, json: async () => body }); @@ -191,3 +195,117 @@ describe('a non-default app theme does not tint Studio (objectstack#37455)', () expect(document.documentElement.style.getPropertyValue('--primary')).toBe(primary); }); }); + +/** A component that holds Studio's accent on body while it is mounted, as each surface does. */ +function AccentHolder(): null { + useStudioAccentOnBody(); + return null; +} + +// objectstack#37520 (N1) — the accent is counted: two surfaces mounted at once +// (a route swap, StrictMode's second setup, a portalled second surface) hold +// it together, and it leaves body only with the last. A plain add / remove +// would strip it from under the surface still mounted. +describe('the accent on body is counted across surfaces (objectstack#37520)', () => { + function Pair({ first, second }: { first: boolean; second: boolean }): React.ReactElement { + return ( + <> + {first && } + {second && } + + ); + } + + it('two mounted, one unmounted: body keeps the accent; the last unmounted takes it off', () => { + const { rerender } = render(); + expect(carriesAccent(document.body)).toBe(true); + expect(document.body).toHaveAttribute('data-studio-accent'); + + rerender(); + expect(carriesAccent(document.body)).toBe(true); + expect(document.body).toHaveAttribute('data-studio-accent'); + + rerender(); + for (const cls of ACCENT_CLASSES) expect(document.body).not.toHaveClass(cls); + expect(document.body).not.toHaveAttribute('data-studio-accent'); + }); + + it('CONTROL: one mounted and unmounted leaves body as it found it', () => { + const { unmount } = render(); + expect(carriesAccent(document.body)).toBe(true); + unmount(); + for (const cls of ACCENT_CLASSES) expect(document.body).not.toHaveClass(cls); + expect(document.body).not.toHaveAttribute('data-studio-accent'); + }); +}); + +/** + * Tailwind's `dark:` variant as the app shell's stylesheet binds it: the + * selector a node must match for its `dark:` classes to apply. + */ +const HERE = dirname(fileURLToPath(import.meta.url)); +const DARK_VARIANT = (() => { + const css = readFileSync(resolve(HERE, '../../styles.css'), 'utf8'); + const m = /@custom-variant dark \(&(:where\([^)]*\))\);/.exec(css); + if (!m) throw new Error('styles.css binds no `dark:` variant this pin can read'); + return m[1]; +})(); + +/** + * Whether `node` matches the variant: `:where(a, b)` matches when any of its + * selectors does. Read one by one, because the DOM under test does not match + * a descendant combinator inside `:where()` (measured: `.dark *` matches body, + * `:where(.dark, .dark *)` does not). + */ +function matchesDarkVariant(node: Element): boolean { + const list = /^:where\((.*)\)$/.exec(DARK_VARIANT)?.[1] ?? ''; + return list.split(',').some((selector) => node.matches(selector.trim())); +} + +/** The accent's dark declarations, as classes: `dark:[--primary:220_9%_83%]` and the rest. */ +const DARK_ACCENT_CLASSES = ACCENT_CLASSES.filter((cls) => cls.startsWith('dark:')); +const darkClass = (token: string, hsl: string) => `dark:[${token}:${hsl.replace(/ /g, '_')}]`; + +// objectstack#37520 (N4) — dark mode, as far as the DOM can say it: jsdom +// computes no Tailwind, so the dark values are not read here (the PR's Chromium +// readings carry them, `studio-tokens.test.ts` holds the class string to the +// constants). What is pinned is the scope: under the app's dark theme (the +// `dark` class on the page root), the nodes that carry the accent, the +// surface's root and body, both match the `dark:` variant, and both carry its +// graphite declarations, so a portalled surface reads dark graphite too. +describe('dark theme: the accent\'s dark declarations apply on the surface root and on body (objectstack#37520)', () => { + afterEach(() => { + document.documentElement.classList.remove('dark'); + }); + + it('the dark variant binds to a `dark` class above the node', () => { + expect(DARK_VARIANT).toBe(':where(.dark, .dark *)'); + expect(DARK_ACCENT_CLASSES.length).toBeGreaterThan(0); + }); + + it('under the dark theme, the surface root and body match the variant and carry dark graphite', async () => { + document.documentElement.classList.add('dark'); + render(); + const header = await screen.findByTestId('studio-shell-header'); + const studioRoot = header.closest(ACCENT_SCOPE) as Element; + expect(studioRoot).not.toBeNull(); + expect(document.documentElement).toHaveClass('dark'); + for (const node of [studioRoot, document.body]) { + expect(matchesDarkVariant(node)).toBe(true); + for (const cls of DARK_ACCENT_CLASSES) expect(node).toHaveClass(cls); + expect(node).toHaveClass(darkClass('--primary', STUDIO_ACCENT_HSL.dark)); + expect(node).toHaveClass(darkClass('--ring', STUDIO_ACCENT_HSL.dark)); + } + }); + + it('CONTROL: under the light theme neither matches the variant, so the dark declarations do not apply', async () => { + render(); + const header = await screen.findByTestId('studio-shell-header'); + const studioRoot = header.closest(ACCENT_SCOPE) as Element; + expect(matchesDarkVariant(studioRoot)).toBe(false); + expect(matchesDarkVariant(document.body)).toBe(false); + // The accent still sits on both: only its light declarations apply. + expect(carriesAccent(studioRoot)).toBe(true); + expect(carriesAccent(document.body)).toBe(true); + }); +}); diff --git a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.pillarsClaimSlot-12725.test.tsx b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.pillarsClaimSlot-12725.test.tsx index 54c8fc9b957..e9d07bd642b 100644 --- a/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.pillarsClaimSlot-12725.test.tsx +++ b/ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.pillarsClaimSlot-12725.test.tsx @@ -442,3 +442,48 @@ describe('CONTROL — a pillar that claims nothing (objectui#12725)', () => { expect(slotProps()).toBeEmptyDOMElement(); }); }); + +// objectstack#37520 (S1) — with no copilot served, the title row's right-most +// icon is the slot's show / hide toggle, not the AI assistant. objectstack#37455 +// moved it from the top bar to the end of the open page's title row; the flow +// designer claims the slot from the start (its Configuration), so the toggle +// is drawn there with nothing selected. +describe('no copilot served: the slot\'s toggle ends the page\'s title row (objectstack#37520)', () => { + const toggle = () => screen.getByTestId('studio-slot-toggle'); + + it('in the page\'s title row, behind a hairline, not in the top bar; it hides and shows the slot', async () => { + copilot.available = false; + await openFlow(); + await waitFor(() => expect(slot()).toBeVisible()); + expect(slot()).toHaveAttribute('data-mode', 'props'); + + const button = await screen.findByTestId('studio-slot-toggle'); + expect(screen.getAllByTestId('studio-slot-toggle')).toHaveLength(1); + expect(within(screen.getByTestId('studio-shell-header')).queryByTestId('studio-slot-toggle')).toBeNull(); + expect(screen.getByTestId('studio-pillars-host')).toContainElement(button); + expect(slot().contains(button)).toBe(false); + // The last control of its row, the hairline right before it. + expect(button.parentElement?.lastElementChild).toBe(button); + expect(button.previousElementSibling).toHaveAttribute('data-testid', 'studio-title-row-divider'); + expect(screen.queryByTestId('topbar-ai-assistant')).toBeNull(); + + expect(button).toHaveAttribute('aria-pressed', 'true'); + expect(button).toHaveAccessibleName(t('engine.studio.slot.collapse', 'en')); + fireEvent.click(button); + expect(slot()).not.toBeVisible(); + expect(toggle()).toHaveAttribute('aria-pressed', 'false'); + expect(toggle()).toHaveAccessibleName(t('engine.studio.slot.expand', 'en')); + + fireEvent.click(toggle()); + expect(slot()).toBeVisible(); + expect(slot()).toHaveAttribute('data-mode', 'props'); + expect(toggle()).toHaveAttribute('aria-pressed', 'true'); + }); + + it('CONTROL: with a copilot served, the same row ends with the AI assistant and no toggle', async () => { + await openFlow(); + const ai = await screen.findByTestId('topbar-ai-assistant', undefined, SLOW); + expect(screen.getByTestId('studio-pillars-host')).toContainElement(ai); + expect(screen.queryByTestId('studio-slot-toggle')).toBeNull(); + }); +}); From fb89b42aad9dbaf72a9fed252d94c25b310698a6 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 26 Nov 2026 12:51:21 +0000 Subject: [PATCH 2/2] test(studio): pin the actions arm of PageShell's row divider guard A row with actions of its own and no stats (ResourceEditPage's embedded frame passes actions without `embedded`) draws the hairline before the assistant, on the compact and the list row. Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4 Co-authored-by: Claude --- .../PageShell.narrowHeader-12306.test.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ui/packages/app-shell/src/views/metadata-admin/PageShell.narrowHeader-12306.test.tsx b/ui/packages/app-shell/src/views/metadata-admin/PageShell.narrowHeader-12306.test.tsx index 9ce4dc3d3a4..2308a9c5179 100644 --- a/ui/packages/app-shell/src/views/metadata-admin/PageShell.narrowHeader-12306.test.tsx +++ b/ui/packages/app-shell/src/views/metadata-admin/PageShell.narrowHeader-12306.test.tsx @@ -187,6 +187,23 @@ describe('PageShell under Studio: the page controls end its rows (objectstack#37 expect(ai.previousElementSibling).toHaveAttribute('data-testid', 'studio-title-row-divider'); }); + // ResourceEditPage's embedded frame passes actions without `embedded`: the + // actions alone, with no stats and nothing unsaved, bring the hairline. + it.each([ + ['compact', { itemName: 'showcase_contributor' }], + ['list', {}], + ] as const)('N3 CONTROL — a %s row with actions of its own and no stats: the hairline before the assistant', (_row, shell) => { + renderUnderStudio({ ...shell, actions: ACTION }); + const ai = screen.getByTestId('topbar-ai-assistant'); + expect(screen.queryByTestId('studio-save')).toBeNull(); + expect(ai.previousElementSibling).toHaveAttribute('data-testid', 'studio-title-row-divider'); + expect(testIds(screen.getByTestId('page-action').parentElement as HTMLElement)).toEqual([ + 'page-action', + 'studio-title-row-divider', + 'topbar-ai-assistant', + ]); + }); + it('N3 CONTROL — no actions but unsaved edits: Save, then the hairline, then the assistant', () => { renderUnderStudio({ itemName: 'showcase_contributor' }, SAVE); const ai = screen.getByTestId('topbar-ai-assistant');