-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
feat(native-filters): Highlight charts affected by focused native filter #14693
feat(native-filters): Highlight charts affected by focused native filter #14693
Conversation
Could you create a sample dashboard with some Tabs, and set filter scope that is only applicable to those charts inside tab? |
Codecov Report
@@ Coverage Diff @@
## master #14693 +/- ##
==========================================
- Coverage 77.51% 77.46% -0.05%
==========================================
Files 958 959 +1
Lines 48560 48733 +173
Branches 5703 6115 +412
==========================================
+ Hits 37642 37752 +110
- Misses 10718 10778 +60
- Partials 200 203 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@kgabryje i believe in the original implementation, when there are multiple tabs, tabs light up if any charts in that tab is mapped to a specific filter. |
@graceguo-supercat @junlincc Thank you for your comments! The charts inside of tabs are correctly highlighted. However, if a chart in filter's scope is in an inactive tab, that tab doesn't get highlighted - I'll try to implement that. |
@@ -72,7 +72,7 @@ const DashboardContainer: FC<DashboardContainerProps> = ({ topLevelTabs }) => { | |||
activeKey={activeKey} | |||
renderTabBar={() => <></>} | |||
fullWidth={false} | |||
animated | |||
animated={false} |
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 disabled animation as it was breaking native filters - when user switched tab, margin-left: 100%
style was set on tab content, which was covering native filters panel, causing the user to be unable to click native filters... And the animation looked ugly with native filters panel anyway 😛
got it, that was in the design but never implemented....😅 ;let's spend a day or 2 to add this feature in a seperate PR
|
For filter_box, we don't highlight tabs when only charts inside inactive tab will be impacted. We had this behavior is because filter_box could be placed inside tab. So that if a filter_box only has smaller tab scope, it should be placed inside the tab. It is possible that user sets a filter_box is applicable to multiple tabs but hide the filter_box inside a nested tab, but this case is small (why would someone do that?) For build-in filter components, things are a little different: every filter component become globally visible in the dashboard, not matter it is applicable to single nested tab or multiple top-level tabs. This change might need us to think about the highlight behavior:
|
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.
A few non-blocking comments, LGTM!
export interface SetBooststapData { | ||
export interface SetBootstrapData { |
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 gave me fond memories of C++ https://www.boost.org/
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.
😆 Ah boost... I remember that I was so happy when C++11 (I think?) was released and they added a lot of stuff from boost to std 😄
setFocusedFilter: () => void; | ||
unsetFocusedFilter: () => void; |
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.
Simplification idea: we could move the setDataMask
, setFocusedFilter
and unsetFocusedFilter
into a shared interface/type PluginFilterHooks
in filters/components/types.ts
and then just &
them into PluginFilterGroupByProps
and the others.
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.
Good point, done!
height: ${({ height }) => height}px; | ||
width: ${({ width }) => width}px; |
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.
oh one of these again 👍
for current iteration - we will grey out filters that are not scoped to tabs from the filter bar, as just a visual suggestion that the specific filter won’t apply in the current scope(instead of disabling it). This should reach feature parity with filter box highlighting behavior For range filter, blue circle will be greyed out; for time range, color darker grey on hovering Above change will be made in separate PRs We can discuss next iteration, including grouping or foldering filters to tabs(but not now). 🙏 @kgabryje please go ahead and merge your PR, I will take a deeper look once multiple native filter PRs are all merged. |
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.
approving a batch of native filter PRs, will test all as a whole ASAP.
…ter (apache#14693) * Highlight charts affected by focused native filter * Remove tabs animation on dashboard * Remove a test that checks for "animated={true}" prop on tabs * Move hooks types to a separate interface (cherry picked from commit c831655)
This feature is very intuitive and useful for dashboard users. |
I don't believe this PR made it into 1.2 - however, this should be available in 1.3 (forthcoming) |
…ter (apache#14693) * Highlight charts affected by focused native filter * Remove tabs animation on dashboard * Remove a test that checks for "animated={true}" prop on tabs * Move hooks types to a separate interface
…ter (apache#14693) * Highlight charts affected by focused native filter * Remove tabs animation on dashboard * Remove a test that checks for "animated={true}" prop on tabs * Move hooks types to a separate interface
…ter (apache#14693) * Highlight charts affected by focused native filter * Remove tabs animation on dashboard * Remove a test that checks for "animated={true}" prop on tabs * Move hooks types to a separate interface
SUMMARY
When user focuses on a native filter (hovers over it or opens select menu), highlight all charts in scope of that native filter (by adding a box shadow around it) and hide the charts outside of scope (by setting opacity to 0.3).
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2021-05-18.at.17.54.47.mov
TEST PLAN
Set
DASHBOARD_NATIVE_FILTERS
feature flag to true.Add some native filters to the dashboard - be creative with setting their scopes 🙂
Verify that when you hover over Range or Time filter buttons, charts inside the scopes of those filters get highlighted and all other charts are less visible.
Verify that when you open a select menu of Select, Time Column, Time Grain and Group By filters, charts inside the scopes of those filters get highlighted and all other charts are less visible.
ADDITIONAL INFORMATION
CC: @junlincc @villebro @suddjian