Skip to content

luci-base: form: move tooltip option from Flag to Value - #9121

Merged
feckert merged 1 commit into
openwrt:masterfrom
TDT-AG:pr/20261009-luci-base
Oct 12, 2026
Merged

feckert merged 1 commit into
openwrt:masterfrom
TDT-AG:pr/20261009-luci-base

Conversation

@feckert

@feckert feckert commented Oct 9, 2026

Copy link
Copy Markdown
Member

Pull request details

Description

Until now only form.Flag supported the tooltip and tooltipicon options, and the tooltip was rendered inside the ui.Checkbox widget.

Move both options to form.Value so that they are available for all option types, e.g. Value, ListValue, DynamicList or TextValue. The tooltip is rendered by the new renderTooltip() and added by renderFrame(). form.Flag inherits it and no longer passes the options to ui.Checkbox.

The tooltip can be a string (formatted with the section ID), a function returning a string, or an array. The items of an array are separated by line breaks, which allows multi-line tooltips without embedding HTML.

To always show the tooltip icon behind the widget, independent of whether the widget frame is a block or an inline element (e.g. text inputs, textareas and selects use plain block frames), the widget and the icon are wrapped into an inline-flex container if a tooltip is set. Options without a tooltip are not changed.

Screenshot or video of changes (if applicable)

Bildschirmfoto_20261009_111145

Note

This is a preparatory commit so that this can be used elsewhere as well.
Currently, this tooltip is only used on this page.

Tested on

OpenWrt version:
master
LuCI version:
master
Web browser(s):
firefox

Until now only form.Flag supported the tooltip and tooltipicon
options, and the tooltip was rendered inside the ui.Checkbox widget.

Move both options to form.Value so that they are available for all
option types, e.g. Value, ListValue, DynamicList or TextValue. The
tooltip is rendered by the new renderTooltip() and added by
renderFrame(). form.Flag inherits it and no longer passes the options
to ui.Checkbox.

The tooltip can be a string (formatted with the section ID), a
function returning a string, or an array. The items of an array are
separated by line breaks, which allows multi-line tooltips without
embedding HTML.

To always show the tooltip icon behind the widget, independent of
whether the widget frame is a block or an inline element (e.g. text
inputs, textareas and selects use plain block frames), the widget and
the icon are wrapped into an inline-flex container if a tooltip is set.
Options without a tooltip are not changed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Florian Eckert <fe@dev.tdt.de>

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 1 new commit.


Generated by Claude Code

Comment thread modules/luci-base/htdocs/luci-static/resources/form.js
@feckert
feckert merged commit d12d553 into openwrt:master Oct 12, 2026
8 checks passed
@feckert
feckert deleted the pr/20261009-luci-base branch October 12, 2026 11:11
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.

2 participants