Skip to content

refactor: use the same state to power both "for current branch" tree view and status bar

Tomas Vik requested to merge 60-refresh-sidebar-and-statusbar into main

This MR creates an interface CurrentBranchInfo and then uses this interface to separate fetching of GitLab data from the rendering of the data. We then use the same fetching for both the "For Current Branch" tree view and the status bar.

In subsequent MR's we are going to:

  1. Call getState to fetch state only once and use the result for both tree view and status bar
  2. Change the refreshing logic to be more sophisticated (details in #40 (closed))

The logic is covered with tests

Before

graph LR;
A[fetch data and render tree view]
B[fetch data and render status bar]

Now

graph LR;
A["getState (called multiple times)"] --> B[render tree view]
A --> C[render status bar]

Future

graph LR;
A["getState (called once)"] --> B[render tree view]
A --> C[render status bar]

Related to #60 (closed)

Edited by Tomas Vik

Merge request reports