-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
fix: Aligns top level tabs when native filters are enabled #14987
Conversation
Codecov Report
@@ Coverage Diff @@
## master #14987 +/- ##
==========================================
+ Coverage 77.61% 77.68% +0.06%
==========================================
Files 965 965
Lines 49504 49542 +38
Branches 6259 6271 +12
==========================================
+ Hits 38425 38489 +64
+ Misses 10879 10851 -28
- Partials 200 202 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
const tabsPaddingLeft = | ||
nativeFiltersEnabled && !editMode && dashboardFiltersOpen | ||
? NATIVE_FILTER_BAR_WIDTH + 20 | ||
: 8; |
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.
Can we use theme variables here? {theme.gridUnit * 2}px
@@ -55,6 +55,7 @@ import DashboardContainer from './DashboardContainer'; | |||
|
|||
const TABS_HEIGHT = 47; | |||
const HEADER_HEIGHT = 67; | |||
const NATIVE_FILTER_BAR_WIDTH = 255; |
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.
Why 255 instead of 250?
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.
To fix the inner margin-right of the filter values. They have a fixed width.
I also think this is the best approach but it seems that we have a requirement from a client asking to nest the filters inside a top-level tab. @suddjian @junlincc can you check if we can change this requirement? |
@@ -79,6 +80,7 @@ export const StickyVerticalBar: React.FC<SVBProps> = ({ | |||
distanceFromTop: number; | |||
}) => ( | |||
<Contents | |||
id="sticky-vertical-bar" |
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.
Do we need that id here?
I feel like that's a case that we discussed some time ago - that we can't treat native filters like filter box with slightly different UI. I think that native filters are "global" to the dashboard by design and the panel doesn't belong to a single top level tab. Scoping of some filters to a tab have been addressed by highlighting tabs and hiding filters that are out of scope, so we don't need to nest the native filters panel to indicate that it belongs to some tab. Though let's wait for an opinion from product point of view 🙂 cc @junlincc |
The possibility to place native filters on the dashboard layout (similar to Filter Box) is outside the scope of Native Filters - those that want to do that can enable the |
@michael-s-molina I agree. The design with the filters outside of tabs better communicates to the user how the filters interact with the rest of the application, so we should do that. |
@michael-s-molina please proceed this new design, this is much better. 🙏 thank you all for offering suggestions. I think we can merge this PR first though! |
@michael-s-molina Hi Michael, dashboard top right tab and dashboard are not aligned perfectly especially on resize. could we address in this or the new design pr? Screen.Recording.2021-06-07.at.11.16.11.AM.mov |
I'm closing this PR and opening a new one with the proposed solution. |
SUMMARY
Fixes #14973
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
See the original issue for before screenshots.
20210604100632295.mp4
@villebro @junlincc
TESTING INSTRUCTIONS
1 - Enable the native filters
2 - Open a dashboard with top-level tabs
3 - Expand the native filters
4 - The top-level tabs should be aligned with the dashboard content
ADDITIONAL INFORMATION