Skip to content

fix(profiler): replace emoji with SVG icons in theme toggle - #175

Merged
Oaklight merged 1 commit into
masterfrom
fix/profiler-svg-icons
Sep 24, 2026
Merged

Oaklight merged 1 commit into
masterfrom
fix/profiler-svg-icons

Conversation

@Oaklight

Copy link
Copy Markdown
Owner

Summary

  • Replace emoji characters (🌙/☀) in the HTML theme toggle button with inline SVG moon/sun icons
  • SVGs toggle visibility via display:none on theme switch instead of swapping textContent
  • Add profiler/profiler.py to E501 ignore list (inline HTML strings)
  • Bump profiler to 0.1.1

Test plan

  • pytest profiler/test_profiler_correctness.py — 128 passed
  • make lint — clean
  • Verified in llm-rosetta gateway admin UI: SVG icons render correctly in both light and dark modes

@clementine-oaklight clementine-oaklight Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean swap from emoji to inline SVGs — straightforward.

Checked:

  • Moon/sun SVGs are standard Feather-style icons ✅
  • stroke="currentColor" inherits button text color ✅
  • Toggle logic: display:none swap vs textContent — cleaner ✅
  • Both flame and table HTML get identical icons ✅
  • E501 ignore for profiler.py makes sense (inline HTML) ✅

Minor: manifest.json includes unrelated jsonschema 0.4.0 → 0.4.1 bump from make manifest picking up master changes. Non-blocking, just FYI.

LGTM 👍

@milo-oaklight milo-oaklight Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. SVG icons are well-formed (Feather-style stroke icons), toggle logic correctly shows sun in dark mode / moon in light mode. The duplicated inline SVG blocks in _render_flame_html and _render_table_html are fine for now—extracting to a constant would be a minor future cleanup but not blocking.

E501 ignore for profiler.py is reasonable given the inline HTML strings.

@elena-oaklight elena-oaklight Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean fix — emoji rendering is notoriously inconsistent across browsers/OS, SVGs are the right call.

Verified

Area ✓
SVG attributes (viewBox, stroke="currentColor", 16×16) Correct, inherits button text color
Toggle logic: moon visible in light mode → sun visible in dark mode Matches original emoji behavior
Initial state (display:none on sun) Correct — page starts light-ish
Both render paths (flame + table) updated consistently ✓
E501 ignore for inline HTML strings Reasonable
manifest.json also shows jsonschema 0.4.0→0.4.1 Expected from #173 merge + regenerate

LGTM 👍

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.
@Oaklight
Oaklight force-pushed the fix/profiler-svg-icons branch from 7d261fe to 1e6143a Compare September 24, 2026 06:49
@Oaklight
Oaklight merged commit 74f950c into master Sep 24, 2026
6 checks passed
@Oaklight
Oaklight deleted the fix/profiler-svg-icons branch September 24, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant