Skip to content

fix(web): restore missing brace in Tools tab HTMX-fallback path - #378

Merged
ChuckBuilds merged 1 commit into
mainfrom
hotfix/tools-tab-missing-brace
Jun 30, 2026
Merged

fix(web): restore missing brace in Tools tab HTMX-fallback path#378
ChuckBuilds merged 1 commit into
mainfrom
hotfix/tools-tab-missing-brace

Conversation

@ChuckBuilds

@ChuckBuildsChuckBuilds commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • The else if (++tries > 100) block added by feat(web): add Tools tab and row address type display setting #373 was missing its closing } before }, 100) closed the setInterval arrow function
  • This produced a JavaScript SyntaxError that silenced the entire 1,400-line script block — including new EventSource(...) and all of the _statsOpenHandler/_statsErrorHandler registrations
  • Result: the connection-status indicator never transitioned away from its default "Disconnected" HTML for every user on the current build

One character inserted, restoring the structure to what existed before #373 added the tools branch:

 }
+ }
}, 100);

Test plan

  • Reload the web UI — connection badge should turn green within ~1 second
  • Click the Tools tab — content loads normally (HTMX path still works)
  • Confirm no JS errors in browser console on page load

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed a JavaScript syntax issue in the tab-loading fallback flow, improving reliability when the main loading library is not yet available.
    • Ensured the fallback logic completes correctly after fetching content, helping prevent unexpected behavior during tab content loading.

The `else if (++tries > 100)` block added by #373 was missing its
closing `}`, leaving the setInterval arrow function syntactically
unclosed. This caused a JS parse error that silenced the entire
1400-line script block — including the EventSource setup — so the
connection-status indicator never left its default "Disconnected"
state for all users after updating.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitaiBot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: efda38d2-72a8-4c97-b13e-46072e8d2f5b

📥 Commits

Reviewing files that changed from the base of the PR and between 8e5f665 and 61715e1.

📒 Files selected for processing (1)
  • web_interface/templates/v3/base.html

📝 Walkthrough

Walkthrough

A single missing closing brace is added at line 1941 of base.html to complete the setInterval fallback block inside loadTabContent(), fixing a JavaScript syntax error in the Alpine app() logic.

Changes

Syntax Fix

Layer / File(s)Summary
Close setInterval fallback block
web_interface/templates/v3/base.html
Inserts the missing } to properly terminate the "tools" fetch error handler inside the loadTabContent()setInterval fallback path.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title accurately summarizes the main change: restoring a missing brace in the Tools tab HTMX fallback path.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hotfix/tools-tab-missing-brace

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@ChuckBuilds
ChuckBuilds merged commit c6ce332 into mainJun 30, 2026
8 checks passed
@ChuckBuilds
ChuckBuilds deleted the hotfix/tools-tab-missing-brace branch July 12, 2026 14:52
ChuckBuilds added a commit that referenced this pull request Sep 8, 2026
… size (#539)
* fix(display): pin one text layout engine, and give the 5x7 face a size
Two ways a font could render differently on two machines running the same
code, both found while diagnosing four plugins whose golden images passed on
the machine that generated them and failed everywhere else.
**Layout engine.** `ImageFont.truetype` picks its engine at load time: Raqm
where the host Pillow was built with libraqm, Basic otherwise. The two round
fractional glyph advances differently. `PressStart2P-Regular.ttf` at 8px has
whole-pixel advances, so they agree — which is why most of the fleet matched
everywhere and hid this. `4x6-font.ttf` at 6px does not: glyph positions drift
cumulatively along a run, and the four plugins that draw body text in it
(geochron, of-the-day, christmas-countdown, ledmatrix-weather's almanac) are
exactly the four whose goldens travelled badly.
Every core font load now goes through `src/common/font_layout.load_truetype`,
which pins the Basic engine, so a render depends on the font file and the size
and nothing else. Basic gives up complex-script shaping and kerning pairs;
neither applies to bitmap-grid faces on an LED panel. Output is unchanged on a
host without libraqm.
**Zero font height.** `DisplayManager` built the 5x7 BDF face with
`freetype.Face(path)` and never called `set_char_size`, so `face.size.height`
stayed 0 and `get_font_height()` returned 0 for it — callers stacking rows by
`prev_y + prev_height + gap` drew two lines on top of each other. The
start-up line `Calendar font size: 0 pixels` has been printing the symptom all
along. `font_manager._load_bdf_font` already called `set_char_size`, so
whether measurement worked depended on which path loaded the face.
`DisplayManager` now sets it too, and `get_font_height()` falls back to the
strike the file declares rather than returning a zero line height.
FixesChuckBuilds/ledmatrix-plugins#397
Refs ChuckBuilds/ledmatrix-plugins#371, #375, #378, #391
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(display): give the startup banner a rung that fits a full address at 64px
CI caught what pinning the layout engine exposed rather than caused.
`_fitting_font` walks PressStart2P then 4x6 at 6px, and "255.255.255.255" --
the widest thing the startup banner ever shows -- measures 66px at 4x6/6px
against the 62 a 64x32 panel has to give. It used to squeak in only because
the measurement depended on which layout engine the host Pillow happened to
have; with the engine pinned it does not, so the rung the worst case actually
needs is now in the ladder instead of implied: 4x6 at 5px, which measures 51.
The fallback was wrong in the same place. When nothing in the ladder fit, it
returned `self.font` -- the *widest* option, and precisely how "Initializing"
came to run off the side of a 64px panel to begin with. It returns the
narrowest face that loaded now.
test/test_initializing_screen.py: 34 passed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(display): name the exceptions the BDF strike read can raise
Codacy flagged the try/except/pass. It was already narrow in intent -- a
malformed strike table on the measurement path must degrade to "size unknown"
rather than take the display down -- but a bare `except Exception: pass` says
neither of those things and hides a genuinely broken font behind a silent 8px
fallback. It now catches what reading `available_sizes` can actually raise and
logs which face failed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* chore: drop logo PNGs the render harness downloaded into the worktree
These are fetched at runtime by the logo cache; they are not source, and they
rode in on a `git add -A` while I was running check_plugin.py against this
branch. Nothing in the change needs them.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for freeto 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

@ChuckBuilds