From 31b2d9a9e13ab63d21217263fe7bd710d6fdfe68 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Wed, 19 Feb 2025 10:05:34 +0100 Subject: [PATCH] Navigate users to latest revision of a patch 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. --- src/views/repo/Patch.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/views/repo/Patch.svelte b/src/views/repo/Patch.svelte index 0a0e05666..d4f519a4e 100644 --- a/src/views/repo/Patch.svelte +++ b/src/views/repo/Patch.svelte @@ -80,7 +80,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(() => { @@ -93,7 +95,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];