Skip to content

Commit 8449096

Browse files
authored
feat(size/M):UI improvements - Changed the placement of opencollection and theme toggle button (#129)
* Changed the placement of opencollection and theme toggle button * Fix E2E test cases * Improved E2E test cases and UI chnages * UI fixes * Comments addressed * Comments addressed * E2E improvement comments addressed
1 parent d926e0d commit 8449096

20 files changed

Lines changed: 124 additions & 154 deletions

File tree

‎packages/oc-docs/e2e/components/sidebar.component.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export class SidebarComponent extends BaseComponent {
66
readonly inline = this.page.getByTestId('app-sidebar');
77
readonly overview = this.page.getByTestId('sidebar-overview');
88
readonly environments = this.page.getByTestId('sidebar-environments');
9-
readonly footer = this.page.getByTestId('sidebar-footer');
109
readonly collapseButton = this.page.getByTestId('sidebar-collapse');
1110
readonly expandButton = this.page.getByTestId('sidebar-expand');
1211
readonly drawer = this.page.getByTestId('sidebar-drawer');

‎packages/oc-docs/e2e/tests/layout/page-header.spec.ts‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { test, expect } from '../../playwright';
22

33
/**
4-
* The page header (sticky top navigation bar): brand cluster + Open-in-Bruno
5-
* CTA. These tests cover what the mounted app actually renders — the search and
6-
* env-switcher slots ship empty here, so they aren't exercised in this suite.
4+
* The page header (sticky top navigation bar): brand cluster, Open-in-Bruno
5+
* CTA and theme toggle. These tests cover what the mounted app actually
6+
* renders — the search and env-switcher slots ship empty here, so they aren't
7+
* exercised in this suite.
78
*/
89
test.use({ colorScheme: 'light' });
910

@@ -22,7 +23,7 @@ test.describe('Page header', () => {
2223
// Sticky: header stays at the top after the page scrolls.
2324
await page.mouse.wheel(0, 600);
2425
const box = await pageHeader.root.boundingBox();
25-
if (!box) throw new Error('header has no bounding box');
26+
if (box === null) throw new Error('header has no bounding box');
2627
expect(box.y).toBeLessThanOrEqual(1);
2728
});
2829

@@ -35,7 +36,14 @@ test.describe('Page header', () => {
3536
await expect(pageHeader.brandInitials).toHaveText('BT');
3637
});
3738

38-
test('Open-in-Bruno CTA links to the Fetch-in-Bruno page (new tab) and is pinned right', async ({ page, pageHeader }) => {
39+
test('shows the theme toggle in the header', async ({ page, themeToggle }) => {
40+
await page.setViewportSize(DESKTOP);
41+
await page.goto('/');
42+
43+
await expect(themeToggle.button).toBeVisible();
44+
});
45+
46+
test('shows the Open-in-Bruno CTA linking to Fetch-in-Bruno when the collection has a git url', async ({ page, pageHeader }) => {
3947
await page.setViewportSize(DESKTOP);
4048
await page.goto('/');
4149

@@ -44,13 +52,6 @@ test.describe('Page header', () => {
4452
expect(href).toMatch(/^https:\/\/fetch\.usebruno\.com\?url=/);
4553
expect(await pageHeader.openInBruno.getAttribute('target')).toBe('_blank');
4654
expect(await pageHeader.openInBruno.getAttribute('rel')).toContain('noopener');
47-
48-
// CTA hugs the right edge (within the 20px bar padding), not the brand.
49-
const headerBox = await pageHeader.root.boundingBox();
50-
const ctaBox = await pageHeader.openInBruno.boundingBox();
51-
const brandBox = await pageHeader.brand.boundingBox();
52-
expect((headerBox!.x + headerBox!.width) - (ctaBox!.x + ctaBox!.width)).toBeLessThanOrEqual(24);
53-
expect(ctaBox!.x).toBeGreaterThan(brandBox!.x + brandBox!.width + 100);
5455
});
5556

5657
test('mobile condenses: hamburger shows, Open-in-Bruno becomes a glyph, brand compact', async ({ page, pageHeader }) => {

‎packages/oc-docs/e2e/tests/sidebar/sidebar.spec.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ const MOBILE = { width: 390, height: 800 };
77
test.describe('sidebar - desktop (inline, collapsible)', () => {
88
test.use({ viewport: DESKTOP });
99

10-
test('renders inline with the overview link and a pinned footer, no hamburger or drawer', async ({ page, sidebar }) => {
10+
test('renders inline with the overview link, no hamburger or drawer', async ({ page, sidebar }) => {
1111
await page.goto(FOLDERS);
1212
await expect(sidebar.inline).toBeVisible();
1313
await expect(sidebar.overview).toBeVisible();
14-
await expect(sidebar.footer).toBeVisible();
15-
await expect(sidebar.footer).toContainText('Powered by');
1614
await expect(sidebar.hamburger).toHaveCount(0);
1715
await expect(sidebar.drawer).toHaveCount(0);
1816
});

‎packages/oc-docs/src/assets/OpenCollectionWordmark.tsx‎

Lines changed: 0 additions & 32 deletions
This file was deleted.

‎packages/oc-docs/src/components/AppShell/AppShell.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { useLocation } from 'react-router-dom';
33
import Topbar from '../Topbar/Topbar';
44
import EnvSwitcher from '../EnvSwitcher/EnvSwitcher';
55
import ShowVarsToggle from '../ShowVarsToggle/ShowVarsToggle';
6+
import ThemeToggle from '../ThemeToggle/ThemeToggle';
67
import Sidebar from '../Docs/Sidebar/Sidebar';
78
import SidebarDrawer from '../SidebarDrawer/SidebarDrawer';
89
import IconButton from '../../ui/IconButton/IconButton';
@@ -120,6 +121,7 @@ const AppShell: React.FC<AppShellProps> = ({ logo, testId = 'app-shell' }) => {
120121
</>
121122
}
122123
openInBrunoHref={buildFetchInBrunoUrl(gitCollectionUrl)}
124+
themeToggleSlot={<ThemeToggle />}
123125
/>
124126

125127
<div className="appshell-main">

‎packages/oc-docs/src/components/Docs/Sidebar/Sidebar.tsx‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React, { useEffect, useMemo, useRef } from 'react';
22
import { useLocation } from 'react-router-dom';
33
import SidebarNavLink from './SidebarNavLink/SidebarNavLink';
44
import SidebarTree from './SidebarTree/SidebarTree';
5-
import SidebarFooter from './SidebarFooter/SidebarFooter';
65
import { CubeIcon, GlobeIcon } from '../../../assets/icons';
76
import { StyledWrapper } from './StyledWrapper';
87
import { computeAutoReveal } from './autoReveal';
@@ -105,8 +104,6 @@ const Sidebar: React.FC<SidebarProps> = ({ onNavigate, testId = 'sidebar' }) =>
105104
/>
106105
) : null}
107106
</div>
108-
109-
<SidebarFooter />
110107
</StyledWrapper>
111108
);
112109
};

‎packages/oc-docs/src/components/Docs/Sidebar/SidebarFooter/SidebarFooter.spec.tsx‎

Lines changed: 0 additions & 31 deletions
This file was deleted.

‎packages/oc-docs/src/components/Docs/Sidebar/SidebarFooter/SidebarFooter.tsx‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎packages/oc-docs/src/components/Docs/Sidebar/SidebarFooter/StyledWrapper.ts‎

Lines changed: 0 additions & 33 deletions
This file was deleted.

‎packages/oc-docs/src/components/KeyValueTable/KeyValueTable.css‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@
217217
min-width: 0;
218218
}
219219

220+
.key-value-table .col-value .secret-value {
221+
padding: 0.625rem;
222+
}
223+
220224
.key-value-table .value-cell-trailing {
221225
flex: none;
222226
display: flex;

0 commit comments

Comments
 (0)