Repository navigation
fix(press): a press on a control inside a card, row or token paints only the control, for every pointer #12231
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
Draft
cixzhang
wants to merge
29
commits into
main
Choose a base branch
from
l0/container-nested-press
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,084
−144
Draft
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
fcd23bd
docs(architecture): press feedback has one engine and three recipes
cixzhang 854a0e9
docs(architecture): press feedback review fixes (per-recipe tracking,…
cixzhang 5e54d73
docs(architecture): press feedback states the stretched-control gap o…
cixzhang f48376d
docs(architecture): press feedback scopes INV7 to non-activating pres…
cixzhang c251ce2
docs(architecture): a stretched control keeps its press paint on its …
cixzhang 2eff03c
docs(architecture): press feedback scopes drift rules to untracked pr…
cixzhang 3eaca16
docs(architecture): press feedback keeps interaction-modality INV13's…
cixzhang 4ef2cbf
docs(architecture): the surface under the finger paints (owner rule);…
cixzhang cec54c6
docs(architecture): press feedback names who writes a group press, an…
cixzhang a860b7b
docs(architecture): the menu profile names useMenuPress's own modules
cixzhang 54b636e
Merge origin/main
cixzhang 68a13eb
docs: the surface under the finger paints for every pointer in Item, …
cixzhang 57d537b
docs: verification rows cover every pointer for nested presses in Ite…
cixzhang 3273e63
docs: press feedback timing goes through the press-feedback engine (r…
cixzhang 50ba22c
docs(press-feedback): name the pen and CheckboxList rows in the neste…
cixzhang f855ddb
Merge remote-tracking branch 'origin/main' into specs/press-feedback-…
cixzhang 7fe942b
docs(press-feedback): keep the tested CheckboxList, RadioList and Tok…
cixzhang 8e57323
docs(Token): name the untested end-content press in the FR6 gap
cixzhang adeaa5d
docs(cards): a mouse press keeps desktop timing; where any press pain…
cixzhang e3da183
docs(press-feedback): state the owner's paint rule in neutral words
cixzhang fc12fff
Merge remote-tracking branch 'origin/main' into l0/container-nested-p…
cixzhang 1e0afc2
docs(press-feedback): Decider line with the decision time
cixzhang 8848813
fix(press): a press on a control inside a card, row or token paints o…
cixzhang d9364bd
Merge remote-tracking branch 'origin/specs/press-feedback-recipes' in…
cixzhang 3270bc6
docs(press-feedback): a Space key press paints until release; Enter, …
cixzhang c47a8f8
Merge remote-tracking branch 'origin/main' into l0/container-nested-p…
cixzhang 66888dc
docs(ClickableCard, SelectableCard, Item, TreeList, Token): the neste…
cixzhang 8b27ee4
docs(press-feedback): record that a held Space on a container's own a…
cixzhang 62e8b70
docs(useClickableContainer, Token): the onPointerDown docs and Token'…
cixzhang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [fix] A mouse or pen press on a control inside a ClickableCard, SelectableCard, Item row, TreeList row or Token now paints only that control, as a finger's press already did. The container keeps its hover look and shows no pressed state. A press on the container's own surface still paints the container, and an Item row whose root is a link still paints, because a press there runs the row. | ||
|
|
||
| @cixzhang | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| // Copyright (c) Meta Platforms, Inc. and affiliates. | ||
|
|
||
| /** | ||
| * @file NestedControlPress.stories.tsx | ||
| * @input ClickableCard, SelectableCard, Item, TreeList, Token and Button from | ||
| * @astryxdesign/core | ||
| * @output One story with each container that holds a nested control: a | ||
| * ClickableCard and a SelectableCard with a Button, an Item row and a | ||
| * TreeList row with an end-content Button, and a Token with a remove | ||
| * button, and a standalone Button. A press on the nested control paints | ||
| * only that control; a press on the container's own surface paints the | ||
| * container | ||
| * @position Fixture for __tests__/NestedControlPress.a11y.chromium.spec.ts | ||
| */ | ||
|
|
||
| import type {ReactNode} from 'react'; | ||
| import type {Meta, StoryObj} from '@storybook/react'; | ||
| import {ClickableCard} from '@astryxdesign/core/ClickableCard'; | ||
| import {SelectableCard} from '@astryxdesign/core/SelectableCard'; | ||
| import {Item} from '@astryxdesign/core/Item'; | ||
| import {TreeList} from '@astryxdesign/core/TreeList'; | ||
| import {Token} from '@astryxdesign/core/Token'; | ||
| import {Button} from '@astryxdesign/core/Button'; | ||
| import {Text} from '@astryxdesign/core/Text'; | ||
| import {VStack} from '@astryxdesign/core/Layout'; | ||
|
|
||
| const meta: Meta = { | ||
| title: 'Core/Nested Control Press', | ||
| tags: ['no-visual'], | ||
| parameters: {layout: 'padded'}, | ||
| }; | ||
| export default meta; | ||
|
|
||
| type Story = StoryObj; | ||
|
|
||
| function Case({id, children}: {id: string; children: ReactNode}) { | ||
| return ( | ||
| <div data-testid={id} style={{width: 320}}> | ||
| {children} | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| function NestedButton() { | ||
| return <Button label="Nested" size="sm" onClick={() => {}} />; | ||
| } | ||
|
|
||
| export const Containers: Story = { | ||
| render: () => ( | ||
| <VStack gap={4}> | ||
| <Case id="clickable-card"> | ||
| <ClickableCard label="Open billing" onClick={() => {}}> | ||
| <VStack gap={2}> | ||
| <Text type="body">Billing summary</Text> | ||
| <NestedButton /> | ||
| </VStack> | ||
| </ClickableCard> | ||
| </Case> | ||
| <Case id="selectable-card"> | ||
| <SelectableCard label="Plan" isSelected={false} onChange={() => {}}> | ||
| <VStack gap={2}> | ||
| <Text type="body">Team plan</Text> | ||
| <NestedButton /> | ||
| </VStack> | ||
| </SelectableCard> | ||
| </Case> | ||
| <Case id="item"> | ||
| <Item | ||
| label="Open row" | ||
| onClick={() => {}} | ||
| endContent={<NestedButton />} | ||
| /> | ||
| </Case> | ||
| <Case id="tree-list"> | ||
| <TreeList | ||
| items={[ | ||
| { | ||
| id: 'row', | ||
| label: 'Open tree row', | ||
| onClick: () => {}, | ||
| endContent: <NestedButton />, | ||
| }, | ||
| ]} | ||
| /> | ||
| </Case> | ||
| <Case id="token"> | ||
| <Token label="Filter token" onClick={() => {}} onRemove={() => {}} /> | ||
| </Case> | ||
| <Case id="button"> | ||
| <Button label="Standalone" onClick={() => {}} /> | ||
| </Case> | ||
| </VStack> | ||
| ), | ||
| }; |
Large diffs are not rendered by default.
Oops, something went wrong.
22 changes: 11 additions & 11 deletions
22
docs/specs/components/ClickableCard/ClickableCard.spec.md
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
40 changes: 20 additions & 20 deletions
40
docs/specs/components/SelectableCard/SelectableCard.spec.md
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking: Token's Remove button has no press paint of its own, so after this change a mouse press on it shows no press anywhere; "now paints only that control" reads as if Remove lights up. "shows no pressed state on the container" matches what ships.