Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Add local storage persist layout for code insight dashboards#50301

Merged
vovakulikov merged 4 commits into
mainfrom
vk/save-insights-order-and-size
Apr 5, 2023
Merged

Add local storage persist layout for code insight dashboards#50301
vovakulikov merged 4 commits into
mainfrom
vk/save-insights-order-and-size

Conversation

@vovakulikov

@vovakulikov vovakulikov commented Apr 3, 2023

Copy link
Copy Markdown
Contributor

Partially closes https://github.com/sourcegraph/sourcegraph/issues/29960

This PR adds local storage based persist logic for the code insight dashboard grid system. Here are a few thoughts to keep in mind about this change

  • First of all, it doesn't close https://github.com/sourcegraph/sourcegraph/issues/29960 completely because it uses just your local storage, so it's possible that the same dashboard will be in different modes if you're looking at this from two different browsers
  • All insights dashboard doesn't support order, and size persist because pagination and generic content of this dashboard requires more changes that we can't afford at the moment
  • Remember that our current grid system (even before this PR) doesn't support compact horizontal logic, so it's possible to see gaps between gaps. It works vertically, though, but it doesn't work for x-axes. Also requires some time to improve this

Test plan

  • Go to any code insights dashboard
  • Change size and order
  • Refresh the page or go away from this dashboard and go back to it
  • Check that insights are in the same places where you put them last time
  • Add new insights and remove some insights from the dashboard
  • Grid system shouldn't be broken after all actions (add/remove)
  • Check that "reset grid layout" button resets grid cards order and sizes and after refresh you see no custom layout

App preview:

Check out the client app preview documentation to learn more.

@vovakulikov vovakulikov self-assigned this Apr 3, 2023
@cla-bot cla-bot Bot added the cla-signed label Apr 3, 2023
@vovakulikov

Copy link
Copy Markdown
Contributor Author

@coury-clark @chwarwick I also was thinking about having a button that will reset the standard grid sizes and order in case you completely messed up with your dashboard grid and want to get everything to the initial state.

@vovakulikov vovakulikov marked this pull request as ready for review April 3, 2023 20:23
@sourcegraph-bot

sourcegraph-bot commented Apr 3, 2023

Copy link
Copy Markdown
Contributor

Codenotify: Notifying subscribers in CODENOTIFY files for diff 5948de9...c0c3749.

No notifications.

@vovakulikov vovakulikov force-pushed the vk/save-insights-order-and-size branch from 3bd210d to 3916155 Compare April 4, 2023 13:37
@vovakulikov vovakulikov merged commit 0a1f8e7 into main Apr 5, 2023
@vovakulikov vovakulikov deleted the vk/save-insights-order-and-size branch April 5, 2023 15:31
almeidapaulooliveira pushed a commit that referenced this pull request Apr 6, 2023
Partially closes https://github.com/sourcegraph/sourcegraph/issues/29960

This PR adds local storage based persist logic for the code insight
dashboard grid system. Here are a few thoughts to keep in mind about
this change
- First of all, it doesn't close
https://github.com/sourcegraph/sourcegraph/issues/29960 completely
because it uses just your local storage, so it's possible that the same
dashboard will be in different modes if you're looking at this from two
different browsers
- All insights dashboard doesn't support order, and size persist because
pagination and generic content of this dashboard requires more changes
that we can't afford at the moment
- Remember that our current grid system (even before this PR) doesn't
support compact horizontal logic, so it's possible to see gaps between
gaps. It works vertically, though, but it doesn't work for x-axes. Also
requires some time to improve this

## Test plan
- Go to any code insights dashboard
- Change size and order 
- Refresh the page or go away from this dashboard and go back to it 
- Check that insights are in the same places where you put them last
time
- Add new insights and remove some insights from the dashboard
- Grid system shouldn't be broken after all actions (add/remove)
- Check that "reset grid layout" button resets grid cards order and
sizes and after refresh you see no custom layout
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Insights placeholder: dashboard keep order and size

4 participants