Skip to content

Conversation

@agreenberry
Copy link
Contributor

@agreenberry agreenberry commented Apr 10, 2023

Describe your changes here.

Closes #1885

Screenshots

Please provide before/after screenshots for any visual changes
(View in Storybook)
image

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@changeset-bot
Copy link

changeset-bot bot commented Apr 10, 2023

🦋 Changeset detected

Latest commit: 7c2cf79

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Apr 10, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 104.2 KB (-0.01% 🔽)
dist/browser.umd.js 104.74 KB (-0.01% 🔽)

@agreenberry agreenberry temporarily deployed to github-pages April 10, 2023 15:50 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3143 April 10, 2023 15:50 Inactive
agreenberry and others added 4 commits April 10, 2023 11:54
…e-heading-1' of github.com:primer/react into 1885-bug-splitpagelayoutpane-needs-to-be-able-to-consume-heading-1
@agreenberry agreenberry marked this pull request as ready for review April 10, 2023 15:59
@agreenberry agreenberry requested review from a team and JoshBowdenConcepts April 10, 2023 15:59
@github-actions github-actions bot temporarily deployed to storybook-preview-3143 April 10, 2023 16:01 Inactive
@agreenberry agreenberry temporarily deployed to github-pages April 10, 2023 16:03 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3143 April 10, 2023 16:03 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3143 April 10, 2023 16:03 Inactive
Copy link

@andrialexandrou andrialexandrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting some changes about component interface and tests.

I have another question that betrays my ignorance: does this repo contain documentation for these components as well? I'd like to review the documentation to make sure it adequately communicates how to include headings with this component.

<Box sx={{height: 320, overflowY: 'auto', border: '1px solid', borderColor: 'border.default'}}>
<SplitPageLayout>
<SplitPageLayout.Pane>
<Placeholder label="Pane" height={120} heading="Pane Heading" />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The component interface should support accepting a heading level, and in my opinion should make it a required argument.

In this case I believe we were wanting the heading to be a level 2, for instance, but I could imagine circumstances it might be a level 1 or a level 3.

I can see by the tests that it is a level 2, but I'm thinking here in terms of component design.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell this is still choosing h2 by default, and I propose we require user to provide heading level.

@andrialexandrou
Copy link

andrialexandrou commented Apr 11, 2023

I'd like to review the documentation to make sure it adequately communicates how to include headings with this component.

Ah, the answer is yes. Let me propose the change...

It looks like we need to add an item for the heading here as well? IIUC

"name": "SplitPageLayout.Pane",
"props": [
{
"name": "position",
"type": "| 'start' | 'end' | { narrow?: | 'start' | 'end' regular?: | 'start' | 'end' wide?: | 'start' | 'end' }",
"defaultValue": "'start'",
"description": ""
},
{
"name": "width",
"type": "| 'small' | 'medium' | 'large'",
"defaultValue": "'medium'",
"description": "The width of the pane."
},
{
"name": "resizable",
"type": "boolean",
"defaultValue": "false",
"description": "When true, the pane may be resized by the user."
},
{
"name": "widthStorageKey",
"type": "string",
"defaultValue": "'paneWidth'",
"description": "Provide a key used by localStorage to persist the size of the pane on the client."
},
{
"name": "sticky",
"type": "boolean",
"defaultValue": "true",
"description": "Whether the pane should stick to the top of the screen while the content scrolls."
},
{
"name": "offsetHeader",
"type": "number | string",
"defaultValue": "0",
"description": "Use offsetHeader along with the sticky prop to push the sticky pane down to make room for a sticky header if necessary. Use the type `string` to specify the height with a unit i.e. 5rem; otherwise the type `number` will be taken as px."
},
{
"name": "padding",
"type": "| 'none' | 'condensed' | 'normal'",
"defaultValue": "'normal'",
"description": "The amount of padding inside the pane."
},
{
"name": "divider",
"type": "| 'none' | 'line' | { narrow?: | 'none' | 'line' | 'filled' regular?: | 'none' | 'line' wide?: | 'none' | 'line' }",
"defaultValue": "'line'",
"description": ""
},
{
"name": "hidden",
"type": "| boolean | { narrow?: boolean regular?: boolean wide?: boolean }",
"defaultValue": "false",
"description": "Whether the pane is hidden."
},
{
"name": "sx",
"type": "SystemStyleObject"
}
]
},

@andrialexandrou
Copy link

github/accessibility-audits#3506

@primer primer bot temporarily deployed to github-pages May 2, 2023 18:49 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3143 May 2, 2023 18:49 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3143 May 2, 2023 18:50 Inactive
const {getByText} = render(
<ThemeProvider>
<SplitPageLayout>
<SplitPageLayout.Pane heading="Custom heading" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious if it makes more sense to make the heading a component itself rather then passing it in as a prop:

          <SplitPageLayout.Pane.heading as='h3'>Custom heading"</SplitPageLayout.Pane.heading >

^ this would make it easier for people to add attributes in the future.

@github-actions github-actions bot temporarily deployed to storybook-preview-3143 November 8, 2023 17:22 Inactive
@TylerJDev TylerJDev added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Nov 8, 2023
@github-actions github-actions bot temporarily deployed to storybook-preview-3143 November 8, 2023 20:47 Inactive
@github-actions github-actions bot removed the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Nov 8, 2023
@TylerJDev TylerJDev requested review from kendallgassner and removed request for JoshBowdenConcepts November 8, 2023 20:54
@TylerJDev
Copy link
Member

@andrialexandrou, @kendallgassner - I would love to get y'alls opinion on the additions to this PR. I think I covered all of the comments left on this PR, but want to make sure I've captured all of the criteria needed to close the main issue out.

import React from 'react'
import {createGlobalStyle} from 'styled-components'
import Box from '../Box'
import Heading from '../Heading'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import Heading from '../Heading'

Copy link
Contributor

@kendallgassner kendallgassner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit to remove an unused dependency but other-wise this looks great!

@TylerJDev TylerJDev added this pull request to the merge queue Nov 13, 2023
Merged via the queue into main with commit cc0c16e Nov 13, 2023
@TylerJDev TylerJDev deleted the 1885-bug-splitpagelayoutpane-needs-to-be-able-to-consume-heading-1 branch November 13, 2023 23:09
@primer primer bot mentioned this pull request Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants