Radish alpha
r
rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5
Radicle web interface
Radicle
Git
Re-use project-level data when browsing source code
Merged did:key:z6Mki9XN...FvWF opened 2 years ago

We make source code browsing faster by re-using project-level data when navigating between files. This comes at a cost: Project info (like the issue counter), remotes and branches are only updated when the page is hard-refreshed or the user navigates away from the source code view.

did:key:z6Mki9XN...FvWF opened with revision 5ef47662 on base eb0013ef +51 -13 2 years ago

We make source code browsing faster by re-using project-level data when navigating between files. This comes at a cost: Project info (like the issue counter), remotes and branches are only updated when the page is hard-refreshed or the user navigates away from the source code view.

did:key:z6MkkfM3...sVz5 commented on revision 1 2 years ago

I think we can accept the cost of not always having the latest data, since when user expect an update they are quick to hard-refresh. In favor of reducing the requests I would let user complain if they are bothered by this.

Just one minor nit, I would add the types to projectPromise and peersPromise

diff --git a/src/views/projects/router.ts b/src/views/projects/router.ts
index ea584b28..c3a4f570 100644
--- a/src/views/projects/router.ts
+++ b/src/views/projects/router.ts
@@ -420,8 +420,8 @@ async function loadTreeView(
       route.project
     }${commit ? `/${commit}` : ""}`;
 
-  let projectPromise;
-  let peersPromise;
+  let projectPromise: Promise<Project>;
+  let peersPromise: Promise<Remote[]>;
   if (
     previousLoaded.resource === "project.source" &&
     previousLoaded.params.project.id === route.project &&
did:key:z6Mki9XN...FvWF pushed revision 2 c06cf96d on base eb0013ef +51 -13 2 years ago
did:key:z6MkkfM3...sVz5 accepted 2 years ago

Thanks for addressing my comment, looks good to merge for me

rudolfs pushed revision 3 aa4c12dd on base dcced2e0 +51 -13 2 years ago

Rebase.

rudolfs merged revision aa4c12dd at 69429cb0 2 years ago