-
Notifications
You must be signed in to change notification settings - Fork 890
Connection: Component updates - replace Modal with Dialog #50735
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
Closed
Closed
Changes from 3 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
a1e6f0e
Replace connection / disconnection / management modals with dialogs f…
coder-karen 74281ef
Accessibility fixes
coder-karen 31bda4e
Changlog tweaks and string apostrophe update
coder-karen ceb3273
Allow Manage Connection Dialog to close on esc
coder-karen 59361bd
Merge branch 'trunk' into update/connection-js-package-modal-to-dialog
coder-karen 6afb0cc
Bundles @wordpress/theme and @wordpress/private-apis directly into je…
coder-karen 115d1be
wp-private-apis/wp-theme backed by the polyfill registration instead …
coder-karen ee3650f
Add tests specific to ConnectionDialog
coder-karen 75ad660
Update composer.lock files
coder-karen 2496e6f
changelog
coder-karen 3cf90c0
Update polyfills - run on every call, and update e2e builds to inclu…
coder-karen f9c973e
Style tweak for manage connection dialog on specific screen sizes
coder-karen 02967e4
Fix polyfill tests - create asset file, mirror hook already firing an…
coder-karen 045bf6a
Fix merge conflicts
coder-karen aef8c19
Fix test failing due to conflicting changes between recently merged P…
coder-karen 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
4 changes: 4 additions & 0 deletions
4
projects/js-packages/connection/changelog/update-connection-js-package-ui-pt5
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,4 @@ | ||
| Significance: patch | ||
| Type: changed | ||
|
|
||
| Connection UI: Migrate the disconnect, manage-connection and owner-disconnect modals from the @wordpress/components Modal to the @wordpress/ui Dialog. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,55 @@ | ||
| @use "@automattic/jetpack-base-styles/style"; | ||
|
|
||
| .jp-connection__disconnect-dialog { | ||
| --viewport-inset: 3rem; | ||
|
|
||
| display: flex; | ||
| flex-direction: column; | ||
| padding: 0; | ||
| overflow-y: auto; | ||
|
|
||
| h1 { | ||
| margin-top: 0; | ||
| --_gcd-heading-font-size: var(--font-title-small); | ||
| --_gcd-heading-font-weight: 600; | ||
| --_gcd-heading-margin: 0 0 0.67em; | ||
|
|
||
| margin: 0 0 0.67em; | ||
| line-height: 1.2; | ||
| font-size: var(--font-title-small); | ||
| font-weight: 600; | ||
| } | ||
|
|
||
| h2 { | ||
| --_gcd-heading-font-size: var(--font-title-small); | ||
| --_gcd-heading-font-weight: 400; | ||
|
|
||
| margin: 0; | ||
| line-height: 1.2; | ||
| font-size: var(--font-title-small); | ||
| font-weight: 400; | ||
| } | ||
|
|
||
| p { | ||
| --_gcd-p-font-size: var(--font-body); | ||
|
|
||
| margin-top: 0; | ||
| font-size: var(--font-body); | ||
| } | ||
|
|
||
| // `Text`'s own stylesheet sets `margin: 0` (layered), which for a `<p>` | ||
| // falls back to that default anyway, but for a bare `Text` (renders as a | ||
| // `<span>`, e.g. `OwnerDisconnectDialog`'s copy) leaves no gap before the | ||
| // next element, since a `<span>` has no UA margin of its own to restore. | ||
| // Same story for `line-height`: wp-admin's global `common.css` sets a bare | ||
| // `p { line-height: 1.5 }` that the raw `<p>` steps pick up for free, but a | ||
| // `<span>` never matches that selector, so it's restored explicitly here. | ||
| &__large-text, | ||
| p.jp-connection__disconnect-dialog__large-text { | ||
| --_gcd-p-font-size: 1.25rem; | ||
|
|
||
| margin: 0 0 1em; | ||
| font-size: 1.25rem; | ||
| line-height: 1.5; | ||
| } | ||
|
|
||
| &__link, | ||
|
|
@@ -54,25 +80,6 @@ | |
| border-radius: 4px; | ||
| } | ||
|
|
||
| .components-modal { | ||
|
|
||
| &__content { | ||
| padding: 0; | ||
| display: flex; | ||
| flex-direction: column; | ||
| flex-grow: 1; | ||
| margin: 0; | ||
|
|
||
| &::before { | ||
| display: none; | ||
| } | ||
| } | ||
|
|
||
| &__header { | ||
| display: none; | ||
| } | ||
| } | ||
|
|
||
| // The help message grows to fill the row; the button pair keeps its natural | ||
| // width beside it and wraps below once the row runs out of room. The | ||
| // flex-basis biases toward wrapping early, while `min-width: 0` lets the | ||
|
|
@@ -115,6 +122,23 @@ | |
| background: var(--jp-red) !important; | ||
| } | ||
|
|
||
| // Moved here from the owner dialog's stylesheet, which no longer renders | ||
| // these buttons — `DisconnectActionFooter` supplies its own footer actions. | ||
| // The @wordpress/ui Button emits no `.components-button` class, so the | ||
| // shared reset that wp-admin would otherwise apply is restored on the | ||
| // class itself. | ||
|
coder-karen marked this conversation as resolved.
|
||
| &__btn-dismiss, | ||
| &__btn-disconnect { | ||
| border: 0; | ||
| border-radius: 4px; | ||
| color: var(--wp-components-color-accent-inverted, #fff); | ||
| font-size: var(--font-body-small); | ||
| height: 40px; | ||
| text-decoration: none; | ||
| text-shadow: none; | ||
| white-space: nowrap; | ||
| } | ||
|
Comment on lines
+127
to
+142
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to above question, could we simply use the button component as-is without overriding its styles entirely? Otherwise, there's little point in using a shared component in the first place. |
||
|
|
||
| &__btn-back-to-wp { | ||
| background: var(--jp-black) !important; | ||
| } | ||
|
|
@@ -181,8 +205,7 @@ | |
|
|
||
| @media (min-width: 600px) { | ||
|
|
||
| .jp-connection__disconnect-dialog, | ||
| .jp-connection__disconnect-dialog.components-modal__frame { | ||
| .jp-connection__disconnect-dialog { | ||
| width: 100%; | ||
| max-width: calc(100% - 32px); | ||
| } | ||
|
|
@@ -202,8 +225,7 @@ | |
|
|
||
| @media (min-width: 960px) { | ||
|
|
||
| .jp-connection__disconnect-dialog, | ||
| .jp-connection__disconnect-dialog.components-modal__frame { | ||
| .jp-connection__disconnect-dialog { | ||
| width: 1200px; | ||
| height: 900px; | ||
| display: flex; | ||
|
|
@@ -213,11 +235,15 @@ | |
| .jp-connection__disconnect-dialog { | ||
|
|
||
| h1 { | ||
| --_gcd-heading-font-size: var(--font-title-large); | ||
|
|
||
| font-size: var(--font-title-large); | ||
| } | ||
|
|
||
| &__large-text, | ||
| p.jp-connection__disconnect-dialog__large-text { | ||
| --_gcd-p-font-size: 1.5rem; | ||
|
|
||
| font-size: 1.5rem; | ||
| } | ||
|
|
||
|
|
||
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
12 changes: 11 additions & 1 deletion
12
...ects/js-packages/connection/components/disconnect-dialog/test/step-disconnect-confirm.tsx
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
12 changes: 11 additions & 1 deletion
12
projects/js-packages/connection/components/disconnect-dialog/test/step-disconnect.tsx
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
12 changes: 11 additions & 1 deletion
12
projects/js-packages/connection/components/disconnect-dialog/test/step-thank-you.tsx
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.
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.
These attributes were meant to protect any CSS reset or other
h1styles from leaking to the component; not as much as a way to customize the component.Are the style overrieds (here and elsewhere in this file) to the core component really needed? Ideally we would just use the components as-is. Worth checking with Jetpack design team if that would work!
Long term these styles become pain to maintain since they're assuming the internal DOM structure doesn't change, and there aren't any other conflicting styles introduced in component later on.
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.
I'm looking into creating a lint rule to avoid using the internal gcd tokens: WordPress/gutenberg#80952