-
Notifications
You must be signed in to change notification settings - Fork 61
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
Ability to Pin Views #739
Ability to Pin Views #739
Conversation
hriday-panchasara
commented
Apr 26, 2022
•
edited
Loading
edited
- Add Ability to pin views to the top of the layout so that they stay visible when scrolling
- Current implementation is to allow pinning only one view at a time
- View is scrolled into focus when pinned/unpinned
- Pinned view persists when page refreshed
- Added additional resize handlers to pinned view in case height exceeds page length
8bcdce8
to
904d67b
Compare
904d67b
to
59567ef
Compare
Our current layout is using two containers - one for timeline-charts and below it one for non-timeline-charts. In order to show a pinned view I've added another container on top of these two, so that any view when pinned would move to this top container without breaking the existing layout. The only issue is that when we re-render trace-context-component to show this new layout, the new Virtual DOM tree shows that an output is added to / removed from the pinned views container, hence re-rendering the output-view that just got pinned/unpinned. Since we don't keep track of the of the output component's tree, we lose the selections that are made. A future improvement could be to persist the state of the abstract-tree-output component |
Nice feature! |
I think it would be beneficial to persist the state of view that's being pinned and unpinned. When running this change, I expected that the view is just re-arranged to the top, but nothing else changes. Having to redo the selections in the tree or scrolling vertically doesn't provide a good UX. It should just behave like moving the output component manually with the left mouse button drag. @hriday-panchasara what to you suggest as next steps to also achieve this? |
Thanks @bhufmann , unfortunately I'm not sure how to pin/unpin views without losing track of state. I tried experimenting with react-grid-layout, but the only way I found to keep a view visible while scrolling was to put it in a separate container and make that container static through CSS. For non-timescale layouts the state can be persisted as datatree-output-component is static and events-table reflects the selected events in the timerange. We can think of a future enhancement to have an option to keep track of abstract-tree-output-component's state on rerender. Since we're only providing the ability to pin one view at the time, and it can only be accessed by the options menu, I'm assuming that toggling pin/unpin won't be used excessively and losing state is a small drawback that we can consider. |
7c0e427
to
d25e2c6
Compare
d25e2c6
to
bce71d3
Compare
I think loosing the state would not be a good UX. However, I'm ok that we work on merging this PR and have a separate PR for keeping the state. |
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 tested it and it works well. The location of the pin feels a bit out of place (see picture below). It should be aligned next to the hamburger menu. It should also show some tooltip to indicate what it means when users hover over it with the mouse. Could we even make it a button to unpin?
Secondly, when pinning the events table it is shown under time axis. Could we move it and other non-time-axis views above the axis instead when pinning? Time-axis views (timegraph or XY) would stay below the time axis.
I just noticed that the following error was in the console log. Not exactly sure when it happened (maybe during unpin):
Have you seen that? |
Current implementation is to allow pinning only one view at a time View is scrolled into focus when pinned/unpinned Pinned view persists on page refresh Added additional resize handlers to pinned view in case height exceeds page length Signed-off-by: hriday-panchasara <hriday.panchasara@ericsson.com>
fae9613
to
2454cfd
Compare
Yeah, I see it only when performing pin/unpin on the events table. Fixed the issue |
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 to me. Thanks!