Skip to content

Commit 960fdaa

Browse files
authored
fix(admin): keep responsive navigation left-aligned (CoreBunch#218)
1 parent 61fcebc commit 960fdaa

2 files changed

Lines changed: 15 additions & 8 deletions

File tree

src/admin/pages/site/toolbar/Toolbar.module.css

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,13 +286,6 @@
286286
padding: var(--space-4xs) var(--space-s);
287287
}
288288

289-
.siteName,
290-
.siteNameSkeleton,
291-
.siteFavicon,
292-
.workspaceToolbarItems {
293-
order: 1;
294-
}
295-
296289
.siteName {
297290
max-width: 104px;
298291
margin-right: var(--space-4xs);
@@ -320,7 +313,6 @@
320313

321314
.adminLink,
322315
.activeSection {
323-
order: 2;
324316
justify-content: center;
325317
width: 30px;
326318
min-width: 30px;

tests/e2e/admin-navigation.e2e.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ test.describe('admin navigation', () => {
113113
page.getByTestId('account-menu-trigger'),
114114
'mobile toolbar account menu trigger',
115115
)
116+
await expectNavigationBeforeToolbarTrailer(page)
116117
})
117118
})
118119

@@ -508,6 +509,20 @@ async function expectLocatorContained(
508509
expect(box.x + box.width).toBeLessThanOrEqual(viewportWidth + 1)
509510
}
510511

512+
async function expectNavigationBeforeToolbarTrailer(page: Page): Promise<void> {
513+
const toolbar = page.getByTestId('toolbar')
514+
const navigationBox = await toolbar.getByRole('link', { name: 'Site' }).boundingBox()
515+
const settingsBox = await toolbar.getByTestId('toolbar-settings-btn').boundingBox()
516+
if (!navigationBox || !settingsBox) {
517+
throw new Error('mobile toolbar navigation or settings button had no bounding box')
518+
}
519+
520+
const navigationPrecedesSettings =
521+
navigationBox.y < settingsBox.y ||
522+
(Math.abs(navigationBox.y - settingsBox.y) <= 1 && navigationBox.x < settingsBox.x)
523+
expect(navigationPrecedesSettings).toBe(true)
524+
}
525+
511526
async function expectStoredWorkspaceLayout(
512527
page: Page,
513528
expected: {

0 commit comments

Comments
 (0)