Skip to content

Add Connect Tools section to TOC on Redpanda Connect pages#363

Merged
JakeSCahill merged 12 commits intomainfrom
feature/connect-tools-toc
Feb 6, 2026
Merged

Add Connect Tools section to TOC on Redpanda Connect pages#363
JakeSCahill merged 12 commits intomainfrom
feature/connect-tools-toc

Conversation

@JakeSCahill
Copy link
Copy Markdown
Contributor

@JakeSCahill JakeSCahill commented Feb 4, 2026

https://deploy-preview-363--docs-ui.netlify.app/

2026-02-05_11-20-47

Summary

  • Adds a configurable Tools section to the TOC sidebar
  • Any Antora component can define their own tools section via attributes
  • Links support Antora resource IDs, absolute paths, and external URLs
  • Sticky at bottom of TOC with scrollable headings above
  • Fixes TOC highlight sync and scroll-to-active on page load
  • Adds preload on hover for Try It buttons

How to Use

Add these attributes to your component's antora.yml:

asciidoc:
  attributes:
    toc-tools-title: Connect Tools
    toc-tools-links: '[{"text": "Bloblang Playground", "url": "redpanda-connect:guides:bloblang/walkthrough.adoc", "icon": "terminal"}, {"text": "Claude AI Skills", "url": "https://github.com/redpanda-data/connect/blob/main/.claude-plugin/README.md", "icon": "layers", "external": true}]'

Link Properties

Property Required Description
text Yes Display text for the link
url Yes Antora resource ID, absolute path (/foo/bar.html), or external URL
icon No Icon name: terminal or layers
external No Set to true for external links (opens in new tab)

URL Types

  • Antora resource IDs (e.g. redpanda-connect:guides:bloblang/walkthrough.adoc) - resolved relative to current page
  • Absolute paths (e.g. /redpanda-connect/24.3/guides/bloblang/walkthrough.html) - used as-is
  • External URLs (e.g. https://example.com) - requires external: true

Test plan

  • Visit any Redpanda Connect page
  • Verify Connect Tools section appears at bottom of TOC
  • Click links to confirm they work
  • Scroll page and verify TOC highlighting matches current section
  • Navigate to a heading via hash - TOC should scroll that item into view
  • Test on mobile - tools should appear in dropdown TOC

@netlify
Copy link
Copy Markdown

netlify bot commented Feb 4, 2026

Deploy Preview for docs-ui ready!

Name Link
🔨 Latest commit 2cd34ce
🔍 Latest deploy log https://app.netlify.com/projects/docs-ui/deploys/6985a4137ed97b00081001a4
😎 Deploy Preview https://deploy-preview-363--docs-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 29 (🟢 up 4 from production)
Accessibility: 93 (no change from production)
Best Practices: 100 (no change from production)
SEO: 89 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 4, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
📝 Walkthrough

Walkthrough

The PR introduces a Connect Tools Floating Action Button feature on the Connect page. A new CSS module provides styling for a mobile-first FAB with expanded menu, desktop TOC integration, dark mode support, and accessibility considerations. JavaScript initializes the FAB, detects first-time users via localStorage, manages menu toggles with keyboard navigation, and handles tooltip dismissal. New Handlebars partials define the FAB markup and integrate Connect Tools links (Bloblang Playground and Claude AI Skills) into both the mobile FAB and desktop TOC sidebar. Additional changes include scroll padding calculations and resource preloading for the Bloblang interactive tool.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • paulohtb6
  • micheleRP
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main feature addition - a Connect Tools section to the TOC on Redpanda Connect pages, which aligns with the primary changes across multiple files.
Description check ✅ Passed The PR description directly addresses the changeset: adds a Connect Tools section to the TOC sidebar with configurable links, fixes TOC highlight sync, and adds preload behavior.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/connect-tools-toc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/js/18-connect-tools-fab.js`:
- Around line 30-36: The code currently guards only for fab and trigger but not
menu, which leads to runtime errors when menu is missing; update the
early-return guard in the top-level block that references fab and trigger to
also check menu (e.g., if (!fab || !trigger || !menu) return) and/or add
null-safe checks before any later uses of menu in functions that reference
connect-tools-menu (locations using menu at/around where it's referenced later);
ensure tooltip and tooltipDismiss logic remains unchanged but any code that
calls methods on menu is protected by the new guard or explicit null checks.
🧹 Nitpick comments (4)
src/partials/connect-tools-fab.hbs (1)

13-19: Consider adding aria-hidden="true" to decorative SVG icons.

The SVG icons are decorative since accompanying text labels provide meaning. Adding aria-hidden="true" prevents screen readers from announcing them.

Example for one icon
-    <svg class="fab-icon fab-icon-tools" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+    <svg class="fab-icon fab-icon-tools" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">

Also applies to: 36-39, 54-58

src/partials/toc.hbs (1)

20-23: SVG icons rely on CSS for stroke color.

The SVGs don't have an explicit stroke attribute in the markup; instead, they rely on .toc-connect-tools-list svg { stroke: currentColor; } from the CSS. This works but could cause invisible icons if CSS fails to load.

Add defensive stroke attribute
-          <svg viewBox="0 0 24 24" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+          <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">

Also applies to: 29-32

src/js/18-connect-tools-fab.js (2)

9-15: Preview mode may show Connect Tools on non-Connect pages.

The isPreview check enables Connect Tools on all pages during local development (localhost/127.0.0.1), not just Connect pages. This could cause confusion when testing other documentation sections locally.

Consider either:

  1. Removing the preview bypass if not needed
  2. Adding a query param override (e.g., ?connectTools=true) for explicit testing

38-39: Disabled FAB still has active event handlers attached.

The FAB is disabled (line 39 commented out), but all subsequent event listeners (click, keydown) are still attached. If the FAB is intentionally hidden, consider returning early after line 39 to avoid setting up unused handlers. Alternatively, if this is temporary scaffolding for future mobile support, a brief comment explaining the intent would help maintainability.

- Move component detection from JS to Handlebars templates
- Components can now define toc-tools-title and toc-tools-links in antora.yml
- URLs can be Antora resource IDs (resolved automatically), absolute paths, or external URLs
- External URLs bypass resolution and open in new tab
- Fix mobile TOC: hide sidebar properly, add indentation for dropdown items
- Fix mobile nav cutoff when no version dropdown exists
- Add scrollable TOC with Connect Tools pinned at bottom on desktop
- Scroll active TOC item into view on page load and navigation
- Add starts-with helper for URL type detection
- Update preview to support component version attributes
- toc-connect-tools → toc-tools
- has-connect-tools → has-toc-tools
- tocConnectTools → tocTools
@JakeSCahill JakeSCahill requested a review from a team February 5, 2026 10:24
JakeSCahill and others added 5 commits February 5, 2026 11:25
Add missing closing quote in URL property that was causing JSON parse error during preview build.
- Defer VWO script loading and remove body-hiding behavior
- Lazy load Kapa AI widget on first interaction (Cmd+K or click)
- Lazy load Algolia search scripts on search focus
- Add passive event listeners to scroll handlers
- Fix single-click activation for Kapa and Algolia lazy loading

Key improvements:
- Total Blocking Time: 2,370ms -> 110ms (-95%)
- JS Execution Time: 4.5s -> 0.6s (-87%)
- Unused JavaScript: 918 KiB -> 26 KiB (-97%)
Changed FAB template to use 'text' property instead of 'label' to match
the desktop TOC tools section in toc.hbs. Both templates now consistently
use the same property names from toc-tools-links configuration.
The h3 "On this page" title was being added inside .toc-menu, causing
a 40px gap at the top of the scrollable area when Connect Tools section
is visible. Now the h3 is inserted before .toc-menu so it stays fixed
while the TOC content scrolls.
@JakeSCahill JakeSCahill merged commit 7f5da5f into main Feb 6, 2026
7 checks passed
@JakeSCahill JakeSCahill deleted the feature/connect-tools-toc branch February 6, 2026 08:27
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.

2 participants