Radish alpha
r
rad:z4D5UCArafTzTQpDZNQRuqswh3ury
Radicle desktop app
Radicle
Git
Navigate users to latest revision of a patch
Merged did:key:z6MkkfM3...sVz5 opened 1 year ago

EDIT: Moved the patch to draft state, since we eventually want to get the user to the latest revision of a delegate or patch author

Instead of displaying the first revision of a patch, we should in general send users to the latest revision of a patch and let user then decide if they want to get more context.

checkcheck-unit-testcheck-e2e

πŸ‘‰ Workflow runs πŸ‘‰ Branch on GitHub

did:key:z6MkkfM3...sVz5 opened with revision b3de30a5 on base 15bb0353 +2 -2 1 year ago

EDIT: Moved the patch to draft state, since we eventually want to get the user to the latest revision of a delegate or patch author

Instead of displaying the first revision of a patch, we should in general send users to the latest revision of a patch and let user then decide if they want to get more context.

checkcheck-unit-testcheck-e2e

πŸ‘‰ Workflow runs πŸ‘‰ Branch on GitHub

rudolfs reviewed Β· 1 comment 1 year ago

This doesn’t work when there’s only one revision. You probably want something like this:

diff --git a/src/views/repo/Patch.svelte b/src/views/repo/Patch.svelte
index 5400987..14dffac 100644
--- a/src/views/repo/Patch.svelte
+++ b/src/views/repo/Patch.svelte
@@ -76,7 +76,9 @@
   let updatedTitle = $state("");
   let labelSaveInProgress: boolean = $state(false);
   let assigneesSaveInProgress: boolean = $state(false);
-  let tab: "patch" | "revisions" | "timeline" = $state("patch");
+  let tab: "patch" | "revisions" | "timeline" = $state(
+    revisions.length > 1 ? "revisions" : "patch",
+  );
   let selectedRevision: Revision = $state(revisions.slice(-1)[0]);

   $effect(() => {
@@ -89,7 +91,7 @@
     // eslint-disable-next-line @typescript-eslint/no-unused-expressions
     patch.id;

-    tab = "patch";
+    tab = revisions.length > 1 ? "revisions" : "patch";
     editingTitle = false;
     updatedTitle = patch.title;
     selectedRevision = revisions.slice(-1)[0];
did:key:z6MkkfM3...sVz5 pushed revision 2 43606c4c on base e82e333c +4 -2 1 year ago

Only go for revisions tab if there is more than one revision.

Very simple and just a dogfood improvement. Will write an issue that we should always go to the latest revision by patch author or delegate.

checkcheck-unit-testcheck-e2e

πŸ‘‰ Workflow runs πŸ‘‰ Branch on GitHub

rudolfs pushed revision 3 5d9de7ec on base 618ae682 +4 -2 1 year ago

Rebase

rudolfs accepted 1 year ago
rudolfs merged revision 5d9de7ec at 31b2d9a9 1 year ago