From 3ad29c25e3616f702ef6a211c6f90fed7d089bf3 Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Sun, 29 Mar 2026 14:20:43 +0100 Subject: [PATCH 1/2] Collapse TOC into sticky popover button on plugin and docs pages Replaces inline table of contents with a Flux dropdown/popover button that sticks to the top-right of the content area. Applied to both plugin detail pages (Alpine-driven dynamic headings) and docs pages (server-side TOC data). Adds scrollbar width compensation CSS for modal and popover overlay states. Co-Authored-By: Claude Opus 4.6 --- resources/css/app.css | 9 ++- .../docs/toc-and-sponsors.blade.php | 29 --------- .../views/components/plugin-toc.blade.php | 33 +++++----- resources/views/docs/index.blade.php | 59 +++++++++-------- resources/views/plugin-show.blade.php | 64 ++++++++++--------- 5 files changed, 91 insertions(+), 103 deletions(-) diff --git a/resources/css/app.css b/resources/css/app.css index 601e0ffa..31eee117 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -79,9 +79,16 @@ } } -/* Prevents scrollbars from appearing when a popover is open */ +/* Compensate for custom scrollbar width when overflow is hidden */ +/* Browser UA sets overflow:hidden on html:has(:modal); Flux JS sets it for menus */ +/* Neither adds padding-right to prevent layout shift with custom 8px scrollbar */ +html:has(dialog:modal) { + padding-right: 8px !important; +} + html:has(#mobile-menu-popover:popover-open) { overflow: hidden; + padding-right: 8px; } /* Scrollbar width */ diff --git a/resources/views/components/docs/toc-and-sponsors.blade.php b/resources/views/components/docs/toc-and-sponsors.blade.php index a20a78ca..528919a5 100644 --- a/resources/views/components/docs/toc-and-sponsors.blade.php +++ b/resources/views/components/docs/toc-and-sponsors.blade.php @@ -1,35 +1,6 @@ {{-- Copy as Markdown Button --}} -{{-- On this page --}} -

- {{-- Icon --}} - - - {{-- Label --}} -
On this page
-

- -{{-- Table of contents --}} -@if (count($tableOfContents) > 0) - -@endif -
diff --git a/resources/views/components/plugin-toc.blade.php b/resources/views/components/plugin-toc.blade.php index ad14bdf3..c7caa739 100644 --- a/resources/views/components/plugin-toc.blade.php +++ b/resources/views/components/plugin-toc.blade.php @@ -15,21 +15,24 @@ }" x-show="headings.length > 0" x-cloak - class="mb-6" > -

- -
On this page
-

+ + + + On this page + -
- -
+ + + +
diff --git a/resources/views/docs/index.blade.php b/resources/views/docs/index.blade.php index 71d16f22..05aaed50 100644 --- a/resources/views/docs/index.blade.php +++ b/resources/views/docs/index.blade.php @@ -53,37 +53,40 @@ {{-- Copy as Markdown Button --}} -
-

- {{-- Icon --}} - - {{-- Label --}} -
On this page
-

- @if (count($tableOfContents) > 0) - - @endif -
- + @if (count($tableOfContents) > 0) +
+
+ + + + On this page + + + + + + +
+
+ @endif +
{!! $content !!}
diff --git a/resources/views/plugin-show.blade.php b/resources/views/plugin-show.blade.php index 8bfd2888..efea1b6f 100644 --- a/resources/views/plugin-show.blade.php +++ b/resources/views/plugin-show.blade.php @@ -95,38 +95,42 @@ class="font-mono text-2xl font-bold sm:text-3xl"
- {{-- Main content - README --}} -
- @if ($plugin->readme_html) - - @endif - -
+ {{-- Main content - README --}} +
@if ($plugin->readme_html) - {!! $plugin->readme_html !!} - @else -
-

- README not available yet. -

-
+
+
+ +
+
@endif -
-
+ +
+ @if ($plugin->readme_html) + {!! $plugin->readme_html !!} + @else +
+

+ README not available yet. +

+
+ @endif +
+
{{-- Sidebar - Plugin details --}}