Repository navigation
refactor(forms): give every form one vertical spacing rhythm - #105377
Draft
dariusz-biela wants to merge 2 commits into
Draft
dariusz-biela wants to merge 2 commits into
dariusz-biela wants to merge 2 commits into
Conversation
Shared inputs no longer carry outer vertical margins (DatePicker mv2, RadioButtons mt6, AddressFormFields mt6/mt3). Form content gets a block gap from FormWrapper, and new Form/Layout primitives (FormHeader, FormFields, FormFieldGroup, FormSection, FormMenuRows) space headers, fields and push rows from formSpacing tokens. Shared form content (DynamicForm, YesNoStep, FeedbackSurvey, AddPlaidBankAccount, SingleChoiceQuestion, getInputForValueSet, DimensionTypeSelector) moves onto the primitives.
Migrate every form to the Form/Layout primitives: blocks 24px apart, fields 20px, header pieces 12px, related pieces 8px, menu rows pulled by their 12px row padding. Outer vertical margins passed into inputs and wrappers are gone, and descriptions render in one supporting style.
|
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers! |
38 tasks done
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Explanation of Change
Forms had no shared vertical rhythm: every input, header and wrapper added its own outer margins (
mv2,mt6,mb5, ...), so the spacing between the same elements differed from form to form. This PR moves vertical spacing out of the elements and into the layout containers, which space their children with a small set of gap tokens.In the app
In the code
src/styles/formSpacing.tsdefines the tokens (blockGap,fieldGap,headerGap,groupGap,menuRowInset), exposed through newformContent,formFields,formHeader,formFieldGroupandformMenuRowsstyles.Form/Layoutprimitives:FormHeader,FormFields,FormFieldGroup,FormSection,FormMenuRows.FormWrappergives the form content the block gap, and the submit button keeps its top margin only when it sticks to the bottom.DatePicker,RadioButtons,AddressFormFields).DynamicForm,SubStepForms,FeedbackSurvey,AddPlaidBankAccount,SingleChoiceQuestion, ...) and all form pages are migrated to the primitives, and the outer margins passed into inputs and wrappers are removed.FormandDynamicFormstories updated,DatePickerTestcovers the margin-free input.Fixed Issues
$
PROPOSAL:
Tests
Offline tests
N/A - spacing-only change, no API or Onyx behavior is touched.
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari