From 8a8509a0f3444597fa449ec0536f25fa44a38166 Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sun, 17 May 2026 21:10:26 +0200 Subject: [PATCH] feat(notes): surface GitHub auth-expired state on freshness badge Show a cloud-lock badge with a re-sign-in tooltip when the freshness check resolves to unauthorized, and toast on badge click so the user gets explicit feedback instead of a silent retry-loop. --- src/components/NoteFreshnessBadge.vue | 27 +++++++++++++++++++++++++++ src/components/StackedNote.vue | 7 +++++++ 2 files changed, 34 insertions(+) diff --git a/src/components/NoteFreshnessBadge.vue b/src/components/NoteFreshnessBadge.vue index 40d582b..415e975 100644 --- a/src/components/NoteFreshnessBadge.vue +++ b/src/components/NoteFreshnessBadge.vue @@ -23,6 +23,8 @@ const label = computed(() => { return "Outdated" case "offline": return "Can’t reach GitHub" + case "unauthorized": + return "Sign in to GitHub" case "unknown": default: return "Not checked" @@ -39,6 +41,8 @@ const tooltip = computed(() => { return "GitHub has a newer version. Click to pull latest." case "offline": return "Could not reach GitHub. Click to retry." + case "unauthorized": + return "GitHub auth expired. Sign in again, then click to retry." case "checking": return "Checking against GitHub…" case "unknown": @@ -133,6 +137,25 @@ const isBusy = computed(() => props.status === "checking") > + + + + + props.status === "checking") color: var(--color-error, hsl(0, 70%, 45%)); } +.state-unauthorized { + color: var(--color-warning, hsl(35, 90%, 45%)); +} + .state-unknown, .state-checking { color: var(--color-base-content); diff --git a/src/components/StackedNote.vue b/src/components/StackedNote.vue index efede40..e2b18e6 100644 --- a/src/components/StackedNote.vue +++ b/src/components/StackedNote.vue @@ -228,6 +228,9 @@ const onBadgeClick = async () => { try { if (freshnessStatus.value !== "outdated") { await checkFreshness() + if (freshnessStatus.value === "unauthorized") { + errorMessage("🔐 GitHub auth expired — please sign in again") + } return } @@ -241,6 +244,10 @@ const onBadgeClick = async () => { if (newRaw !== null) { rawContent.value = newRaw initialRawContent.value = newRaw + return + } + if (freshnessStatus.value === "unauthorized") { + errorMessage("🔐 GitHub auth expired — please sign in again") } } catch (error) { console.error("freshness badge click failed", error)