Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

michael-s-molina
Copy link
Member

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

  • Has associated issue:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@michael-s-molina michael-s-molina changed the title Fix: Aligns top level tabs when native filters are enabled fix: Aligns top level tabs when native filters are enabled Jun 4, 2021
@codecov
Copy link

codecov bot commented Jun 4, 2021

Codecov Report

Merging #14987 (99879fd) into master (6955ed2) will increase coverage by 0.06%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            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     
Flag Coverage Δ
javascript 72.64% <75.00%> (+0.15%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...nd/src/dashboard/containers/DashboardComponent.jsx 92.30% <ø> (ø)
...end/src/dashboard/components/StickyVerticalBar.tsx 46.66% <33.33%> (-3.34%) ⬇️
...d/components/DashboardBuilder/DashboardBuilder.tsx 86.59% <75.00%> (-0.50%) ⬇️
...d/src/dashboard/components/gridComponents/Tabs.jsx 87.50% <100.00%> (+0.12%) ⬆️
...board/components/nativeFilters/FilterBar/index.tsx 100.00% <100.00%> (ø)
...et-frontend/src/dashboard/actions/nativeFilters.ts 82.69% <0.00%> (+1.84%) ⬆️
...end/src/filters/components/Range/transformProps.ts 100.00% <0.00%> (+87.50%) ⬆️
...src/filters/components/Range/RangeFilterPlugin.tsx 88.67% <0.00%> (+88.67%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6955ed2...99879fd. Read the comment docs.

@junlincc junlincc added the dashboard:native-filters Related to the native filters of the Dashboard label Jun 4, 2021
@kgabryje
Copy link
Member

kgabryje commented Jun 7, 2021

What do you think about making it look like this?
image

I'm not sure if I like that empty space on the left side of the bar with top level tabs

const tabsPaddingLeft =
nativeFiltersEnabled && !editMode && dashboardFiltersOpen
? NATIVE_FILTER_BAR_WIDTH + 20
: 8;
Copy link
Member

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;
Copy link
Member

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?

Copy link
Member Author

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.

@michael-s-molina
Copy link
Member Author

What do you think about making it look like this?
image

I'm not sure if I like that empty space on the left side of the bar with top level tabs

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"
Copy link
Member

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?

@kgabryje
Copy link
Member

kgabryje commented Jun 7, 2021

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?

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

@villebro
Copy link
Member

villebro commented Jun 7, 2021

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?

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 DASHBOARD_FILTERS_EXPERIMENTAL feature flag. While placing a filter component close to charts within scope can feel intuitive, I personally feel the new in/out of scope logic introduced by #14933 provides a better UX and makes it easier to quickly check which filters are available and in scope.

@suddjian
Copy link
Member

suddjian commented Jun 7, 2021

@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.

@junlincc
Copy link
Member

junlincc commented Jun 7, 2021

image

@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!

@junlincc
Copy link
Member

junlincc commented Jun 7, 2021

@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

@junlincc junlincc added the hold! On hold label Jun 7, 2021
@michael-s-molina
Copy link
Member Author

I'm closing this PR and opening a new one with the proposed solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard:native-filters Related to the native filters of the Dashboard hold! On hold size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[native-filters]expanding filter bar should push top-level tabs along with main dashboard to the right
5 participants