Skip to content

fix (InputField): Update Tooltip usage and fix docs css#706

Merged
paanSinghCoder merged 2 commits intomainfrom
fix/update-tooltip-usage
Mar 16, 2026
Merged

fix (InputField): Update Tooltip usage and fix docs css#706
paanSinghCoder merged 2 commits intomainfrom
fix/update-tooltip-usage

Conversation

@paanSinghCoder
Copy link
Contributor

@paanSinghCoder paanSinghCoder commented Mar 16, 2026

Description

fix (InputField): Update Tooltip usage in InputField and fix docs CSS.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes, no bug fixes just code improvements)
  • Chore (changes to the build process or auxiliary tools and libraries such as documentation generation)
  • Style (changes that do not affect the meaning of the code (white-space, formatting, etc))
  • Test (adding missing tests or correcting existing tests)
  • Improvement (Improvements to existing code)
  • Other (please specify)

How Has This Been Tested?

Manual

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (.mdx files)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Summary by CodeRabbit

  • Refactor

    • Improved tooltip rendering in the Input Field component for a more robust tooltip implementation.
  • Documentation

    • Updated Input Field demo playground to include a default width (560px), so all example snippets and previews use consistent sizing.

@paanSinghCoder paanSinghCoder self-assigned this Mar 16, 2026
@vercel
Copy link

vercel bot commented Mar 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
apsara Ready Ready Preview, Comment Mar 16, 2026 8:57am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 16, 2026

📝 Walkthrough

Walkthrough

Removed a trailing newline from a CSS file, refactored InputField's infoTooltip to use Tooltip.Trigger/Tooltip.Content, and added a new width playground control plus applied it to InputField demos.

Changes

Cohort / File(s) Summary
Styling (trivial)
apps/www/src/components/preview/preview.module.css
Removed trailing newline at end of file; no semantic or selector changes.
Tooltip API Refactor
packages/raystack/components/input-field/input-field.tsx
Reworked infoTooltip rendering to use Tooltip with Tooltip.Trigger (render-prop icon) and Tooltip.Content (text on the right) instead of passing a message prop. Public API unchanged.
Docs / Demos
apps/www/src/content/docs/components/input-field/demo.ts
Added playground.controls.width (type: 'text', initialValue: '560px') and applied width="560px" to all InputField demo instances and generated code strings. No runtime logic changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • rsbh

Poem

🐰 I nibbled code crumbs late at night,
Pushed tooltips that pop just right,
A tiny newline gone,
Demos dressed to move on,
Hopping on changes with delight ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix (InputField): Update Tooltip usage and fix docs css' accurately reflects the main changes in the PR. The changeset includes reworking the Tooltip API in InputField and removing a trailing newline in the CSS file, which align with the title's description of updating Tooltip usage and fixing docs CSS.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/update-tooltip-usage
📝 Coding Plan
  • Generate coding plan for human review comments

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
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.

🧹 Nitpick comments (1)
packages/raystack/components/input-field/input-field.tsx (1)

91-97: Switch trigger from <span> to semantic <button> for keyboard accessibility.

The @base-ui/react Tooltip.Trigger does not automatically preserve button semantics or keyboard focusability when a custom element is provided via the render prop. Since a <span> is rendered here, the trigger is not keyboard-accessible. Use a semantic button element with an accessible label instead.

Recommended change
                 <Tooltip.Trigger
                   render={
-                    <span className={styles.helpIcon}>
+                    <button
+                      type='button'
+                      className={styles.helpIcon}
+                      aria-label={`More information about ${label}`}
+                    >
                       <InfoCircledIcon />
-                    </span>
+                    </button>
                   }
                 />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/raystack/components/input-field/input-field.tsx` around lines 91 -
97, The Tooltip.Trigger currently supplies a non-interactive <span> via its
render prop which breaks keyboard accessibility; update the render content in
Tooltip.Trigger to use a semantic <button> (e.g., type="button") instead of the
span so it is focusable and operable via keyboard, keep the
className={styles.helpIcon} to preserve styling, add an appropriate accessible
label (aria-label) or visually hidden text for the InfoCircledIcon, and ensure
any existing click/keyboard handlers still work with the new button element.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/raystack/components/input-field/input-field.tsx`:
- Around line 91-97: The Tooltip.Trigger currently supplies a non-interactive
<span> via its render prop which breaks keyboard accessibility; update the
render content in Tooltip.Trigger to use a semantic <button> (e.g.,
type="button") instead of the span so it is focusable and operable via keyboard,
keep the className={styles.helpIcon} to preserve styling, add an appropriate
accessible label (aria-label) or visually hidden text for the InfoCircledIcon,
and ensure any existing click/keyboard handlers still work with the new button
element.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0a2ffce9-302a-4aff-9d79-cde9e6eaa684

📥 Commits

Reviewing files that changed from the base of the PR and between 600819e and 35d8026.

📒 Files selected for processing (2)
  • apps/www/src/components/preview/preview.module.css
  • packages/raystack/components/input-field/input-field.tsx

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.

🧹 Nitpick comments (1)
apps/www/src/content/docs/components/input-field/demo.ts (1)

37-37: Use a shared constant for demo width to reduce drift.

"560px" is duplicated across multiple snippets. Centralizing it will make future updates safer and faster.

Refactor sketch
+const DEFAULT_DEMO_WIDTH = '560px';
+
 export const playground = {
   type: 'playground',
   controls: {
@@
-    width: { type: 'text', initialValue: '560px' },
+    width: { type: 'text', initialValue: DEFAULT_DEMO_WIDTH },
@@
 export const basicDemo = {
   type: 'code',
   code: `
   <InputField
   label="Default"
   placeholder="Enter text"
-  width="560px"
+  width="${DEFAULT_DEMO_WIDTH}"
 />`
 };
@@
 export const helperTextDemo = {
   type: 'code',
   code: `
   <InputField
   label="With label"
   placeholder="Enter text"
   helperText="This is a helper text"
-  width="560px"
+  width="${DEFAULT_DEMO_WIDTH}"
 />`
 };

Also applies to: 47-47, 57-57, 68-68, 79-79, 89-89, 99-99

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/www/src/content/docs/components/input-field/demo.ts` at line 37, The
demos in apps/www/src/content/docs/components/input-field/demo.ts repeat the
literal "560px" across multiple snippets; define a single shared constant (e.g.,
const DEMO_WIDTH = "560px") at the top of the module and replace each
width="560px" occurrence with width={DEMO_WIDTH} (or width={DEMO_WIDTH} string
usage appropriate to the existing JSX/snippet syntax) so all demos (the repeated
occurrences around the input-field examples) reference the shared DEMO_WIDTH
constant.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/www/src/content/docs/components/input-field/demo.ts`:
- Line 37: The demos in apps/www/src/content/docs/components/input-field/demo.ts
repeat the literal "560px" across multiple snippets; define a single shared
constant (e.g., const DEMO_WIDTH = "560px") at the top of the module and replace
each width="560px" occurrence with width={DEMO_WIDTH} (or width={DEMO_WIDTH}
string usage appropriate to the existing JSX/snippet syntax) so all demos (the
repeated occurrences around the input-field examples) reference the shared
DEMO_WIDTH constant.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 664fe627-e658-43b0-8227-cab2b0246526

📥 Commits

Reviewing files that changed from the base of the PR and between 35d8026 and 50959a4.

📒 Files selected for processing (2)
  • apps/www/src/components/preview/preview.module.css
  • apps/www/src/content/docs/components/input-field/demo.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/www/src/components/preview/preview.module.css

@paanSinghCoder paanSinghCoder merged commit 23686c9 into main Mar 16, 2026
5 checks passed
@paanSinghCoder paanSinghCoder deleted the fix/update-tooltip-usage branch March 16, 2026 10:55
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