Skip to content

Conversation

@JakeSCahill
Copy link
Contributor

@JakeSCahill JakeSCahill commented Jun 6, 2025

This pull request introduces enhancements to the styling and behavior of beta labels. The changes improve the visual appearance of beta labels, add dynamic visibility behavior, and enhance user experience with tooltips and sticky navigation.

Before, the beta badge appeared only below the h1, so if a user entered the page halfway down, they wouldn't see it.
To mitigate this issue, this PR adds a feature to make a beta badge appear in the table on contents when you scroll down.

2025-06-06_16-03-55.mp4

Styling Improvements for Beta Labels:

  • src/css/context-switcher.css: Updated .beta-label and .beta-label > p styles to include bold font weight, adjusted border thickness, and added new properties like min-width, margin-top, and background-color. Introduced .nav-beta-label and .nav-beta-container classes for sticky navigation and improved display behavior. [1] [2] [3]

Theme Variable Updates:

  • src/css/vars.css: Added new theme variables (--beta-label-color, --beta-label-background, --beta-label-border) to ensure consistent styling of beta labels across light and dark themes.

Template Enhancements for Beta Labels:

  • src/partials/article.hbs: Replaced the previous tooltip implementation for .beta-label p with a more dynamic setup, including intersection observer logic to toggle visibility of .nav-beta-label based on scroll position.
  • src/partials/toc.hbs: Added a conditional block to display a sticky .nav-beta-label container when the page has a beta attribute.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 6, 2025

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.

📝 Walkthrough

Walkthrough

The changes update the styling and behavior of the "beta" label in the documentation. The CSS for .beta-label is modified to increase its size, boldness, and adjust its colors and borders using new CSS variables. Additional styles and variables for dark theme support are introduced for navigation-related beta labels. The sidebar table of contents now conditionally displays a navigation beta label if the page is marked as beta. JavaScript logic is added to toggle the visibility of the navigation beta label based on the scroll position, ensuring it appears when the main beta label is out of view.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DOM
    participant BetaLabelScript
    participant NavBetaLabel

    User->>DOM: Loads documentation page
    DOM->>BetaLabelScript: Fires DOMContentLoaded
    BetaLabelScript->>DOM: Selects .beta-label p and .nav-beta-label
    BetaLabelScript->>DOM: Sets up Tippy tooltips on both labels
    BetaLabelScript->>DOM: Sets up IntersectionObserver on .beta-label p
    loop On scroll or layout change
        DOM->>BetaLabelScript: Triggers IntersectionObserver callback
        alt .beta-label p is fully visible
            BetaLabelScript->>NavBetaLabel: Remove "visible" class
        else .beta-label p is not fully visible
            BetaLabelScript->>NavBetaLabel: Add "visible" class
        end
    end
Loading

Assessment against linked issues

Objective (Issue) Addressed Explanation
Increase beta badge size and make it bold (DOC-1258)
Make beta badge more visible, use red color (DOC-1258)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes were found.


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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@JakeSCahill JakeSCahill requested a review from kbatuigas June 6, 2025 10:14
@netlify
Copy link

netlify bot commented Jun 6, 2025

Deploy Preview for docs-ui ready!

Name Link
🔨 Latest commit 155c7e8
🔍 Latest deploy log https://app.netlify.com/projects/docs-ui/deploys/6843092f0f62120008eed4f5
😎 Deploy Preview https://deploy-preview-298--docs-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

Copy link
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: 0

🧹 Nitpick comments (1)
src/partials/article.hbs (1)

34-73: Effective implementation with opportunity for refactoring.

The script correctly uses DOMContentLoaded, includes proper error handling, and the IntersectionObserver logic is sound. However, consider extracting the duplicated tippy configuration to reduce code repetition.

+    const tippyConfig = {
+      content: "This feature is in beta. Features in beta are available for testing and feedback. They are not supported by Redpanda and should not be used in production environments.",
+      animation: "scale",
+      theme: "redpanda-term",
+      touch: "hold",
+      interactive: true,
+      allowHTML: true,
+    };
+    
-    tippy(navBadge, {
-      content:
-        "This feature is in beta. Features in beta are available for testing and feedback. They are not supported by Redpanda and should not be used in production environments.",
-      animation: "scale",
-      theme: "redpanda-term",
-      touch: "hold",
-      interactive: true,
-      allowHTML: true,
-    });
-    tippy(topBadge, {
-      content:
-        "This feature is in beta. Features in beta are available for testing and feedback. They are not supported by Redpanda and should not be used in production environments.",
-      animation: "scale",
-      theme: "redpanda-term",
-      touch: "hold",
-      interactive: true,
-      allowHTML: true,
-    });
+    tippy(navBadge, tippyConfig);
+    tippy(topBadge, tippyConfig);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fa9c9e6 and 40a9a04.

📒 Files selected for processing (4)
  • src/css/context-switcher.css (3 hunks)
  • src/css/vars.css (1 hunks)
  • src/partials/article.hbs (1 hunks)
  • src/partials/toc.hbs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (4)
src/css/vars.css (1)

121-123: LGTM! Well-structured CSS variable definitions.

The new beta label variables follow established naming conventions and correctly reference existing theme variables for consistency. Good abstraction for maintainable theming.

src/partials/toc.hbs (1)

6-10: Clean conditional markup with appropriate accessibility consideration.

The Handlebars syntax is correct and the aria-hidden="true" attribute is appropriate for this supplementary visual indicator. The conditional logic properly integrates with the existing TOC structure.

src/css/context-switcher.css (2)

11-48: Excellent styling updates with consistent design patterns.

The changes properly utilize the new CSS variables, maintain consistency with existing font size calculations, and enhance the visual prominence of beta labels appropriately. The transition from 1px to 2px border and addition of minimum width improves visual clarity.


50-78: Well-implemented navigation beta label with effective visibility control.

The sticky positioning and z-index management are appropriate for the TOC context. The visibility toggle using display: none/inline-flex provides clean state transitions, and the styling maintains consistency with the main beta label.

@Feediver1
Copy link
Contributor

Can you make the "beta" font larger--seems like the badge/box would accommodate 1 pt up, no? Trying to make sure it is impossible to miss, as that was part of the original request.

@JakeSCahill JakeSCahill requested a review from Feediver1 June 6, 2025 15:29
Copy link
Contributor

@Feediver1 Feediver1 left a comment

Choose a reason for hiding this comment

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

LGTM--thanks @JakeSCahill

@JakeSCahill JakeSCahill merged commit ccf3fad into main Jun 6, 2025
6 checks passed
@JakeSCahill JakeSCahill deleted the DOC-1258 branch June 6, 2025 15:43
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.

3 participants