Skip to content
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

PageHeader: Address dom order issues (screen reader experience feedback from sign-off) #3816

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
efb73be
initial
broccolinisoup Apr 11, 2023
ac2ad6c
make the examples as close as possible to dotcom usages
broccolinisoup Apr 12, 2023
95f91a4
Merge branch 'main' into pageheader-sign-off-fixes
broccolinisoup May 24, 2023
da177ce
remove console.log
broccolinisoup May 24, 2023
1a17796
pair with mike
broccolinisoup Jun 1, 2023
ac91b76
Merge branch 'main' into pageheader-sign-off-fixes
broccolinisoup Oct 12, 2023
5624273
lint
broccolinisoup Oct 13, 2023
c3e5b59
remove console log
broccolinisoup Oct 13, 2023
abf32a2
Revert "pair with mike"
broccolinisoup Oct 13, 2023
df52355
"Address dom order issues - pair with mike"
broccolinisoup Oct 13, 2023
1ec1f8e
test(vrt): update snapshots
broccolinisoup Oct 13, 2023
1803f4e
Merge branch 'pageheader-sign-off-fixes' into pageheader-sign-off-fix…
broccolinisoup Oct 16, 2023
ef3fce1
seperate title area into its own components
broccolinisoup Oct 17, 2023
0a78cb3
use grid to to keep the element visually in the same order but update…
broccolinisoup Oct 19, 2023
14a272c
Merge branch 'main' into pageheader-sign-off-fixes-dom-order
broccolinisoup Oct 19, 2023
f74913a
Merge branch 'main' into pageheader-sign-off-fixes-dom-order
broccolinisoup Nov 15, 2023
ad906c2
fix the grid issues on the title (paired with Mike)
broccolinisoup Nov 17, 2023
c52a3d6
Use grid template areas
broccolinisoup Nov 21, 2023
dd3cce3
fix failing snapshots and linting etc
broccolinisoup Nov 21, 2023
e4a1229
update expected styles in jest
broccolinisoup Nov 21, 2023
db061d5
code review feedback
broccolinisoup Nov 24, 2023
fe95666
take data-components back because they are not needed here
broccolinisoup Nov 28, 2023
b2599af
PageHeader: Render `grid-template-areas` dynamicly to address spacing…
broccolinisoup Nov 28, 2023
4ef5f9e
vrt test fix and clean up dynamic template are rendering
broccolinisoup Nov 29, 2023
b5f33f3
fix jest tests
broccolinisoup Nov 29, 2023
22999b8
leave actions grid cell empty if it is not visible
broccolinisoup Nov 29, 2023
418ece3
remove leading and trailing action - it was there for tests
broccolinisoup Nov 29, 2023
1f7aab3
Revert "PageHeader: Render `grid-template-areas` dynamicly to address…
broccolinisoup Nov 30, 2023
10b7c54
add padding instead of grid gap
broccolinisoup Nov 30, 2023
08c4a76
fix wrong story
broccolinisoup Nov 30, 2023
bd0ed50
Add invariant for title areas that have interactive elements and add …
broccolinisoup Dec 1, 2023
52c4c6a
test(vrt): update snapshots
broccolinisoup Dec 1, 2023
89a522d
clean up interactivity check and fix tests
broccolinisoup Dec 4, 2023
0438eb7
Merge branch 'main' into pageheader-sign-off-fixes-dom-order
broccolinisoup Dec 4, 2023
a6e2335
reflect title area variant changes in children and siblings
broccolinisoup Dec 11, 2023
4698d98
Revert "reflect title area variant changes in children and siblings"
broccolinisoup Dec 14, 2023
a812c37
use height in siblings and children toto reflect the title variant ch…
broccolinisoup Dec 14, 2023
c4c4704
update tests and examples
broccolinisoup Dec 14, 2023
22a1613
solve sx override issue
broccolinisoup Dec 15, 2023
92799a8
add dev only story and VRT test and fix unit tests
broccolinisoup Dec 15, 2023
d0bfd7e
test(vrt): update snapshots
broccolinisoup Dec 15, 2023
25d70bf
Merge branch 'main' into pageheader-sign-off-fixes-dom-order
broccolinisoup Dec 15, 2023
aa7c43c
Merge branch 'main' into pageheader-sign-off-fixes-dom-order
broccolinisoup Dec 18, 2023
c1e57e7
add changeset
broccolinisoup Dec 22, 2023
e1b03a3
Merge branch 'main' into pageheader-sign-off-fixes-dom-order
broccolinisoup Feb 2, 2024
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions e2e/components/PageHeader.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,4 +673,38 @@ test.describe('PageHeader', () => {
})
}
})

test.describe('Large Variant with Multiline Title', () => {
for (const theme of themes) {
test.describe(theme, () => {
test('default @vrt', async ({page}) => {
await visit(page, {
id: 'drafts-components-pageheader-devonly--large-variant-with-multiline-title',
globals: {
colorScheme: theme,
},
})

// Default state
expect(await page.screenshot()).toMatchSnapshot(`PageHeader.Large Variant with Multiline Title.${theme}.png`)
})

test('axe @aat', async ({page}) => {
await visit(page, {
id: 'drafts-components-pageheader-devonly--large-variant-with-multiline-title',
globals: {
colorScheme: theme,
},
})
await expect(page).toHaveNoViolations({
rules: {
'color-contrast': {
enabled: theme !== 'dark_dimmed',
},
},
})
})
})
}
})
})
4 changes: 4 additions & 0 deletions script/generate-e2e-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,10 @@ const components = new Map([
id: 'drafts-components-pageheader-features--with-parent-link-and-actions-of-context-area',
name: 'With Parent Link and Actions of Context Area',
},
{
id: 'drafts-components-pageheader-devonly--large-variant-with-multiline-title',
name: 'Large Variant with Multiline Title',
},
],
},
],
Expand Down
43 changes: 43 additions & 0 deletions src/PageHeader/PageHeader.dev.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from 'react'
import {Meta} from '@storybook/react'
import {Button, IconButton, Box} from '..'
import Label from '../Label'
import {GitBranchIcon, PencilIcon, SidebarExpandIcon} from '@primer/octicons-react'

import {PageHeader} from './PageHeader'

export default {
title: 'Drafts/Components/PageHeader/DevOnly',
parameters: {
layout: 'fullscreen',
controls: {expanded: true},
},
} as Meta

export const LargeVariantWithMultilineTitle = () => (
<Box sx={{padding: 3}}>
<PageHeader>
<PageHeader.LeadingAction>
<IconButton aria-label="Edit" icon={PencilIcon} variant="invisible" />
</PageHeader.LeadingAction>
<PageHeader.TitleArea variant="large">
<PageHeader.LeadingVisual>
<GitBranchIcon />
</PageHeader.LeadingVisual>
<PageHeader.Title>
Title long title some extra loooong looong words here some extra loooong looong words here some extra loooong
looong words here some extra loooong looong words here some extra loooong looong words here
</PageHeader.Title>
<PageHeader.TrailingVisual>
<Label>Beta</Label>
</PageHeader.TrailingVisual>
</PageHeader.TitleArea>
<PageHeader.TrailingAction>
<IconButton aria-label="Expand sidebar" icon={SidebarExpandIcon} variant="invisible" />
</PageHeader.TrailingAction>
<PageHeader.Actions>
<Button variant="primary">Add Item</Button>
</PageHeader.Actions>
</PageHeader>
</Box>
)
Loading
Loading