You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Repo Assist] Use Popover API for code snippet tooltips; fix scroll-offset positioning (#1061)
* Use Popover API for tooltip divs; fix scroll-offset positioning bug
- Add `popover` attribute to `div.fsdocs-tip` elements in HtmlFormatting.fs,
placing them in the browser top layer when supported (Baseline 2024).
- Update fsdocs-tips.js to call showPopover()/hidePopover() on browsers that
support the Popover API; fall back to display:block/none on older browsers.
- Switch to `position: fixed` in the Popover API path (correct for top-layer
elements) and fix a scroll-offset bug where tooltips appeared at wrong
positions when the page was scrolled.
- Fix a minor bug in the right-edge overflow correction (was using `y` instead
of `x` as the base for the left-shift calculation).
- Add `div.fsdocs-tip:popover-open { display: block }` to fsdocs-default.css
so author-level display:none does not suppress the Popover API reveal.
- Update RELEASE_NOTES.md.
Closes#422
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* ci: trigger CI checks
* fix: resolve popover black-background regression; drop fallback; add fade-in
- CSS: add `inset: unset` to `div.fsdocs-tip:popover-open` to reset the UA
popover stylesheet's `inset: 0` (i.e. right:0 / bottom:0), which was
stretching the element across the viewport and causing the visible dark area
around the tooltip.
- CSS: add `position: fixed` explicitly in the :popover-open rule so the
element is correctly anchored to the JS-supplied left/top coordinates.
- CSS: add a 120ms ease-out opacity fade-in animation for a subtle reveal.
- JS: remove the display-toggle fallback branch entirely. The Popover API is
Baseline 2024 (Chrome 114+, Firefox 125+, Safari 17+) and the technical
audience of fsdocs users will have modern browsers.
- RELEASE_NOTES: update entry to reflect the simplified (no-fallback) design
and the animation addition.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* ci: trigger checks
* fix: replace onmouseout/onmouseover with data-* attrs + event delegation; fix Chrome popover background
- HtmlFormatting.fs: emit data-fsdocs-tip / data-fsdocs-tip-unique instead
of inline onmouseover/onmouseout handlers; overlapping vs non-overlapping
cases now produce identical output (owner param is no longer needed)
- GenerateHtml.fs (ApiDocs): same data-* attrs on code elements; add the
popover attribute to fsdocs-tip divs so showPopover() works there too
- fsdocs-tips.js: add delegated mouseover/mouseout listeners that read
data-fsdocs-tip attributes; wrap showPopover() in try/catch for safety;
keep showTip/hideTip on window for backward-compat with cached docs
- fsdocs-default.css: add explicit background-color inside :popover-open
to override Chrome UA top-layer canvas default (fixes black background);
add [data-fsdocs-tip] cursor rule alongside legacy span[onmouseout]
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* ci: trigger checks
* Fix backdrop
* Tweak css
* Code cleanup
* fix: update test assertion to match new data-fsdocs-tip attribute convention
The ConvertCommand test checked that 'fsdocs-tip' is not in the output
when no template is given. Since the span elements now use data-fsdocs-tip
attributes (instead of onmouseover/onmouseout inline handlers), the output
always contains 'fsdocs-tip' as part of the attribute name.
The test intent is to verify that tooltip *div* elements (class="fsdocs-tip")
are not emitted without a template. Update the assertion to check for
class="fsdocs-tip" specifically, which only matches the tooltip divs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* ci: trigger checks
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Don Syme <dsyme@users.noreply.github.com>
Co-authored-by: nojaf <florian.verdonck@outlook.com>
Copy file name to clipboardExpand all lines: RELEASE_NOTES.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,15 @@
2
2
3
3
## [Unreleased]
4
4
5
-
### Refactored
6
-
* Split `MarkdownParser.fs` (1500 lines) into `MarkdownInlineParser.fs` (inline formatting) and `MarkdownParser.fs` (block-level parsing) for better maintainability. [#1022](https://github.com/fsprojects/FSharp.Formatting/issues/1022)
7
-
* Split pipe-table and Emacs-table parsing out of `MarkdownBlockParser.fs` into a new `MarkdownTableParser.fs` (196 lines), reducing `MarkdownBlockParser.fs` from 958 to 760 lines. [#1022](https://github.com/fsprojects/FSharp.Formatting/issues/1022)
8
-
9
5
### Added
10
6
* Add `dotnet fsdocs convert` command to convert a single `.md`, `.fsx`, or `.ipynb` file to HTML (or another output format) without building a full documentation site. [#811](https://github.com/fsprojects/FSharp.Formatting/issues/811)
11
7
*`fsdocs convert` now accepts the input file as a positional argument (e.g. `fsdocs convert notebook.ipynb -o notebook.html`). [#1019](https://github.com/fsprojects/FSharp.Formatting/pull/1019)
12
8
*`fsdocs convert` infers the output format from the output file extension when `--outputformat` is not specified (e.g. `-o out.md` implies `--outputformat markdown`). [#1019](https://github.com/fsprojects/FSharp.Formatting/pull/1019)
13
9
*`fsdocs convert` now accepts `-o` as a shorthand for `--output`. [#1019](https://github.com/fsprojects/FSharp.Formatting/pull/1019)
14
10
15
11
### Changed
12
+
* Tooltip elements (`div.fsdocs-tip`) now use the [Popover API](https://developer.mozilla.org/en-US/docs/Web/API/Popover_API) (Baseline 2024: Chrome 114+, Firefox 125+, Safari 17+). Tooltips are placed in the browser's top layer — no `z-index` needed, always above all other content. Fixes a positioning bug where tooltips appeared offset when the page was scrolled. The previous `display`-toggle fallback has been removed. Tooltips also fade in with a subtle animation. [#422](https://github.com/fsprojects/FSharp.Formatting/issues/422), [#1061](https://github.com/fsprojects/FSharp.Formatting/pull/1061)
13
+
* Generated code tokens no longer use inline `onmouseover`/`onmouseout` event handlers. Tooltips are now triggered via `data-fsdocs-tip` / `data-fsdocs-tip-unique` attributes and a delegated event listener in `fsdocs-tips.js`. The `popover` attribute is also added to API-doc tooltip divs so they use the same top-layer path. [#1061](https://github.com/fsprojects/FSharp.Formatting/pull/1061)
16
14
* Changed `range` fields in `MarkdownSpan` and `MarkdownParagraph` DU cases from `MarkdownRange option` to `MarkdownRange`, using `MarkdownRange.zero` as the default/placeholder value instead of `None`.
17
15
* When no template is provided (e.g. `fsdocs convert` without `--template`), `fsdocs-tip` tooltip divs are no longer included in the output. Tooltips require JavaScript/CSS from a template to function, so omitting them produces cleaner raw output. [#1019](https://github.com/fsprojects/FSharp.Formatting/pull/1019)
0 commit comments