License:
@@ -1022,8 +1032,8 @@
>
- Build date:
-
+ Release date:
+
Commit:
diff --git a/src/popup/views/settings.js b/src/popup/views/settings.js
index cc36a85..db5b824 100644
--- a/src/popup/views/settings.js
+++ b/src/popup/views/settings.js
@@ -160,7 +160,7 @@ function show() {
const authorName = BUILD_AUTHOR.replace(/\s*<[^>]+>/, "");
$("about-author").textContent = authorName;
$("about-version").textContent = BUILD_VERSION;
- $("about-build-date").textContent = BUILD_DATE;
+ $("about-release-date").textContent = BUILD_DATE;
$("about-commit-link").textContent = BUILD_COMMIT;
$("about-commit-link").href = GITEA_COMMIT_URL;
--
2.49.1
From be38ce081e15de8432d12acc9e378d3db12c6ab0 Mon Sep 17 00:00:00 2001
From: user
Date: Sun, 1 Mar 2026 13:05:55 -0800
Subject: [PATCH 4/5] refactor: derive git info inside Docker instead of
--build-arg
- Remove .git from .dockerignore so it's available in Docker build context
- Install git in Docker image (apt-get)
- Remove ARG/ENV GIT_COMMIT_SHORT/FULL from Dockerfile
- Remove --build-arg from Makefile docker target
- Simplify build.js to use git CLI directly (no env var indirection)
build.js already had fallback logic to shell out to git; now that .git
is present in the build context, it works directly without needing
values passed in from outside Docker.
---
.dockerignore | 1 -
Dockerfile | 7 +------
Makefile | 5 +----
build.js | 32 ++++++++++++++------------------
4 files changed, 16 insertions(+), 29 deletions(-)
diff --git a/.dockerignore b/.dockerignore
index 7452cbb..da592f8 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,4 +1,3 @@
-.git
node_modules
.DS_Store
dist
diff --git a/Dockerfile b/Dockerfile
index b2cf0b6..bb7d041 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,7 @@
# node:22-slim (22.x LTS), 2026-02-24
FROM node@sha256:5373f1906319b3a1f291da5d102f4ce5c77ccbe29eb637f072b6c7b70443fc36
-RUN apt-get update && apt-get install -y --no-install-recommends make && rm -rf /var/lib/apt/lists/*
+RUN apt-get update && apt-get install -y --no-install-recommends make git && rm -rf /var/lib/apt/lists/*
RUN corepack enable && corepack prepare yarn@1.22.22 --activate
WORKDIR /app
@@ -11,10 +11,5 @@ RUN yarn install --frozen-lockfile
COPY . .
-ARG GIT_COMMIT_SHORT=unknown
-ARG GIT_COMMIT_FULL=unknown
-ENV GIT_COMMIT_SHORT=${GIT_COMMIT_SHORT}
-ENV GIT_COMMIT_FULL=${GIT_COMMIT_FULL}
-
RUN make check
RUN make build
diff --git a/Makefile b/Makefile
index 4d596a1..ff9ffe8 100644
--- a/Makefile
+++ b/Makefile
@@ -33,10 +33,7 @@ dev:
@yarn run build --watch 2>&1
docker:
- @docker build \
- --build-arg GIT_COMMIT_SHORT=$$(git rev-parse --short HEAD 2>/dev/null || echo unknown) \
- --build-arg GIT_COMMIT_FULL=$$(git rev-parse HEAD 2>/dev/null || echo unknown) \
- -t autistmask .
+ @docker build -t autistmask .
hooks:
@echo "Installing pre-commit hook..."
diff --git a/build.js b/build.js
index 4fd43d3..54c1179 100644
--- a/build.js
+++ b/build.js
@@ -15,25 +15,21 @@ function getBuildInfo() {
const pkg = JSON.parse(
fs.readFileSync(path.join(__dirname, "package.json"), "utf8"),
);
- let commitHash = process.env.GIT_COMMIT_SHORT || "unknown";
- if (commitHash === "unknown") {
- try {
- commitHash = execSync("git rev-parse --short HEAD", {
- encoding: "utf8",
- }).trim();
- } catch (_) {
- // not a git repo or git not available
- }
+ let commitHash = "unknown";
+ try {
+ commitHash = execSync("git rev-parse --short HEAD", {
+ encoding: "utf8",
+ }).trim();
+ } catch (_) {
+ // not a git repo or git not available
}
- let commitHashFull = process.env.GIT_COMMIT_FULL || "unknown";
- if (commitHashFull === "unknown") {
- try {
- commitHashFull = execSync("git rev-parse HEAD", {
- encoding: "utf8",
- }).trim();
- } catch (_) {
- // not a git repo or git not available
- }
+ let commitHashFull = "unknown";
+ try {
+ commitHashFull = execSync("git rev-parse HEAD", {
+ encoding: "utf8",
+ }).trim();
+ } catch (_) {
+ // not a git repo or git not available
}
return {
version: pkg.version,
--
2.49.1
From d6a6e24c4ee968b8c5bd0544385ef8250b34e165 Mon Sep 17 00:00:00 2001
From: clawbot
Date: Sun, 1 Mar 2026 15:21:51 -0800
Subject: [PATCH 5/5] fix: make debug mode toggle work at runtime
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The debug/insecure warning banner was only controlled by the compile-time
DEBUG constant. The settings easter egg checkbox toggled state.debugMode
and the runtime log flag, but neither index.js nor helpers.js checked
these runtime values — the banner was created/updated based solely on
the compile-time constant.
Changes:
- Extract banner logic into updateDebugBanner() in helpers.js that
checks isDebug() (combines compile-time DEBUG and runtime debugMode)
- Banner is dynamically created/removed: appears when debug is enabled,
removed when disabled (no stale banners)
- index.js init() syncs runtime debug flag from persisted state before
first render, then delegates to updateDebugBanner()
- settings.js calls updateDebugBanner() after the checkbox change so
the banner immediately reflects the new state
- Debug mode persists across popup close/reopen via state.debugMode
Fixes the bug where the settings debug toggle had no visible effect.
---
src/popup/index.js | 23 +++++++-------------
src/popup/views/helpers.js | 42 +++++++++++++++++++++++++++----------
src/popup/views/settings.js | 4 +++-
3 files changed, 41 insertions(+), 28 deletions(-)
diff --git a/src/popup/index.js b/src/popup/index.js
index 6f8f6d2..8b72d05 100644
--- a/src/popup/index.js
+++ b/src/popup/index.js
@@ -1,18 +1,19 @@
// AutistMask popup entry point.
// Loads state, initializes views, triggers first render.
-const { DEBUG } = require("../shared/constants");
const {
state,
saveState,
loadState,
currentNetwork,
} = require("../shared/state");
+const { isDebug, setRuntimeDebug } = require("../shared/log");
const { refreshPrices } = require("../shared/prices");
const { refreshBalances } = require("../shared/balances");
const {
$,
showView,
+ updateDebugBanner,
setRenderMain,
pushCurrentView,
goBack,
@@ -209,21 +210,11 @@ async function init() {
await loadState();
applyTheme(state.theme);
- const net = currentNetwork();
- if (DEBUG || net.isTestnet) {
- const banner = document.createElement("div");
- banner.id = "debug-banner";
- if (DEBUG && net.isTestnet) {
- banner.textContent = "DEBUG / INSECURE [TESTNET]";
- } else if (net.isTestnet) {
- banner.textContent = "[TESTNET]";
- } else {
- banner.textContent = "DEBUG / INSECURE";
- }
- banner.style.cssText =
- "background:#c00;color:#fff;text-align:center;font-size:10px;padding:1px 0;font-family:monospace;position:sticky;top:0;z-index:9999;";
- document.body.prepend(banner);
- }
+ // Sync runtime debug flag from persisted state before first render
+ setRuntimeDebug(state.debugMode);
+
+ // Create the debug/testnet banner if needed (uses runtime debug state)
+ updateDebugBanner();
// Auto-default active address
if (
diff --git a/src/popup/views/helpers.js b/src/popup/views/helpers.js
index e4744ef..fc9f2f9 100644
--- a/src/popup/views/helpers.js
+++ b/src/popup/views/helpers.js
@@ -1,6 +1,7 @@
// Shared DOM helpers used by all views.
const { DEBUG } = require("../../shared/constants");
+const { isDebug } = require("../../shared/log");
const {
formatUsd,
getPrice,
@@ -59,19 +60,37 @@ function showView(name) {
clearFlash();
state.currentView = name;
saveState();
+ updateDebugBanner(name);
+}
+
+// Create or update the debug/insecure warning banner.
+// Called on every view switch and after the settings debug toggle changes.
+// The banner is shown when the compile-time DEBUG constant is true OR when
+// the user has enabled runtime debug mode via the settings easter egg, OR
+// when the active network is a testnet.
+function updateDebugBanner(viewName) {
+ const debug = isDebug();
const net = currentNetwork();
- if (DEBUG || net.isTestnet) {
- const banner = document.getElementById("debug-banner");
- if (banner) {
- if (DEBUG && net.isTestnet) {
- banner.textContent =
- "DEBUG / INSECURE [TESTNET] (" + name + ")";
- } else if (net.isTestnet) {
- banner.textContent = "[TESTNET]";
- } else {
- banner.textContent = "DEBUG / INSECURE (" + name + ")";
- }
+ const show = debug || net.isTestnet;
+ let banner = document.getElementById("debug-banner");
+ if (show) {
+ if (!banner) {
+ banner = document.createElement("div");
+ banner.id = "debug-banner";
+ banner.style.cssText =
+ "background:#c00;color:#fff;text-align:center;font-size:10px;padding:1px 0;font-family:monospace;position:sticky;top:0;z-index:9999;";
+ document.body.prepend(banner);
}
+ const suffix = viewName ? " (" + viewName + ")" : "";
+ if (debug && net.isTestnet) {
+ banner.textContent = "DEBUG / INSECURE [TESTNET]" + suffix;
+ } else if (net.isTestnet) {
+ banner.textContent = "[TESTNET]" + suffix;
+ } else {
+ banner.textContent = "DEBUG / INSECURE" + suffix;
+ }
+ } else if (banner) {
+ banner.remove();
}
}
@@ -417,6 +436,7 @@ module.exports = {
showError,
hideError,
showView,
+ updateDebugBanner,
setRenderMain,
pushCurrentView,
goBack,
diff --git a/src/popup/views/settings.js b/src/popup/views/settings.js
index db5b824..576c251 100644
--- a/src/popup/views/settings.js
+++ b/src/popup/views/settings.js
@@ -1,6 +1,7 @@
const {
$,
showView,
+ updateDebugBanner,
showFlash,
escapeHtml,
flashCopyFeedback,
@@ -372,11 +373,12 @@ function init(ctx) {
}
});
- // Debug mode toggle
+ // Debug mode toggle — update runtime flag, persist, and re-render banner
$("settings-debug-mode").addEventListener("change", async () => {
state.debugMode = $("settings-debug-mode").checked;
setRuntimeDebug(state.debugMode);
await saveState();
+ updateDebugBanner(state.currentView);
});
// Sync runtime debug flag on init
--
2.49.1