From 81dcac4097ffbba922752156bdfa3cb1d74b874a Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Sun, 8 Mar 2026 22:21:43 -0700 Subject: [PATCH] Persist diff view toggle with localStorage --- src/commands/diff.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/diff.html b/src/commands/diff.html index 3e39f6b..20ad8c0 100644 --- a/src/commands/diff.html +++ b/src/commands/diff.html @@ -75,9 +75,12 @@ } } - renderAll("side-by-side"); + const saved = localStorage.getItem("sandlot-unified") === "1"; + toggle.checked = saved; + renderAll(saved ? "line-by-line" : "side-by-side"); toggle.addEventListener("change", function () { + localStorage.setItem("sandlot-unified", this.checked ? "1" : "0"); renderAll(this.checked ? "line-by-line" : "side-by-side"); });