Conversation
|
Thanks for the PR! 🎉 We've deployed an automatic preview for this PR - you can see your changes here:
Note The build needs to finish before your changes are deployed. |
4cd674b to
a373718
Compare
033b515 to
00c1358
Compare
a373718 to
22897ac
Compare
22897ac to
2dfcee7
Compare
|
|
||
| if (changedProperties.has('shown') && ( | ||
| (reduceMotion && this._state === 'shown') || (!reduceMotion && this._state === 'showing') | ||
| )) { | ||
| this.#centerLoadingSpinner(); | ||
| } |
There was a problem hiding this comment.
I replaced this check with a simpler one- rather than checking to see if we're in the first state after hidden, requiring us to check reduceMotion to see which that first state should be, instead we're just checking if the last state is hidden.
| const overlayStyles = css` | ||
| .action-slot::slotted(*) { | ||
| display: inline; |
There was a problem hiding this comment.
These styles are replicated from the simple empty state component
2dfcee7 to
24808ad
Compare
| } else if (oldState === 'loading' && newState === 'clean') { | ||
| this.#setLiveArea(this.localize('components.backdrop-loading.loadingCompleteAnnouncement')); | ||
| } else if (newState === 'dirty') { | ||
| this.#setLiveArea(this.#renderDirtyOverlay(), { delay: DIRTY_ANNOUNCEMENT_DELAY }); |
There was a problem hiding this comment.
To avoid complexities in coordinating the live region announcement and the display state of the visual overlay, I've opted to render the same content into the offscreen component. This results in an announcement that matches what you would get if the dirty overlay itself was in an aria-live component.
| } else if (oldState === 'loading' && newState === 'clean') { | ||
| this.#setLiveArea(this.localize('components.backdrop-loading.loadingCompleteAnnouncement')); | ||
| } else if (newState === 'dirty') { | ||
| this.#setLiveArea(this.#renderDirtyOverlay(), { delay: DIRTY_ANNOUNCEMENT_DELAY }); |
There was a problem hiding this comment.
I noticed some differences in screen reader behavior here that I feel are worth mentioning:
NVDA: Announces the text before the button, then the button text, with no pause. E.G. "Your data is out of date you should refresh your filters refresh"
Narrator: Communicates that there's a group with text and a button, E.G. "Group, Your data is out of date your should refresh your filters, button, refresh"
The latter I assume is more what we want, but ultimately the component is surfacing the necessary info to NVDA so I'm not sure if there's anything actionable here. Have we dealt with similar issues elsewhere in the Corel library before?
54c986a to
7903c49
Compare
e3d0884 to
d345775
Compare
Updating vdiff goldens for PR 6798
|
@GZolla Ready for another look 👍 Thanks! |
| }, | ||
| /** | ||
| * Used to identify content that the backdrop should make inert | ||
| * @type {boolean} |
There was a problem hiding this comment.
Didn't notice this before
| * @type {boolean} | |
| * @type {string} |
| } | ||
| } | ||
|
|
||
| willUpdate() { |
There was a problem hiding this comment.
I think this could use the PropertyRequiredMixin and a validator like in here.
| <div style="position:relative"> | ||
| <slot id="table-slot" @slotchange="${this._handleSlotChange}"></slot> | ||
| <d2l-backdrop-loading for="table-slot" ?shown=${this.loading}></d2l-backdrop-loading> | ||
| <d2l-backdrop-loading @d2l-backdrop-dirty-overlay-action=${this._handleDirtyButton} for="table-slot" dataState=${this.dataState} dirty-text="${this.dirtyText}" dirty-button-text="${this.dirtyButtonText}"></d2l-backdrop-loading> |
There was a problem hiding this comment.
This should be a separate PR but I noticed that the scroll wrapper is not made inert meaning that it will still be focusable and scrollable, resulting in unexpected behavior. Maybe the backdrop should move to target the scroll wrapper instead
There was a problem hiding this comment.
Hm, interesting- I'll dig deeper into that after this merges 👍
| } | ||
|
|
||
| d2l-backdrop-dirty-overlay { | ||
| background-color: var(--d2l-theme-backdrop-dialog-color); |
There was a problem hiding this comment.
Just confirming that it would no longer use a custom variable and the background would not match the table's controls background
There was a problem hiding this comment.
would not match the table's controls background
I think that's fine, at least for now. I assume we could always override this value on the table side if we decide that's important.
GZolla
left a comment
There was a problem hiding this comment.
It's looking good, just missing the PropertyRequiredMixin for the validators to work
| reflect: true, | ||
| attribute: 'dirty-text', | ||
| required: { | ||
| validator: (_value, elem, hasValue) => {hasValue || elem.dataState !== 'dirty';} |
There was a problem hiding this comment.
| validator: (_value, elem, hasValue) => {hasValue || elem.dataState !== 'dirty';} | |
| validator: (_value, elem, hasValue) => hasValue || elem.dataState !== 'dirty' |
| reflect: true, | ||
| attribute: 'dirty-button-text', | ||
| required: { | ||
| validator: (_value, elem, hasValue) => {hasValue || elem.dataState !== 'dirty';} |
There was a problem hiding this comment.
| validator: (_value, elem, hasValue) => {hasValue || elem.dataState !== 'dirty';} | |
| validator: (_value, elem, hasValue) => hasValue || elem.dataState !== 'dirty' |
https://desire2learn.atlassian.net/browse/NTNGL-5471?atlOrigin=eyJpIjoiODJjZWQ3NzZmNjE0NDc1MTgxOTEwMTY5MGUzNDNkZTAiLCJwIjoiaiJ9
We're adding a dirty state to the table component to act as an intermediate state between clean and loading while the user changes their selections.
I've split this PR into two commits:
shownboolean to adataStateenum, to allow the addition of a third stateDemo
https://d2l.slack.com/archives/C0PHG3QB0/p1775842223156609