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.
π Workflow runs π Branch on GitHub
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.
π Workflow runs π Branch on GitHub
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];
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.
π Workflow runs π Branch on GitHub
Rebase