Skip to content

fix(admin-cabinet): route field-info tooltips through TooltipBuilder#1069

Merged
jorikfon merged 1 commit into
developfrom
fix/admin-cabinet-field-info-tooltips
May 24, 2026
Merged

fix(admin-cabinet): route field-info tooltips through TooltipBuilder#1069
jorikfon merged 1 commit into
developfrom
fix/admin-cabinet-field-info-tooltips

Conversation

@jorikfon
Copy link
Copy Markdown
Collaborator

Summary

  • MailSettings: tooltip icons in toggle-checkbox <label>s never showed (Semantic UI .ui.toggle.checkbox label swallows pointer events on the inner <i>).
  • Storage: clicking the s3_enabled tooltip icon flipped the cloud-storage toggle.
  • AsteriskManagers: the tall eventfilter tooltip vanished on small viewports because Fomantic couldn't fit any candidate position.

Root cause was the same in all three pages: popups were initialised by raw $icon.popup({hoverable:true, ...}), missing on: 'manual', the per-icon click.popup-trigger, and lastResort: true. The canonical helper TooltipBuilder.initialize() — already used by General Settings, Extensions, Providers, IvrMenu, CallQueues, OutboundRoutes/IncomingRoutes, ApiKeys, Fail2Ban, OffWorkTimes, AsteriskRestUsers — wires all three up correctly.

This PR refactors the three offenders to delegate to TooltipBuilder.initialize(). The redundant per-page click.tooltip-prevent handler in mail-settings-modify.js is dropped — TooltipBuilder.js already registers an equivalent delegated click.global-tooltip for icons nested in <label>s.

docs/TOOLTIP_GUIDELINES.md is rewritten:

  • new canonical pattern (static tooltip-manager class → TooltipBuilder.initialize(...));
  • explicit ban on calling $icon.popup() directly for .field-info-icon;
  • explanation of why on: 'manual' and lastResort: true are non-negotiable for icons nested in toggle/radio/checkbox labels.

Files

  • sites/admin-cabinet/assets/js/src/MailSettings/mail-settings-tooltip-manager.js
  • sites/admin-cabinet/assets/js/src/MailSettings/mail-settings-modify.js
  • sites/admin-cabinet/assets/js/src/Storage/storage-index.js
  • sites/admin-cabinet/assets/js/src/AsteriskManagers/manager-modify.js
  • docs/TOOLTIP_GUIDELINES.md
  • transpiled mirrors under sites/admin-cabinet/assets/js/pbx/...

Storage's `setS3EndpointPresetNote()` (`storage-index.js:523`) continues to mutate the s3_endpoint tooltip via `popup('change content', ...)` — that call is a pure content update and is unaffected by switching the popup to `on: 'manual'`.

Test plan

  • `/admin-cabinet/mail-settings/modify/` → hover/click info-icon on every toggle (`MailEnableNotifications`, `SendMissedCall…`, `SendVoicemail…`, `SendLogin…`, `SendSystemNotifications`, `MailPlainText`, `MailSMTPCertCheck`): popup shows, toggle state does not flip.
  • `/admin-cabinet/storage/` (Cloud Storage tab) → click `s3_enabled` info-icon: popup shows, toggle state does not flip; the `s3_endpoint` info-icon still updates contents when the provider preset changes.
  • `/admin-cabinet/asterisk-managers/modify/` → resize browser short (~600px height), open `eventfilter` tooltip: popup still appears (scrolls internally if needed).
  • `/admin-cabinet/general-settings/modify/` → regression check: tooltips on all tabs still work as before.

MailSettings, Storage and AsteriskManagers initialised popups directly
via $icon.popup({hoverable:true, ...}), missing `on: 'manual'`,
`click.popup-trigger` and `lastResort: true`. Symptoms:

- mail-settings: tooltips on toggle-checkbox icons did not show — the
  Semantic UI .ui.toggle.checkbox label swallows pointer events.
- storage: clicking the s3_enabled tooltip icon toggled storage mode.
- asterisk-managers: tall eventfilter tooltip vanished on small viewports.

All three now delegate to TooltipBuilder.initialize() (matching
general-settings), inheriting manual click control, label-aware click
prevention and forced placement. Per-page click.tooltip-prevent dup in
mail-settings-modify.js dropped — global delegate in TooltipBuilder.js
already covers it.

docs/TOOLTIP_GUIDELINES.md rewritten to mandate TooltipBuilder.initialize()
and document why on:'manual' + lastResort:true are required.
@jorikfon jorikfon merged commit 873f47b into develop May 24, 2026
1 check passed
@jorikfon jorikfon deleted the fix/admin-cabinet-field-info-tooltips branch May 24, 2026 03:43
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