Skip to main content

Module registry

Module registry 

Source
Expand description

Tooltip content registry.

A central map from tooltip keys (short identifiers) to TooltipContent — the translatable strings + optional shortcut metadata that rich-tooltip widgets resolve at hover time.

Two entry points:

  • TooltipContent::new (plus .with_more / .with_shortcut_label / .for_shortcut) builds an entry at app boot.
  • install_tooltip_registry freezes a Vec<TooltipContent> into a thread-local registry that the tooltip widget reads from.

The registry is populated once by TeksiloAppBuilder::register_tooltips(...) before the first frame builds and is read-only for the rest of the process lifetime.

§URL scheme

Inline links inside tooltip body text address other tooltip entries via the :key URL prefix. A link written as [2 minutes](:autosave-details) in a translated string becomes a hover-trigger for the tooltip registered under the "autosave-details" key. Use TooltipRegistry::parse_url to recognize :key URLs; every other URL scheme (http://, mailto:, …) passes through unmodified.

Structs§

TooltipContent
One tooltip content entry.
TooltipRegistry
Frozen, read-only registry keyed by tooltip id.

Functions§

install_tooltip_registry
Install the tooltip registry for the current thread. Called once by TeksiloAppBuilder::register_tooltips before the first frame builds. Panics in debug builds on double-install; logs and keeps the first installation in release.
with_tooltip_registry
Read-side helper used by the tooltip widget. Runs f with a borrowed reference to the installed registry. Returns None if no registry has been installed yet (early bootstrap, headless tests).