Fix bar chart label placement (#1182) and config-page select crash#1224
Open
gskjold wants to merge 3 commits into
Open
Fix bar chart label placement (#1182) and config-page select crash#1224gskjold wants to merge 3 commits into
gskjold wants to merge 3 commits into
Conversation
The positive (import/price) and negative (export) value labels could be drawn over a bar's edge or clipped at the chart baseline: - Issue #1182: on the future-price chart, low-price bars had their white inside-label read past the baseline and get clipped by the SVG viewBox. - On the 24-hour day plot, short bars' centered horizontal labels spilled over the bar's top/bottom edge (invisible white-on-white in light mode, floating onto gridlines in dark mode), and import/export labels for the same hour crowded the zero line. Replace the inline placement ternaries with small pure helpers (impLabelY/impLabelOutside/expLabelY/expLabelOutside) that take the scale values as arguments so Svelte still tracks reactivity. Rotated labels keep the existing clamped behaviour; non-rotated (wide-bar) labels now sit flush to the bar's outer edge when they fit and float just outside the bar, in the bar colour, when the bar is too short to contain the centered label. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
On the configuration page, changing the price region/resolution/currency
(or any other) <select> threw `ReferenceError: el is not defined` and
broke the form. Svelte 5 compiled the UI-feature toggle loop's bind
(`bind:value={configuration.u[el.key]}` inside `{#each uiElements as el}`)
into an `invalidate_inner_signals` reference to the each-local `el`, and
emitted that reference into every other bind that mutates `configuration`
— at component scope, where `el` is undefined.
Move the loop body into a small UiFeatureToggle child component so the
each-local is never referenced in a bind path at the parent's scope.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Regenerate ui/dist for the bar-chart label placement and config-page select fixes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🔧 PR Build ArtifactsVersion: All environments built successfully. Download the zip files:
|
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.
Two UI fixes, verified on device (ESP32-S2).
1. Bar chart value-label placement (closes #1182)
Value labels could be drawn over a bar's edge or clipped at the chart baseline:
Fix: the inline placement ternaries in
BarChart.svelteare replaced with small pure helpers (impLabelY/impLabelOutside/expLabelY/expLabelOutside) that take the scale values as arguments, so Svelte still tracks reactivity. Rotated labels keep the existing clamped behaviour (the original #1182 fix); non-rotated (wide-bar) labels now sit flush to the bar's outer edge when they fit, and float just outside the bar — in the bar colour — when the bar is too short to contain the centered label. This pushes labels away from the zero line, fixing both the edge overflow and the crowding.2.
ReferenceError: el is not definedon the config pageChanging the price region/resolution/currency (or any)
<select>on the configuration page threwReferenceError: el is not definedand broke the form.Cause: Svelte 5 compiled the UI-feature toggle loop's bind (
bind:value={configuration.u[el.key]}inside{#each uiElements as el}) into aninvalidate_inner_signalsreference to the each-localel, and emitted that reference into every other bind that mutatesconfiguration— at component scope, whereelis undefined.Fix: move the loop body into a small
UiFeatureTogglechild component so the each-local is never referenced in a bind path at the parent's scope.Verification
Rendered the real components with live device data through a stubbed-fetch harness (headless Chrome screenshots):
🤖 Generated with Claude Code