Skip to content

Creating chromatic baseline for fixing combobox to use useFormProps#2334

Merged
ktabors merged 9 commits into
mainfrom
field_formprops
Sep 21, 2021
Merged

Creating chromatic baseline for fixing combobox to use useFormProps#2334
ktabors merged 9 commits into
mainfrom
field_formprops

Conversation

@ktabors
Copy link
Copy Markdown
Collaborator

@ktabors ktabors commented Sep 14, 2021

Closes #2323

Chromatic updates for #2351
Adding more from components to form and provider storybook and chromatic.

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Review the form stories
Review the provider stories

Run chromatic

🧢 Your Project:

RSP

Copy link
Copy Markdown
Collaborator Author

@ktabors ktabors left a comment

Choose a reason for hiding this comment

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

Need to review chromatic before this PR is ready.

<Checkbox value="cats">Cats</Checkbox>
<Checkbox value="dragons">Dragons</Checkbox>
</CheckboxGroup>
<ColorField label="Primary Color" />
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

May I refactor this to be one component of each type and in alphabetical order? Ditto the Provider update below.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I mean, it's already mangling the chromatic story, so, i guess? Do be careful, form chromatic stories were already close to their maximum height
It falls into the same category as the other chromatic PR you have, we just need to do it in three steps very carefully
first run chromatic on main, make sure it's all green. then run it on this branch, make sure we're ok with everything. merge it, then run chromatic once more on main so we have the right baseline moving forward

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This sounds good. I was hoping that adding them at the end wouldn't cause too much chaos, but after reviewing, adding this many components makes the diff basically useless. :(

How do I tell what the max height is? Should the form stories be separated by categories like inputs and dropdowns?

Comment thread packages/@react-spectrum/form/chromatic/Form.chromatic.tsx Outdated
.add(
'custom theme',
() => render({theme: THEME})
)
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Should this file be refactored to use the new syntax?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

at some point yes, if it's not hard you can do it here, if it takes more than a few min, maybe do it on its own later

Comment thread packages/@react-spectrum/form/chromatic/Form.chromatic.tsx Outdated
Comment thread packages/@react-spectrum/provider/stories/Provider.stories.tsx Outdated
}

function TextFieldBase(props: TextFieldBaseProps, ref: Ref<TextFieldRef>) {
props = useProviderProps(props);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why was useProviderProps removed here but not in SearchWithin? or should it be the other way around?

Copy link
Copy Markdown
Collaborator Author

@ktabors ktabors Sep 15, 2021

Choose a reason for hiding this comment

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

In my exploration I found having useProviderProps here did nothing. And it was needed in SearchWithin for the props like isQuiet, isRequired, isDisabled, etc. It is needed in any components that inherit those from the Provider. I was annoyed that I couldn't move useProviderProps to Field too.

@ktabors ktabors marked this pull request as ready for review September 15, 2021 00:34
@adobe-bot
Copy link
Copy Markdown

Build successful! 🎉

Copy link
Copy Markdown
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

So it's occurred to me, we're doing code changes and chromatic changes together in this PR. They need to be split since they are modifications that will cause us to not get anything useful out of chromatic if kept together. Lets get the chromatic modifications out into their own PR, we'll merge that one, then we can merge the refactor of useFormProps

same plan as we did for the locale updates you were doing

@ktabors
Copy link
Copy Markdown
Collaborator Author

ktabors commented Sep 17, 2021

So it's occurred to me, we're doing code changes and chromatic changes together in this PR. They need to be split since they are modifications that will cause us to not get anything useful out of chromatic if kept together. Lets get the chromatic modifications out into their own PR, we'll merge that one, then we can merge the refactor of useFormProps

same plan as we did for the locale updates you were doing

#2351 has the code change, updating this to be chromatic and story updates

@adobe-bot
Copy link
Copy Markdown

Build successful! 🎉

@ktabors ktabors changed the title fixing combobox to use useFormProps Creating chromatic baseline for fixing combobox to use useFormProps Sep 21, 2021
Copy link
Copy Markdown
Member

@LFDanLu LFDanLu left a comment

Choose a reason for hiding this comment

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

LGTM, should take special care when approving the chromatic diffs/new baseline for this however since this changes the order of the components in these stories

@dannify
Copy link
Copy Markdown
Member

dannify commented Sep 21, 2021

Can we keep the order of the form elements as they were before to minimize the visual diff for this?

@ktabors
Copy link
Copy Markdown
Collaborator Author

ktabors commented Sep 21, 2021

Can we keep the order of the form elements as they were before to minimize the visual diff for this?

That was my plan, but I found that by adding components it makes keeping the order pointless. The form width is different with these other components and after the first iteration, all the variations clobber each other because the height of each form is longer. I found more value in them being alphabetical to make sure we have all the ones we want.

@dannify
Copy link
Copy Markdown
Member

dannify commented Sep 21, 2021

ok sure.

Copy link
Copy Markdown
Member

@reidbarber reidbarber left a comment

Choose a reason for hiding this comment

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

LGTM

@adobe-bot
Copy link
Copy Markdown

Build successful! 🎉

@ktabors ktabors merged commit 9ac0db3 into main Sep 21, 2021
@ktabors ktabors deleted the field_formprops branch September 21, 2021 21:28
paulkenney added a commit that referenced this pull request Sep 23, 2021
* main:
  Rename cards packages -> card
  Bump theme packages
  add rest of style props to action menu (#2374)
  Publish
  Add Autocomplete package (#2371)
  CardView followup patch (#2362)
  Creating chromatic baseline for fixing combobox to use useFormProps (#2334)
  Correcting Arabic translations of Loading and Loading more (#2359)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ComboBox Form context inheritance issue with label props

6 participants