Skip to content

webui: name the object in the delete confirmation dialogs - #213

Merged
jens-maus merged 1 commit into
mainfrom
jens-maus/migrate-0156-webui-improved-confirm-delete-popup
Oct 17, 2026
Merged

jens-maus merged 1 commit into
mainfrom
jens-maus/migrate-0156-webui-improved-confirm-delete-popup

Conversation

@jens-maus

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

Copy link
Copy Markdown
Member

Original OpenCCU rootfs patch: 0156
Original filename: 0156-WebUI-ImprovedConfirmDeletePopup.patch
Original patch: ``''https://github.com/OpenCCU/OpenCCU/blob/fef410df1906f72227f878ff755d9a8a13e6f800/buildroot-external/package/openccu-base/rootfs-patches/0156-WebUI-ImprovedConfirmDeletePopup.patch'''' (as fixed by OpenCCU/OpenCCU#4458)
Original changes: OpenCCU/OpenCCU@55f2980b3 (OpenCCU/OpenCCU#1579)
Fixes before migration: OpenCCU/OpenCCU#4458 (escaping of the names, German word order)

The delete confirmation dialogs of system variables, users, favorites and direct links only asked "Do you really want to delete the …?" without naming the object. This applies the patch, including the fix of OpenCCU/OpenCCU#4458:

  • src/webui/rega/www/pages/tabs/admin/systemvars.htm, src/webui/rega/www/pages/tabs/admin/userAdministration.htm, src/webui/rega/www/pages/tabs/user/favOverview.htm: the delete buttons pass the name of the object to DeleteSysVar(), deleteUser() and DeleteFavorite(), which insert it for %s into the question.
    • The name is encoded for the JavaScript string inside the onclick attribute in ReGa: \, ', ", <, > and & become \x5C, \x27, \x22, \x3C, \x3E and \x26.
    • The functions HTML-escape it before inserting it into the dialog text (YesNoDialog renders HTML) and use a replacement function, so $ patterns in names are not interpreted.
  • src/webui/www_source/config/js/ic_common.js (the webui.js part): the direct link dialog inserts sender - receiver (device addresses) for %s.
  • src/webui/www/webui/js/lang/{de,en}/translate.lang.js and translate.lang.extension.js: dialogQuestionRemoveLink, …InternalLink, …User, …SysVar and …Favorite contain '%s', like dialogQuestionRemoveProgram already does.

Line endings and encodings are preserved. The root www/ copies are unused legacy files and are left unchanged. The pre-existing DeleteProgram() dialog of programlist.htm is not part of this patch and is unchanged.

Workspaces of the earlier OpenCCU patches

OpenCCU rootfs patch 0062 re-indents and rewrites the DeleteFavorite button line of favOverview.htm, so it would no longer apply with zero fuzz. The OpenCCU cleanup PR will therefore add the new name encoding to the favOverview.htm workspaces (.orig and modified files) of 0039 and 0062. After regenerating, only patch 0062 changes, in that one rewritten line; all other patches are unchanged. Until that cleanup is merged, OpenCCU must not be bumped to a Base revision containing this change.

Validation

  • Applied to this repository's sources with zero fuzz, except the DeleteFavorite line of favOverview.htm, whose indentation differs here (changed by hand). node --check passes for ic_common.js and the language files; 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 (3e2e4dff, sha256 ac045a0d9f713d7ceac7f4818edba5f628a7398ac9c90fd3f7527b4788d51b8b) and --skip-patch 0156, on the OpenCCU branch of fix(webui): escape the object names in the delete confirmation dialogs OpenCCU#4458 (current pin af4539c3, equal to main) with the refreshed workspaces described above: PASS (the other 46 rootfs patches apply with zero fuzz).
  • compare refuses this case because patch 0062 changes. The validation manifest (file types, modes and hashes of all 4666 entries) was therefore compared directly with a validation of the current pin af4539c3 with all 47 patches, including the fixed 0156 from fix(webui): escape the object names in the delete confirmation dialogs OpenCCU#4458: byte-identical.
  • The escaping is covered by the round-trip test described in fix(webui): escape the object names in the delete confirmation dialogs OpenCCU#4458. The ReGa pages were not run on a device.

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


Generated by Claude Code

Summary by CodeRabbit

  • Improvements
    • Deletion confirmation dialogs now identify the selected connection, user, system variable, or favorite by name, helping clarify what will be removed.
    • Link-removal confirmations now show the link’s sender and receiver addresses.

Generated by Claude Code

This applies OpenCCU rootfs patch 0156-WebUI-ImprovedConfirmDeletePopup.patch
including the fix of OpenCCU/OpenCCU#4458:

- The delete confirmation dialogs of system variables, users, favorites
  and direct links name the object to be deleted ('%s' in the
  translations).
- The names are encoded for the JavaScript string in ReGa (\xNN for
  backslash, quotes, angle brackets and ampersand) and HTML-escaped
  before they are inserted into the dialog text.
@coderabbitai

coderabbitai Bot commented Oct 17, 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: db41dea1-afaa-4118-b98d-daf740da3fd6
📥 Commits

Reviewing files that changed from the base of the PR and between af4539c and 3e2e4df.

📒 Files selected for processing: 8
  • src/webui/rega/www/pages/tabs/admin/systemvars.htm
  • src/webui/rega/www/pages/tabs/admin/userAdministration.htm
  • src/webui/rega/www/pages/tabs/user/favOverview.htm
  • src/webui/www/webui/js/lang/de/translate.lang.extension.js
  • src/webui/www/webui/js/lang/de/translate.lang.js
  • src/webui/www/webui/js/lang/en/translate.lang.extension.js
  • src/webui/www/webui/js/lang/en/translate.lang.js
  • src/webui/www_source/config/js/ic_common.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

Deletion confirmations now display the selected user, system variable, or favorite name. Internal-link confirmations display the sender and receiver addresses. The handlers escape names before inserting them into confirmation text.

Changes: Named deletion confirmations

Layer / File(s) Summary
User, system-variable, and favorite prompts
src/webui/rega/www/pages/tabs/admin/systemvars.htm, src/webui/rega/www/pages/tabs/admin/userAdministration.htm, src/webui/rega/www/pages/tabs/user/favOverview.htm, src/webui/www/webui/js/lang/{de,en}/translate.lang.js
The localized prompts include an item-name placeholder. The deletion handlers pass the name and HTML-escape it before displaying the confirmation.
Internal-link prompts
src/webui/www/webui/js/lang/{de,en}/translate.lang.extension.js, src/webui/www_source/config/js/ic_common.js
The localized prompt includes a placeholder. RemoveLink substitutes the sender and receiver addresses, separated by -.

Priority: ⬇️ Low

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

Change: Feature

Suggested reviewers: cn-eq3

Merge Risk: ⚪ Minimal · up to 3e2e4

The change adds selected names or addresses to deletion prompts. Review found no confirmed regression; a narrow favorite-name edge case remains unverified, leaving minimal merge risk.

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 and concisely describes the main change: delete confirmation dialogs now name the selected object.
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 5…
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 5 files. (3 skipped: 3 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 17383a0 into main Oct 17, 2026
5 checks passed
@jens-maus
jens-maus deleted the jens-maus/migrate-0156-webui-improved-confirm-delete-popup branch October 17, 2026 16:59
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