Repository navigation
Feat: Replace Tooltipster with Floating UI. - #183
Open
mgiannopoulos24 wants to merge 13 commits into
Open
mgiannopoulos24 wants to merge 13 commits into
mgiannopoulos24 wants to merge 13 commits into
Conversation
The trigger was only ever disabled when the recipe had no named
ingredient, but `.cooked-auto-nutrition-button` is a Cooked Pro element
and the trigger used to be a <span>, so `prop('disabled')` had no
effect and the button was always clickable.
Cooked Pro now renders a real <button> there, which made the dormant
call live and left a dead button with no explanation. Drop the logic
here so both plugins agree, and let the panel surface the error
instead.
This reverts commit 099c04f.
Vendor @floating-ui/core and @floating-ui/dom 1.8.0 (UMD) with their MIT license under assets/vendor/floating-ui and drop assets/vendor/tooltip. Tooltips are now a small delegated handler on .cooked-tooltip[data-tooltip] positioned with Floating UI (flip, shift, arrow). The Save as Default panel floats next to its button again, like it did with Tooltipster. All recipe setting tooltips get the green heading for consistency. If Floating UI fails to load, tooltips are skipped and the panel opens inline, so the rest of the admin JS keeps working. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…into feat/tooltip-lib
Bring back Tooltipster's grow: Floating UI positions an outer shell and only the inner .cooked-tooltip-bubble scales (400ms, eased, with a fade), so flip, shift and the arrow still measure the full box. The arrow sits inside the bubble and scales with it. Hover tooltips open after 100ms (leaving sooner shows nothing), focus opens at once, and leaving or Escape grows them closed before hiding. Save as Default grows the same way with no delay when Floating UI places it; without Floating UI it stays an instant inline panel. cooked_grow_open(), cooked_grow_close() and cooked_grow_cancel() are global so Cooked Pro can reuse them. Headings no longer wrap; min-width lets a long heading widen the 275px bubble instead of overflowing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR replaces the old and no longer maintained Tooltipster library with Floating UI (
@floating-ui/core+@floating-ui/dom1.8.0), which is lightweight and not jQuery based.assets/vendor/floating-uitogether with their MITLICENSEand aREADME.mddescribing the version, source and how to update. This allows the migration of all third party libs fromassets/jsin the future.assets/admin/js/cooked-functions.jsshows.cooked-tooltip[data-tooltip]elements on hover/focus, closes on Escape, setsaria-describedbyand positions them with Floating UI (flip, shift, arrow).data-positions="top"is still supported. It is scoped to.cooked-tooltipso other plugins'data-tooltipattributes are never rendered as HTML.#cooked-save-default-panel) instead of HTML inside atitleattribute.gulpfile.js.cooked-admin-functionsdepends on the Floating UI handles, so load order is guaranteed (also with script optimization plugins).cooked_position_floating()(with the.cooked-tooltip-arrowstyles). Cooked Pro uses it for its Auto Nutrition popover, so keep its name and signature stable.Related issue
Closes #182
Checklist
Please check if your PR fulfills the following requirements:
🤖 Generated with Claude Code