Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/bright-ravens-jog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
---

Update active indicators for ActionList & FilteredActionList to follow content height
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/FilteredActionList.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import {test, expect} from '@playwright/test'
import {visit} from '../test-helpers/storybook'
import {themes} from '../test-helpers/themes'

const stories = [
{
title: 'Default',
id: 'components-filteredactionlist--default',
},
{
title: 'With Long Items',
id: 'components-filteredactionlist-examples--with-long-items',
},
] as const

test.describe('FilteredActionList', () => {
for (const story of stories) {
test.describe(story.title, () => {
for (const theme of themes) {
test(`default @vrt ${theme}`, async ({page}) => {
await visit(page, {
id: story.id,
globals: {
colorScheme: theme,
},
})

// Default state
await expect(page).toHaveScreenshot(`FilteredActionList.${story.title}.${theme}.png`)
})
}
})
}
})
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@define-mixin activeIndicatorLine {
position: absolute;
top: calc(50% - var(--base-size-12));
top: var(--base-size-4);
left: calc(-1 * var(--base-size-8));
width: var(--base-size-4);
height: var(--base-size-24);
height: calc(100% - var(--base-size-8));
content: '';
/* stylelint-disable-next-line primer/colors */
background: var(--borderColor-accent-emphasis);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import type {Meta} from '@storybook/react-vite'
import React, {useMemo} from 'react'
import {FilteredActionList} from '../FilteredActionList'
import classes from './FilteredActionList.stories.module.css'

const meta: Meta = {
title: 'Components/FilteredActionList/Examples',
component: FilteredActionList,
parameters: {
controls: {
disable: true,
},
},
}
export default meta

export function WithLongItems() {
Copy link
Member

Choose a reason for hiding this comment

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

it's ok if we don't but it we want this to have VRT, we should add it to e2e/components/* (noticed we don't have one for FilteredActionList, might be a good time to add one)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. Added FilteredActionList to the e2e snapshots

const [filter, setFilter] = React.useState('')

const items = useMemo(() => {
return [
{
text: 'enhancement with a very long label that might wrap. enhancement with a very long label that might wrap. enhancement with a very long label that might wrap. ',
id: 1,
},
{
text: 'bug with an excessively verbose description that goes on and on. bug with an excessively verbose description that goes on and on. bug with an excessively verbose description that goes on and on.',
id: 2,
},
{
text: 'good first issue that is intended to be approachable for newcomers',
id: 3,
},
{
text: 'design related task that involves multiple stakeholders and considerations',
id: 4,
},
].filter(item => item.text.toLowerCase().startsWith(filter.toLowerCase()))
}, [filter])

return (
<>
<h1>Filtered Action List with Long Items</h1>
<div>Please select labels that describe your issue:</div>
<FilteredActionList
placeholderText="Filter Labels"
onFilterChange={setFilter}
items={items}
className={classes.FilteredActionListContainer}
/>
</>
)
}
Loading