Conversation
`render()` escaped the footer with `esc()`, but the widget defines no such function: the helper lives on the bridge, as `Fremkit.esc`. So the reference threw on every render — once a second, plus once per channel answer — and everything the line stands in front of never reached the tile: today's tokens, the sessions, the cost, and the hourly histogram under them. The gauges above it drew, which is why the widget looked merely quiet rather than broken. The widget is now evaluated for real in a test, against the stubs the host provides, so a render that throws fails the suite rather than leaving half a tile empty. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mcouzinet
force-pushed
the
claude-usage-esc
branch
from
September 22, 2026 17:02
0ddf4cc to
0f10c7f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
render()in the Claude limits widget escapes its footer withesc(), but the widget defines noesc: the helper isFremkit.esc, on the bridge. The bare reference throws on every render — once a second from the countdown timer, plus once per answer onclaude-usageandclaude-account— so everything after that line never reaches the tile: today's tokens, the sessions, the cost, and the hourly histogram under them. The gauges above it are built earlier in the same function, which is why the widget looks quiet rather than broken. On a dashboard with the tile on screen, the console fills withReferenceError: esc is not defined.One word to fix. The test is the part worth reviewing: the widget is evaluated for real against stubs, in the style of
spotify-widget.test.ts, and asserts what sits after the throwing line — the footer text, its escaping, and the histogram. It fails withReferenceErroron the three cases before the fix.widgets/claude-usage/index.html—parts.map(esc)→parts.map(Fremkit.esc).Fremkit.escdoes not usethis, so passing it tomapby reference is safe.widgets/claude-usage/manifest.json— 1.1.0 → 1.1.1.server/test/claude-usage-widget.test.ts— three cases: the day in the footer, a limit name escaped, the histogram drawn.CHANGELOG.md— one line under Unreleased / Fixed.pnpm typecheckandpnpm testare green (66 server files / 1351 tests, 30 UI files / 382 tests).🤖 Generated with Claude Code