-
Notifications
You must be signed in to change notification settings - Fork 621
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(webapp): Issue when comparison / diff timelines are out of range #1615
Conversation
Codecov ReportBase: 66.10% // Head: 66.52% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1615 +/- ##
==========================================
+ Coverage 66.10% 66.52% +0.43%
==========================================
Files 146 152 +6
Lines 4987 5113 +126
Branches 1144 1179 +35
==========================================
+ Hits 3296 3401 +105
- Misses 1685 1706 +21
Partials 6 6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
size-limit report 📦
|
I think we can solve this at a different level. if the interval |
@eh-am I think your variant is really good, interesting what @Rperry2174 thinks about it. and what is possible appearance and position of this alert? |
0f6c08d
to
795a064
Compare
/create-server |
I can add tests after your review |
Lets do the following:
The logic behind 2 is that this issue most frequently occurs when the main timeline is dynamic, but the comparison sub-timeline's are fixed and so we should adjust the main timeline to fit those |
94adaa2
to
e4e60b1
Compare
/create-server |
/create-server |
hey guys, demo shows previous commit version. caching issue? |
Looking at the commit I think its the correct version... what makes you think its the wrong version? |
Looks great a couple of tweaks here:
For the colors lets do (and let's make sure these are variables as well):
For the text let's change it to be a little more specific:
|
/create-server |
There's currently an issue where when you select a time range after the default time ranges load, you get the error message because the pink timerange is almost immediately "out of range". In order to prevent this, let's change the logic so that there is a "buffer" of 5 minutes on the "minumum" side. For example: Should not show a warning message: baseline min (00:56) to main min (1:00) is 4 minutes which is < 5 minute buffer so do not show a warning message Should show a warning message: baseline min (00:54) to main min (1:30) is 6 minutes whic is > 5 minute buffer so do show a warning message Let's for now put this "buffer" in a variable and we may adjust this buffer later, but it should fix the problem for now. |
/create-server |
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.
Looks good! I have few thoughts though:
RE: reusability
- There's already a
StatusMessage
component, which I think can be reused here.
- Instead of creating custom buttons, we should reuse the existing button we have, and if necessary extend it in such a way that's reusable.
RE: organization
Right now it works for comparison/diff since both use left/right, but not necessarily. Let's decouple input/output, plus it becomes testable.
The API would be something like
<SyncTimelines onSync={onSync} main={mainTimeline} left={leftTimeline} right={rightTimeline} />
Since code will be pretty similar between comparison/diff, then you can add another interaction layer to reuse the same logic if that helps. But biggest point is that the syncTimelines
functionality should NOT be aware of the store/anything else. It just takes inputs and calls outputs.
Tests
Given my previous point, it will be easy to test this component. And it makes it as good documentation.
webapp/javascript/components/TimelineChart/SyncTimelines/useSync.ts
Outdated
Show resolved
Hide resolved
I updated API in this way, now this component doesn't have any connection to redux store
I use |
/create-server |
webapp/javascript/components/TimelineChart/SyncTimelines/index.tsx
Outdated
Show resolved
Hide resolved
/create-server |
/create-server |
webapp/javascript/components/TimelineChart/SyncTimelines/SyncTimelines.spec.tsx
Outdated
Show resolved
Hide resolved
webapp/javascript/components/TimelineChart/SyncTimelines/SyncTimelines.spec.tsx
Show resolved
Hide resolved
webapp/javascript/components/TimelineChart/SyncTimelines/SyncTimelines.spec.tsx
Outdated
Show resolved
Hide resolved
const [ | ||
{ | ||
xaxis: { from: leftMarkingsFrom, to: leftMarkingsTo }, | ||
}, | ||
] = markingsFromSelection('single', { | ||
...leftSelection, | ||
} as Selection); | ||
const [ | ||
{ | ||
xaxis: { from: rightMarkingsFrom, to: rightMarkingsTo }, | ||
}, | ||
] = markingsFromSelection('single', { | ||
...rightSelection, | ||
} as Selection); |
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.
My understanding is that you are using this to convert an arbitrary from/to
to a timestamp right? If so you can use https://github.com/pyroscope-io/pyroscope/blob/569091ed1a27cbe86611420b4fdf3bcdf3b330d6/webapp/javascript/util/formatDate.ts#L70-L89
not the best name i know
I am saying this bc markingsFromSelection
is all about markings, those vertical lines in the timeline:
.
Point is that that markingsFromSelection
function is purely visual. Since you don't need that aspect, you can use formatAsOBject
directly.
webapp/javascript/components/TimelineChart/SyncTimelines/useSync.ts
Outdated
Show resolved
Hide resolved
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.
Haven't looked at the code but the demo looks great!
/create-server |
Brief
Changes