From 0fc9c4e6a43ea7b5c3282012b9e0fb6fe867a09b Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 18 Feb 2026 07:35:47 +0100 Subject: [PATCH] Use non-null assertions for guaranteed tooltip attributes Co-Authored-By: Claude Opus 4.6 --- web_src/js/features/repo-diff.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_src/js/features/repo-diff.ts b/web_src/js/features/repo-diff.ts index d4b5d03092..9a824adb31 100644 --- a/web_src/js/features/repo-diff.ts +++ b/web_src/js/features/repo-diff.ts @@ -320,7 +320,7 @@ async function expandAllLines(btn: HTMLElement, fileBox: HTMLElement) { // Update button to "collapse" state btn.innerHTML = svg('octicon-fold', 14); - const collapseTooltip = btn.getAttribute('data-collapse-tooltip') ?? ''; + const collapseTooltip = btn.getAttribute('data-collapse-tooltip')!; btn.setAttribute('data-tooltip-content', collapseTooltip); showTemporaryTooltip(btn, collapseTooltip); } @@ -338,7 +338,7 @@ function collapseExpandedLines(btn: HTMLElement, fileBox: HTMLElement) { // Update button to "expand" state btn.innerHTML = svg('octicon-unfold', 14); - const expandTooltip = btn.getAttribute('data-expand-tooltip') ?? ''; + const expandTooltip = btn.getAttribute('data-expand-tooltip')!; btn.setAttribute('data-tooltip-content', expandTooltip); showTemporaryTooltip(btn, expandTooltip); }