Skip to content

webui: update the header logo and message dots only on changes - #212

Merged
jens-maus merged 1 commit into
mainfrom
jens-maus/migrate-0153-webui-fix-improve-img-updates
Oct 16, 2026
Merged

jens-maus merged 1 commit into
mainfrom
jens-maus/migrate-0153-webui-fix-improve-img-updates

Conversation

@jens-maus

@jens-maus jens-maus commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Original OpenCCU rootfs patch: 0153
Original filename: 0153-WebUI-Fix-ImproveImgUpdates.patch
Original patch: ``''https://github.com/OpenCCU/OpenCCU/blob/0ba6800df3aa3afea28670d335ec428936bac3de/buildroot-external/package/openccu-base/rootfs-patches/0153-WebUI-Fix-ImproveImgUpdates.patch''''
Original changes: OpenCCU/OpenCCU@aac3562d7

The header logo blinks (red/normal) while ReGa is saving, and the alarm/service message counters are refreshed periodically. Both reassigned image sources or HTML on every call, which reloads the images and causes needless DOM updates. This applies the patch:

  • src/webui/www/ise/htm/header.htm: the header contains the normal logo (headerLogo) and the red logo (headerLogoRed, initially hidden) instead of one image whose src is switched.
  • src/webui/www_source/ise/js/functions.js (the webui.js part):
    • SwitchOnFlashLight()/SwitchOffFlashLight() only toggle the existing hidden class (webui.css) of the two logos.
    • setAlarmMessageCount()/setServiceMessageCount() only update the text and the dot image if they actually change.

In this repository the logos are homematic_logo_small.png and homematic_logo_small_red.png (both exist in www/ise/img/); OpenCCU's rootfs patch 0001 replaces them by its own logos, as it does for the single logo today. header.htm keeps its CRLF line endings. The legacy www/ise/js/functions.j_ is not part of webui.js and is left unchanged, as by the original patch. The root www/ copies are unused legacy files and are left unchanged.

Workspaces of the earlier OpenCCU patches

OpenCCU rootfs patch 0001 rewrites exactly these lines (logo file names in header.htm and in SwitchOn/OffFlashLight()). The OpenCCU cleanup PR will therefore update the workspaces of the earlier patches:

  • 0001: its header.htm hunk replaces the file names of both logos, and its two SwitchOn/OffFlashLight() hunks in webui.js disappear (the functions no longer contain file names).
  • All earlier workspaces containing this code in webui.js (.orig and modified files of 0001, 0029, 0031, 0032, 0038, 0039, 0042, 0044, 0046, 0054, 0056, 0057, 0061, 0077, 0095, 0097, 0099, 0104, 0109, 0111, 0119, 0122, 0125, 0131, 0132, 0135, 0138, 0145, 0146 and 0151) get the new code by the same text replacement. After regenerating, patch 0001 changes as described, 12 other patches only in hunk line numbers, and all other patches are unchanged.

Until that cleanup is merged, OpenCCU must not be bumped to a Base revision containing this change.

Validation

  • Applied directly to header.htm and functions.js; node --check passes; git diff --check (with cr-at-eol) is clean.
  • OpenCCU scripts/base-patch-migration.py validate with the canonical Buildroot 2026.08 git4 archive of this branch (749903d4, sha256 567e76e2db2e7c29942dae0a5ce2494bb94879b13d5cb50cfdb4967f10b3f1bd) and --skip-patch 0153, on OpenCCU master 0ba6800df (current pin a4a4a703, equal to main) with the refreshed workspaces described above: PASS (the other 47 rootfs patches apply with zero fuzz).
  • compare refuses this case because patch 0001 and other patches change. The validation manifest (file types, modes and hashes of all 4666 entries) was therefore compared directly with a validation of the current pin a4a4a703 with all 48 patches: byte-identical, including header.htm and webui.js.

OpenCCU cleanup PR (removing patch 0153, refreshing the earlier workspaces and updating the pin): OpenCCU/OpenCCU#4457


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Alarm and service message indicators now update only when their displayed message or status image changes, while preserving the existing colors for zero and nonzero counts.
    • The header switches between the regular and red logo during flashlight operation.

Generated by Claude Code

This applies OpenCCU rootfs patch 0153-WebUI-Fix-ImproveImgUpdates.patch:

- header.htm contains both the normal and the red header logo; the
  red one is hidden by default. SwitchOnFlashLight() and
  SwitchOffFlashLight() only toggle the "hidden" class instead of
  reloading the logo image.
- setAlarmMessageCount() and setServiceMessageCount() only update the
  message text and the dot image if they actually changed.
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e0dad6d5-b797-45b0-bdcb-3b495ce3683f
📥 Commits

Reviewing files that changed from the base of the PR and between a4a4a70 and 749903d.

📒 Files selected for processing: 2
  • src/webui/www/ise/htm/header.htm
  • src/webui/www_source/ise/js/functions.js

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The header now includes regular and red logo elements that the flashlight functions show or hide. Alarm and service message indicators update their text and images only when the values differ from the current DOM values.

Changes: Header UI updates

Layer / File(s) Summary
Logo flash display
src/webui/www/ise/htm/header.htm, src/webui/www_source/ise/js/functions.js
The header contains regular and initially hidden red logo images. The flashlight functions toggle their visibility classes instead of changing the regular logo image source.
Message indicator updates
src/webui/www_source/ise/js/functions.js
Alarm and service message text and images update only when their generated values differ from the current DOM values. Zero counts still use green images; nonzero alarm counts use red images, and nonzero service counts use yellow images.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Refactor

Suggested reviewers: cn-eq3

Merge Risk: ⚪ Minimal · up to 74990

The logo transition preserves the prior failure-state behavior, and the message indicators avoid redundant updates. No identified behavior change warrants delaying this PR.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main changes: updating the header logo behavior and changing message-dot updates to occur only when values change.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@jens-maus
jens-maus merged commit af4539c into main Oct 16, 2026
5 checks passed
@jens-maus
jens-maus deleted the jens-maus/migrate-0153-webui-fix-improve-img-updates branch October 16, 2026 21:41
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