Skip to content

chore: VR improvements #3374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 54 commits into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
dd9f9bc
apply second direction for vr improvements
at-susie Mar 25, 2025
565c282
Merge branch 'main' into implement-vr-improvements
at-susie Mar 25, 2025
8d93a35
Merge branch 'main' into implement-vr-improvements
at-susie Mar 26, 2025
647d7c8
update with consolidated tech strategy
at-susie Mar 26, 2025
eabd377
move visual context to inner part
at-susie Mar 28, 2025
99adad6
Merge branch 'main' into implement-vr-improvements
at-susie Mar 31, 2025
565543a
update snapshot
at-susie Mar 31, 2025
c5080e1
fix inlineLabelText background issue
at-susie Apr 2, 2025
76db14b
resolve conflicts
at-susie Apr 2, 2025
9f92b3e
Merge branch 'main' into implement-vr-improvements
at-susie Apr 2, 2025
680940e
fix inline label background issue
at-susie Apr 2, 2025
f5257fa
Merge branch 'implement-vr-improvements' of https://github.com/clouds…
at-susie Apr 2, 2025
988d047
update snapshots
at-susie Apr 2, 2025
ccabeae
Temporarly increase package size limit for exploration
at-susie Apr 2, 2025
c4ba38b
apply second direction for vr improvements
at-susie Mar 25, 2025
c20087a
update with consolidated tech strategy
at-susie Mar 26, 2025
2b9a4a4
move visual context to inner part
at-susie Mar 28, 2025
6ba6839
fix inlineLabelText background issue
at-susie Apr 2, 2025
d2fd93e
fix inline label background issue
at-susie Apr 2, 2025
e9e2bdb
update snapshots
at-susie Apr 2, 2025
24552e6
Temporarly increase package size limit for exploration
at-susie Apr 2, 2025
116e903
chore: Stroke adjustment
at-susie Apr 3, 2025
543b59a
update snapshot
at-susie Apr 3, 2025
122ab5c
resolve conflicts
at-susie Apr 3, 2025
a2de946
update snapshots
at-susie Apr 3, 2025
a8f4d36
Merge branch 'main' into implement-vr-improvements
at-susie Apr 4, 2025
495dead
update snapshot
at-susie Apr 7, 2025
beb3451
update design-tokens.test.ts.snap
at-susie Apr 7, 2025
680ac68
Merge branch 'main' into implement-vr-improvements
at-susie Apr 10, 2025
b8e5314
update snapshot
at-susie Apr 10, 2025
6e13301
replace a border width constant with new border tokens
at-susie Apr 10, 2025
141daa6
Merge branch 'main' into implement-vr-improvements
at-susie Apr 10, 2025
efbffe4
Merge branch 'main' into implement-vr-improvements
at-susie Apr 10, 2025
ee17b6e
update borderWidthField value to 1px
at-susie Apr 11, 2025
20b0bc3
Merge branch 'main' into implement-vr-improvements
at-susie Apr 11, 2025
250e35f
update integration tests with main
at-susie Apr 11, 2025
8a8f57c
update snapshot tests
at-susie Apr 11, 2025
545ef5f
Merge branch 'main' into implement-vr-improvements
at-susie Apr 11, 2025
552b4dd
Merge branch 'main' into implement-vr-improvements
at-susie Apr 14, 2025
b196c47
Merge branch 'main' into implement-vr-improvements
at-susie Apr 14, 2025
944a8bf
make segmented control stroke width 1px too
at-susie Apr 14, 2025
cca119b
update to have pixel perfect radio stroke width
at-susie Apr 14, 2025
da710ca
clean up demo pages and added a default one
at-susie Apr 14, 2025
212202c
Merge branch 'main' into implement-vr-improvements
at-susie Apr 14, 2025
ba3c6be
Merge branch 'implement-vr-improvements' of https://github.com/clouds…
at-susie Apr 14, 2025
15d30b8
update the token stroke width for property filter
at-susie Apr 14, 2025
d52ab09
Merge branch 'main' into implement-vr-improvements
at-susie Apr 17, 2025
c89743d
update a value that was hard-coded
at-susie Apr 17, 2025
197287f
remove parentTokens from toolbar visual context definition and adjust…
at-susie Apr 17, 2025
34944f3
update the expected value based on the prompt-input border width change
at-susie Apr 17, 2025
c2e9d6c
fix issues found in bug-bash - code editor border width and striped r…
at-susie Apr 17, 2025
d052874
Merge branch 'main' into implement-vr-improvements
at-susie Apr 22, 2025
c409a91
add an additional :not pseudo to striped divider for last-row
at-susie Apr 22, 2025
b02f890
Merge branch 'implement-vr-improvements' of https://github.com/clouds…
at-susie Apr 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
233 changes: 29 additions & 204 deletions pages/app-layout-toolbar/default.page.tsx
Original file line number Diff line number Diff line change
@@ -1,213 +1,38 @@
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import React, { useContext, useRef, useState } from 'react';
import React from 'react';

import {
AppLayoutToolbar,
Button,
ContentLayout,
Header,
HelpPanel,
Link,
SpaceBetween,
SplitPanel,
Toggle,
} from '~components';
import { AppLayoutToolbarProps } from '~components/app-layout-toolbar';
import AppLayoutToolbar from '~components/app-layout-toolbar';
import Header from '~components/header';

import AppContext, { AppContextType } from '../app/app-context';
import { Breadcrumbs, Containers, CustomDrawerContent, Navigation } from '../app-layout/utils/content-blocks';
import { drawerLabels } from '../app-layout/utils/drawers';
import appLayoutLabels from '../app-layout/utils/labels';

type DemoContext = React.Context<
AppContextType<{
navigationTriggerHide: boolean | undefined;
drawerTriggerHide: boolean | undefined;
splitPanelTriggerHide: boolean | undefined;
breadcrumbsHide: boolean | undefined;
splitPanelPosition: AppLayoutToolbarProps.SplitPanelPreferences['position'];
}>
>;

export default function WithDrawers() {
const [activeDrawerId, setActiveDrawerId] = useState<string | null>(null);
const [helpPathSlug, setHelpPathSlug] = useState<string>('default');
const { urlParams, setUrlParams } = useContext(AppContext as DemoContext);
const navigationTriggerHide = urlParams.navigationTriggerHide ?? false;
const drawerTriggerHide = urlParams.drawerTriggerHide ?? false;
const splitPanelTriggerHide = urlParams.splitPanelTriggerHide ?? false;
const breadcrumbsHide = urlParams.breadcrumbsHide ?? false;
const [isToolsOpen, setIsToolsOpen] = useState(false);
const [isNavigationOpen, setIsNavigationOpen] = useState(true);
const [splitPanelOpen, setSplitPanelOpen] = useState(false);
const pageLayoutRef = useRef<AppLayoutToolbarProps.Ref>(null);

const drawersProps: Pick<AppLayoutToolbarProps, 'activeDrawerId' | 'onDrawerChange' | 'drawers'> | null = {
activeDrawerId: activeDrawerId,
drawers: [
{
ariaLabels: {
closeButton: 'ProHelp close button',
drawerName: 'ProHelp drawer content',
triggerButton: 'ProHelp trigger button',
resizeHandle: 'ProHelp resize handle',
},
content: <CustomDrawerContent />,
id: 'pro-help',
trigger: drawerTriggerHide
? undefined
: {
iconName: 'contact',
},
},
],
onDrawerChange: event => {
setActiveDrawerId(event.detail.activeDrawerId);
},
};
import { Breadcrumbs, Containers, Navigation, Tools } from '../app-layout/utils/content-blocks';
import labels from '../app-layout/utils/labels';
import * as toolsContent from '../app-layout/utils/tools-content';
import ScreenshotArea from '../utils/screenshot-area';

export default function () {
return (
<AppLayoutToolbar
ariaLabels={{ ...appLayoutLabels, ...drawerLabels }}
breadcrumbs={breadcrumbsHide ? undefined : <Breadcrumbs />}
ref={pageLayoutRef}
content={
<ContentLayout
disableOverlap={true}
header={
<SpaceBetween size="m">
<Header
variant="h1"
description="Sometimes you need custom triggers for drawers and navigation to get the job done."
info={
<Link
data-testid="info-link-header"
variant="info"
onFollow={() => {
setHelpPathSlug('header');
setIsToolsOpen(true);
pageLayoutRef.current?.focusToolsClose();
}}
>
Info
</Link>
}
>
Page layout
<ScreenshotArea gutters={false}>
<AppLayoutToolbar
ariaLabels={labels}
analyticsMetadata={{
flowType: 'home',
instanceIdentifier: 'demo-page',
}}
breadcrumbs={<Breadcrumbs />}
navigation={<Navigation />}
tools={<Tools>{toolsContent.long}</Tools>}
content={
<>
<div style={{ marginBlockEnd: '1rem' }}>
<Header variant="h1" description="Basic demo">
Demo page
</Header>

<SpaceBetween size="xs">
<Toggle
checked={navigationTriggerHide}
onChange={({ detail }) => setUrlParams({ navigationTriggerHide: detail.checked })}
>
Hide navigation trigger
</Toggle>
<Toggle
checked={drawerTriggerHide}
onChange={({ detail }) => setUrlParams({ drawerTriggerHide: detail.checked })}
>
Hide drawer trigger
</Toggle>
<Toggle
checked={splitPanelTriggerHide}
onChange={({ detail }) => setUrlParams({ splitPanelTriggerHide: detail.checked })}
>
Hide split panel trigger
</Toggle>
<Toggle
checked={breadcrumbsHide}
onChange={({ detail }) => setUrlParams({ breadcrumbsHide: detail.checked })}
>
Hide breadcrumbs
</Toggle>

<Button
onClick={() => {
setIsNavigationOpen(current => !current);
pageLayoutRef.current?.focusNavigation();
}}
>
Toggle navigation
</Button>

<Button
onClick={() => {
setActiveDrawerId('pro-help');
pageLayoutRef.current?.focusActiveDrawer();
}}
>
Open a drawer without trigger
</Button>
<Button onClick={() => setActiveDrawerId(null)}>Close a drawer without trigger</Button>
<Button onClick={() => setSplitPanelOpen(true)}>Open split panel</Button>
</SpaceBetween>
</SpaceBetween>
}
>
<Header
info={
<Link
data-testid="info-link-content"
variant="info"
onFollow={() => {
setHelpPathSlug('content');
setIsToolsOpen(true);
}}
>
Info
</Link>
}
>
Content
</Header>
<Containers />
</ContentLayout>
}
splitPanel={
<SplitPanel
closeBehavior={splitPanelTriggerHide ? 'hide' : undefined}
header="Split panel header"
i18nStrings={{
preferencesTitle: 'Preferences',
preferencesPositionLabel: 'Split panel position',
preferencesPositionDescription: 'Choose the default split panel position for the service.',
preferencesPositionSide: 'Side',
preferencesPositionBottom: 'Bottom',
preferencesConfirm: 'Confirm',
preferencesCancel: 'Cancel',
closeButtonAriaLabel: 'Close panel',
openButtonAriaLabel: 'Open panel',
resizeHandleAriaLabel: 'Slider',
}}
>
This is the Split Panel!
</SplitPanel>
}
splitPanelOpen={splitPanelOpen}
splitPanelPreferences={{
position: urlParams.splitPanelPosition,
}}
onSplitPanelToggle={event => setSplitPanelOpen(event.detail.open)}
onSplitPanelPreferencesChange={event => {
const { position } = event.detail;
setUrlParams({ splitPanelPosition: position === 'side' ? position : undefined });
}}
onToolsChange={event => {
setIsToolsOpen(event.detail.open);
}}
tools={<Info helpPathSlug={helpPathSlug} />}
toolsOpen={isToolsOpen}
navigationOpen={isNavigationOpen}
navigation={<Navigation />}
onNavigationChange={event => setIsNavigationOpen(event.detail.open)}
navigationTriggerHide={navigationTriggerHide}
{...drawersProps}
/>
</div>
<Containers />
</>
}
/>
</ScreenshotArea>
);
}

function Info({ helpPathSlug }: { helpPathSlug: string }) {
return <HelpPanel header={<h2>Info</h2>}>Here is some info for you: {helpPathSlug}</HelpPanel>;
}
3 changes: 1 addition & 2 deletions pages/app-layout-toolbar/full-page-cards.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Header from '~components/header';
import Link from '~components/link';

import * as toolsContent from '../app-layout//utils/tools-content';
import { Breadcrumbs, Footer, Navigation, Notifications, Tools } from '../app-layout/utils/content-blocks';
import { Breadcrumbs, Navigation, Notifications, Tools } from '../app-layout/utils/content-blocks';
import labels from '../app-layout/utils/labels';
import ScreenshotArea from '../utils/screenshot-area';

Expand Down Expand Up @@ -104,7 +104,6 @@ export default function () {
/>
}
/>
<Footer legacyConsoleNav={false} />
</ScreenshotArea>
);
}
3 changes: 1 addition & 2 deletions pages/app-layout-toolbar/full-page-table.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React, { useContext, useState } from 'react';
import { AppLayoutToolbar, Button, Header, Link, Select, Table } from '~components';

import AppContext, { AppContextType } from '../app/app-context';
import { Breadcrumbs, Footer, Navigation, Notifications, Tools } from '../app-layout/utils/content-blocks';
import { Breadcrumbs, Navigation, Notifications, Tools } from '../app-layout/utils/content-blocks';
import labels from '../app-layout/utils/labels';
import * as toolsContent from '../app-layout/utils/tools-content';
import { generateItems, Instance } from '../table/generate-data';
Expand Down Expand Up @@ -81,7 +81,6 @@ export default function () {
/>
}
/>
<Footer legacyConsoleNav={false} />
</ScreenshotArea>
);
}
Loading
Loading