Skip to content

docs: Add AI disclosure example to Tooltip docs - #4126

Open
dsumeet14 wants to merge 1 commit into
Workday:masterfrom
dsumeet14:ai-disclosure-tooltip-example
Open

docs: Add AI disclosure example to Tooltip docs#4126
dsumeet14 wants to merge 1 commit into
Workday:masterfrom
dsumeet14:ai-disclosure-tooltip-example

Conversation

@dsumeet14

@dsumeet14 dsumeet14 commented Aug 6, 2026

Copy link
Copy Markdown

Summary

Fixes: #4125

Release Category

Components


Checklist

For the Reviewer

  • PR title is short and descriptive
  • PR summary describes the change (Fixes/Resolves linked correctly)
  • PR Release Notes describes additional information useful to call out in a release message or removed if not applicable
  • Breaking Changes provides useful information to upgrade to this code or removed if not applicable

Where Should the Reviewer Start?

Areas for Feedback? (optional)

  • Code
  • Documentation
  • Testing
  • Codemods

Testing Manually

Screenshots or GIFs (if applicable)

Default:
tooltip-ai-disclosure-closed

Tooltip visible:
tooltip-ai-disclosure-open

Thank You

Summary by CodeRabbit

  • New Features
    • Added an example showing how to disclose AI-generated content using a tooltip.
    • Included an interactive icon button, descriptive text, and an external source link.
  • Documentation
    • Added usage guidance and a Storybook example for AI disclosure with tooltips.

@dsumeet14
dsumeet14 requested a review from a team as a code owner August 6, 2026 22:34
Copilot AI lite review requested due to automatic review settings August 6, 2026 22:34
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds an AIDisclosure React example that uses a Tooltip to disclose AI-generated content. Registers the example in Storybook and adds corresponding Tooltip documentation.

Changes

AI disclosure Tooltip example

Layer / File(s) Summary
AI disclosure component
modules/react/tooltip/stories/examples/AIDisclosure.tsx
Adds the AIDisclosure component with themed styling, octopus content, an AI disclosure Tooltip, an accessible tertiary button, and an external Wikipedia link.
Storybook and documentation integration
modules/react/tooltip/stories/Tooltip.stories.ts, modules/react/tooltip/stories/Tooltip.mdx
Registers AIDisclosure as a Tooltip story and adds an AI Disclosure documentation section that renders the example.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: ready for review

Suggested reviewers: copilot, sheelah, mannycarrera4

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The changes add a Tooltip AI disclosure example but do not address SidePanel RTL icon position or direction requirements [#1234]. Add the SidePanel RTL implementation and validation changes, or link the correct issue for this documentation-only PR.
Out of Scope Changes check ⚠️ Warning The Tooltip AI disclosure documentation and story are unrelated to the linked SidePanel RTL support requirements [#1234]. Move these Tooltip documentation changes to a separate PR or link an issue that covers the AI disclosure example.
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding an AI disclosure example to the Tooltip documentation.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Tooltip documentation example illustrating an “AI disclosure” pattern, intended to help consumers communicate when content/functionality is AI-powered.

Changes:

  • Adds a new AIDisclosure Storybook story for Tooltip.
  • Extends Tooltip MDX docs with an “AI Disclosure” section and embedded example.
  • Introduces a new AIDisclosure example component demonstrating the pattern in context.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
modules/react/tooltip/stories/Tooltip.stories.ts Registers the new AIDisclosure story render entry for Storybook.
modules/react/tooltip/stories/Tooltip.mdx Adds an “AI Disclosure” documentation section and renders the new example.
modules/react/tooltip/stories/examples/AIDisclosure.tsx Implements the new example UI combining Card, Tooltip, TertiaryButton, and ExternalHyperlink.
Suppressed comments (1)

modules/react/tooltip/stories/examples/AIDisclosure.tsx:31

  • ExternalHyperlink renders an external-link icon with role="img" and uses iconLabel for its accessible name. In this example iconLabel is omitted, so the icon may be announced without a label (or inconsistently across AT), which is an accessibility regression compared to other ExternalHyperlink examples in the repo.
          <ExternalHyperlink href="https://en.wikipedia.org/wiki/Giant_Pacific_octopus">

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +19 to +25
<Tooltip title="This content is generated by AI" variant="alt" placement="right-end">
<TertiaryButton
size="extraSmall"
icon={infoSparkleIcon}
aria-label="This functionality is powered by AI"
/>
</Tooltip>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@modules/react/tooltip/stories/examples/AIDisclosure.tsx`:
- Around line 19-24: Update the TertiaryButton aria-label in the AIDisclosure
example to use the same canonical disclosure statement as the Tooltip title, so
both surfaces communicate “This content is generated by AI” while preserving the
button’s accessible name.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 95427452-5bd8-425b-9e91-f9f73ec081be

📥 Commits

Reviewing files that changed from the base of the PR and between 90edf81 and f7ac088.

📒 Files selected for processing (3)
  • modules/react/tooltip/stories/Tooltip.mdx
  • modules/react/tooltip/stories/Tooltip.stories.ts
  • modules/react/tooltip/stories/examples/AIDisclosure.tsx

Comment on lines +19 to +24
<Tooltip title="This content is generated by AI" variant="alt" placement="right-end">
<TertiaryButton
size="extraSmall"
icon={infoSparkleIcon}
aria-label="This functionality is powered by AI"
/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Align the accessible name with the disclosure text.

The Tooltip displays This content is generated by AI, but the button name is This functionality is powered by AI. Use one canonical disclosure statement for both surfaces.

Proposed fix
-              aria-label="This functionality is powered by AI"
+              aria-label="This content is generated by AI"

As per coding guidelines: interactive elements must have accessible names.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Tooltip title="This content is generated by AI" variant="alt" placement="right-end">
<TertiaryButton
size="extraSmall"
icon={infoSparkleIcon}
aria-label="This functionality is powered by AI"
/>
<Tooltip title="This content is generated by AI" variant="alt" placement="right-end">
<TertiaryButton
size="extraSmall"
icon={infoSparkleIcon}
aria-label="This content is generated by AI"
/>
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modules/react/tooltip/stories/examples/AIDisclosure.tsx` around lines 19 -
24, Update the TertiaryButton aria-label in the AIDisclosure example to use the
same canonical disclosure statement as the Tooltip title, so both surfaces
communicate “This content is generated by AI” while preserving the button’s
accessible name.

Source: Coding guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Add a "This functionality is powered by AI." Disclosure example to our Tooltip docs

3 participants