-
Notifications
You must be signed in to change notification settings - Fork 235
feat(compass): Always show new toolbars, remove feature flag, use query history as popover COMPASS-5678, COMPASS-5679 #3312
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
Conversation
<Icon glyph="Clock" /> | ||
<Icon glyph="CaretDown" /> | ||
</button> | ||
<Popover |
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.
This popover currently is not accessible. There is no exact aria example that would match this that I can link you here to, but basically what you have here is a composite element with an active descendant that is a popup that should manage its own focus, similar to an action menu or a toolbar (actually somewhere in between the two). At the very least it should assume focus on open and return it back to the trigger on close
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.
Created a new component in compass-components
called InteractivePopover
. It abstracts the keyboard actions, rendering, and focus trap. If it looks good to you we'll also use this for rendering the saved aggregations list in COMPASS-5852
Let me know how that implementation looks, I'm adding tests now.
It uses react-focus-trap
to take focus, and now we return focus to the trigger button when the popover is hidden.
packages/compass-query-bar/src/components/query-history-button-popover.tsx
Outdated
Show resolved
Hide resolved
packages/compass-query-bar/src/components/query-history-button-popover.tsx
Outdated
Show resolved
Hide resolved
const onClickOutsideQueryHistory = useCallback( | ||
(event) => { | ||
// Ignore clicks on the query history button as it has its own handler. | ||
if ( | ||
!queryHistoryButtonRef.current || | ||
queryHistoryButtonRef.current.contains(event.target as Node) | ||
) { | ||
return; | ||
} | ||
setShowQueryHistory(false); | ||
}, | ||
[queryHistoryButtonRef, setShowQueryHistory] | ||
); |
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.
Shouldn't this apply to the whole group of components including button and popover? The way you are doing special case handling for the button here kinda negates the point of having a special hook for this use case
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.
Removed this exported hook in the new InteractivePopover
component: #3312 (comment)
Has this comment gone away?
Would it be possible to rather finish this work to the point that there is no further follow-up before we enable the FF? |
…ompass-components, better accessibility
@mcasimir Once this pr merges, the feature flag is gone. So we merge this when the new toolbars are ready to go. |
In general, I would prefer if the first PR that we merge with the new QB is with the FF enabled and not with the old code removed, but I also don't think we are ready to enable it just yet. I've scheduled a sync with Claudia later today to talk about this. I'd rather keep the FF around and keep merging small PRs with improvements and fixes than keep the entire work here as an "all or nothing". I don't feel we can already make a commitment to finalize the work with this PR and release it right away. Changing the QB is a big thing for both Compass and DE and I'd be hesitant to enable this FF right away. We may need to validate some aspects of this from a design perspective, and we probably want to give ourselves some time to manually test the interaction. Having the new QB on main enabled while we still don't know if we should do more work on it may block releases .. and we have at least one planned for M1. |
Synced w/ Claudia and Maurizio. Going to separate this into separate prs, we're going to hold the feature flag until we've done a few more changes. We'll also separate the removing old code and the removing feature flag, at least for a little to help ensure we have the old query bar ready if we need it. |
COMPASS-5678 COMPASS-5679
This pull request enables the new toolbars in Compass. It removes the
COMPASS_SHOW_NEW_TOOLBARS
feature flag, and the previous toolbar code. The new toolbars are built using LeafyGreen UI components.Now the query history is opened as a popover managed by the query bar. This is a change in the query history's
appRegistry
role and how it's rendered. Previously it had aCollection.ScopedModal
role. Now it has the roleQuery.QueryHistory
and is rendered by the query bar, whenshowQueryHistoryButton
is true (On cloud this is false). It's rendered using aPopover
with a new hook incompass-components
,useOnClickOutside
.This PR updates tests so they are now using these new toolbars.
Before:
before.mp4
After:
after.mp4
Before merging:
IconButton
vsButton
) for the export to language button. PR: feat(compass-query-bar): update export to language button and icon #3315compass-crud
toolbar buttons so the text doesn't wrap at low widths.layout
prop. Now we accept aqueryOptions
prop.queryOptions
are now an array of the inputs to render (excludingfilter
as that is always rendered). The previous proplayout
had a different interface. @johnjackweir