-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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: New time range label #22317
feat: New time range label #22317
Conversation
superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #22317 +/- ##
==========================================
- Coverage 66.89% 66.87% -0.02%
==========================================
Files 1847 1847
Lines 70333 70422 +89
Branches 7702 7726 +24
==========================================
+ Hits 47047 47093 +46
- Misses 21288 21327 +39
- Partials 1998 2002 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
} else { | ||
const tooltipTitle = labelIsTruncated ? ( | ||
<> |
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.
Is this fragment necessary?
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.
Nope! Removed
}; | ||
|
||
// This is the color that antd components (such as Select or Input) use on hover | ||
// TODO: use theme.colors.primary.base here and in antd components |
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 just set it as the primary color already?
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 did initially, but when this component is placed next to antd components (which is the case in the filter bar), you can see the color difference when you hover. We could override antd's border colors on hover, but I'd rather we do it as a separate task since we'd need to take care of many antd components
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.
Makes sense. Thanks for the context!
There's no red border indicating a validation error. Screen.Recording.2022-12-02.at.11.40.02.AM.mov |
I love the new design! ❤️ I will look more closely later today/the weekend if this isn't merged before then. |
Well spotted @michael-s-molina! Fixed + I cleaned up some old css |
@eric-briscoe could you review as well please? |
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.
LGTM! I opened a PR to help with a tooltip bug caused by the useCSSTextTruncation
hook that shows up in this PR, but it's not related to this PR's code so no need to include here. I also noticed the same thing as in a previous PR about popovers for filters in the overflow dropdown, where clicking Cancel or Apply closes the overflow dropdown preemptively, but we already talked about fixing that in a separate PR.
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.
Leave some comments about the style and design. The new Date Label is better than before. Thanks for the improvement!
setTooltipTitle(NO_TIME_RANGE); | ||
setTooltipTitle(null); |
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.
NO_TIME_RANGE
represents a time filter constant, which means No filter
in the time filter, so I think the original tooltip title should be kept.
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.
We want tooltip to display the label text if label is truncated + the actual time range of it's different than human readable label.
In the case of no filter both the label and the tooltip said "No filter" which was redundant.
} else { | ||
const tooltipTitle = labelIsTruncated ? ( |
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.
Here, the tooltip title is either HRT(human-readable text) or ADR(actual date time range). I know the design goal is when the value is truncated, the untruncated value should be displayed in the tooltip title. In practice, the effect is weird, --- there are multiple lines but I don't know which one is HRT, and which one is ADR.
BTW, the width of the tooltips seems too narrow.
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.
Yeah in the case from your screenshot it looks weird. However, when ADR is difficult to read (like DATEADD expressions) and the HRT is cut, I think adding HRT to the tooltip is useful for the user. I'll increase the spacing between HRT and ADR in the tooltip to make it easier to read
/testenv up FEATURE_HORIZONTAL_FILTER_BAR=true |
@kgabryje Ephemeral environment spinning up at http://35.91.100.227:8080. Credentials are |
@villebro Thanks for review! Screen.Recording.2022-12-05.at.15.41.27.movAs for the "double" tooltip... that looks like html title. I'll try to remove it |
@villebro Added tooltip with actual range for Last/Previous frames Unfortunately the double tooltip is a Safari "feature" - Safari adds it automatically for truncated texts :( |
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.
LGTM!
Ephemeral environment shutdown and build artifacts deleted. |
SUMMARY
This PR implements the new design for time range pill. Functionality wise it works the same as before, except that I added additional tooltip when the label is truncated.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Screen.Recording.2022-12-02.at.16.28.07.mov
TESTING INSTRUCTIONS
Test the new time range pill in native filters (horizontal and vertical), in native filters config modal and in Explore adhoc filters.
ADDITIONAL INFORMATION