From 1e6143aacb4317ce95576690b2d0b5f8fccc93e9 Mon Sep 17 00:00:00 2001 From: Peng Ding Date: Thu, 24 Sep 2026 01:31:47 -0500 Subject: [PATCH] fix(profiler): replace emoji with SVG icons in theme toggle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dark/light mode toggle button used emoji characters (🌙/☀) which render inconsistently across platforms and don't match stroke-icon conventions. Replace with inline SVG moon/sun icons that toggle visibility on theme switch. Bump to 0.1.1. --- manifest.json | 12 ++++++------ profiler/profiler.py | 25 ++++++++++++++++++++----- pyproject.toml | 1 + 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/manifest.json b/manifest.json index fceedd2..30af7d0 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "version": "1", - "generated": "2026-09-15T09:30:11.658018+00:00", + "generated": "2026-09-24T06:30:59.840333+00:00", "modules": { "a2a": { "description": "A2A (Agent-to-Agent Protocol) - Zero-dependency Python implementation", @@ -199,12 +199,12 @@ "files": [ "jsonschema/jsonschema.py" ], - "version": "0.4.0", + "version": "0.4.1", "deps": [], "tier": "subsystem", "category": "validation", - "last_updated": "2026-09-14T17:04:46-05:00", - "content_hash": "39c67c20198220cfe3b0496a77dca2e36093e460e624b43fdae0175fe99b6512" + "last_updated": "2026-09-23T19:15:39-05:00", + "content_hash": "9b4f8684930617202004f8024e3e1e7b6e248982060e5d6caacdbf544e3ab0ab" }, "jsonx": { "description": "Extended JSON parser — zero dependencies, stdlib only, Python 3.10+", @@ -283,12 +283,12 @@ "files": [ "profiler/profiler.py" ], - "version": "0.1.0", + "version": "0.1.1", "deps": [], "tier": "medium", "category": "devtools", "last_updated": "2026-09-15T03:31:09-05:00", - "content_hash": "cb2480fee4939b1cb869047df0b343762fb416e33638536db389407a4dc3d9ee" + "content_hash": "e9ccd8c5f87e53ec0eee622fc34f778c004cd234acbb7b9a1748a690e6574373" }, "prompt": { "description": "Zero-dependency interactive CLI prompts (confirm, select, text)", diff --git a/profiler/profiler.py b/profiler/profiler.py index 72a99da..71a8bbf 100644 --- a/profiler/profiler.py +++ b/profiler/profiler.py @@ -1,5 +1,5 @@ # /// zerodep -# version = "0.1.0" +# version = "0.1.1" # deps = [] # tier = "medium" # category = "devtools" @@ -971,7 +971,8 @@ def _render_flame_html( 'placeholder="Search functions\u2026" autocomplete="off">\n' '\n' '\n" + f"{_SVG_MOON}{_SVG_SUN}" + "\n" "\n" f'
\n' @@ -1039,7 +1040,8 @@ def _render_table_html( '\n' '\n" + f"{_SVG_MOON}{_SVG_SUN}" + "\n" "
\n" '
\n' '\n\n' @@ -1063,6 +1065,13 @@ def _render_table_html( ) +# --------------------------------------------------------------------------- +# Inline SVG icons for theme toggle +# --------------------------------------------------------------------------- + +_SVG_MOON = '' +_SVG_SUN = '' + # --------------------------------------------------------------------------- # Inline CSS for HTML table output # --------------------------------------------------------------------------- @@ -1172,7 +1181,10 @@ def _render_table_html( next=mq&&mq.matches?'light':'dark'; } html.setAttribute('data-theme',next); - tb.textContent=next==='dark'?'\\u2600':'\\uD83C\\uDF19'; + var moon=document.getElementById('icon-moon'); + var sun=document.getElementById('icon-sun'); + if(moon)moon.style.display=next==='dark'?'none':''; + if(sun)sun.style.display=next==='dark'?'':'none'; }); }); })(); @@ -1364,7 +1376,10 @@ def _render_table_html( next=mq&&mq.matches?'light':'dark'; } html.setAttribute('data-theme',next); - tb.textContent=next==='dark'?'\\u2600':'\\uD83C\\uDF19'; + var moon=document.getElementById('icon-moon'); + var sun=document.getElementById('icon-sun'); + if(moon)moon.style.display=next==='dark'?'none':''; + if(sun)sun.style.display=next==='dark'?'':'none'; }); render(FLAME_DATA,TOTAL_TIME); diff --git a/pyproject.toml b/pyproject.toml index 9ac3ee9..4a465a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -201,6 +201,7 @@ max-complexity = 20 "validate/validate.py" = ["E501"] "diff/diff.py" = ["E501"] "vcs/vcs.py" = ["E501"] +"profiler/profiler.py" = ["E501"] "httpserver/test_httpserver_unix_socket.py" = ["ASYNC240"] "httpserver/test_httpserver_tls.py" = ["ASYNC240"] "xml/xml.py" = ["E501"]