Skip to content
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

#7558: Improve document/form builder responsiveness #7976

Merged
merged 8 commits into from Mar 23, 2024

Conversation

fregante
Copy link
Collaborator

@fregante fregante commented Mar 19, 2024

What does this PR do?

Form Editor

Before After
Screenshot 4 Screenshot 9

Element Editor

I tried to somewhat match the existing style of the form editor here as well

Before After
Screenshot 3 Screenshot 2

Checklist

@fregante fregante added bug Something isn't working mv3 labels Mar 19, 2024

This comment was marked as resolved.

Copy link

codecov bot commented Mar 19, 2024

Codecov Report

Attention: Patch coverage is 89.65517% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 73.00%. Comparing base (dfe97b3) to head (472b940).

Files Patch % Lines
src/components/formBuilder/edit/ActiveField.tsx 77.77% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7976      +/-   ##
==========================================
+ Coverage   72.98%   73.00%   +0.01%     
==========================================
  Files        1307     1309       +2     
  Lines       40588    40593       +5     
  Branches     7538     7531       -7     
==========================================
+ Hits        29625    29635      +10     
+ Misses      10963    10958       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fregante fregante changed the title Improve document builder responsiveness; Extract ActiveField and FormIntroFields components Improve document/form builder responsiveness Mar 19, 2024
@fregante fregante marked this pull request as ready for review March 19, 2024 09:32
@@ -34,6 +35,7 @@ const FormBuilder: React.FC<{
return (
<div className={styles.root}>
<div className={styles.column} data-testid="editor">
<FormIntroFields name={name} />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These fields are only used once or twice, I extracted this component from FormEditor

@@ -0,0 +1,86 @@
import React from "react";
import {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These two components can't be made strict, see automated comment:
#7976 (comment)

I think I made no changes to ActiveField other than extracting it.

className={styles.header}
onClick={onToggle}
ref={headerRef}
onKeyPress={onToggle}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

a11y: we should probably forbid role="button" for the most part, and instead use button. button also comes with "onKeyPress" natively

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@twschiller
Copy link
Contributor

Form Editor

From the screenshot, this PR appears to be removing the "Use the preview tab" signifier/instructional text

@twschiller twschiller added the user experience Improve the user experience (UX) label Mar 19, 2024
@twschiller twschiller added this to the 1.8.12 milestone Mar 21, 2024
@fregante
Copy link
Collaborator Author

fregante commented Mar 22, 2024

this PR appears to be removing the "Use the preview tab" signifier/instructional text

Restored, screenshot updated. This PR is now ready for review.

strictNullChecks CI: the files can't be added

@fregante fregante changed the title Improve document/form builder responsiveness #7558: Improve document/form builder responsiveness Mar 22, 2024
Copy link

@BrandonPxBx BrandonPxBx left a comment

Choose a reason for hiding this comment

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

Approving -- wondering if it's possible to lump a style change on the "Use preview tab" text so that they match between the two? @fregante

Copy link

No loom links were found in the first post. Please add one there if you'd like to it to appear on Slack.

Do not edit this comment manually.

@fregante
Copy link
Collaborator Author

fregante commented Mar 22, 2024

@BrandonPxBx thank you!

wondering if it's possible to lump a style change on the "Use preview tab" text so that they match between the two?

Gotta check how similar they are under the hood, but there only two differences on the surface:

  • field/element text
  • there's no "add new element" button in the element editor (which honestly feels like a bug because I was unable to find the button anywhere else when testing)

Edit: I checked and the components would require a bit too many changes right now, they are wrapped around different components

</Row>
</p>

<h6>Current element: {currentElementName}</h6>
Copy link
Collaborator

Choose a reason for hiding this comment

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

NIT: not a fan of using an h6. <p><strong>...</strong><p> might make more sense here?

In general, we shouldn't be skipping heading types. If we want it to be a heading, then we should use the appropriate level and re-style.

Very far from a priority.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think skipping heading levels is not an issue, especially since we don't really use them consistently. However since it's a section header, any heading tag is still preferable to p>strong IMO

@fregante fregante merged commit bc985fb into main Mar 23, 2024
26 of 27 checks passed
@fregante fregante deleted the F/mv3/page-editor-wrapping branch March 23, 2024 01:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working low priority mv3 page editor user experience Improve the user experience (UX)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve page editor responsive UI further
4 participants