Skip to content

feat: Update Toast and Tooltip styles to match Sana#4053

Open
RayRedGoose wants to merge 7 commits into
Workday:prerelease/majorfrom
RayRedGoose:issue3989_toast-tooltip
Open

feat: Update Toast and Tooltip styles to match Sana#4053
RayRedGoose wants to merge 7 commits into
Workday:prerelease/majorfrom
RayRedGoose:issue3989_toast-tooltip

Conversation

@RayRedGoose

@RayRedGoose RayRedGoose commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes: #3989

Update Toast and Tooltip styles to match Sana

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)

Thank You Gif (optional)

Summary by CodeRabbit

  • Documentation
    • Updated the v16 upgrade guide with clearer Table of Contents and added Toast/Tooltip component visual update notes, including codemod instruction formatting.
  • New Features
    • Added a KBD in Tooltip Storybook example demonstrating copy-to-clipboard tooltip content with a keyboard shortcut hint.
  • Bug Fixes
    • Refreshed Toast visuals (padding/gaps, border/shadow, close icon placement/sizing) and updated icon color usage across toast examples.
    • Refreshed Tooltip visuals (surface/border, spacing/typography, focused-state behavior).
    • Adjusted disabled styling for the Checkbox label (removed extra disabled opacity).

@RayRedGoose RayRedGoose requested a review from a team as a code owner July 8, 2026 18:52
Copilot AI review requested due to automatic review settings July 8, 2026 18:52
@RayRedGoose RayRedGoose added the ready for review Code is ready for review label Jul 8, 2026
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Toast and Tooltip receive updated v16 styling. KBD gains an “In Tooltip” example and story, Checkbox disabled opacity is removed, and the v16 upgrade guides document component and codemod updates.

Changes

v16 component and guide updates

Layer / File(s) Summary
Toast styling and examples
modules/react/toast/lib/*, modules/react/toast/stories/examples/*
Toast layout, tokens, icon positioning, and close-button sizing are updated; story examples use brand foreground tokens.
Tooltip container restyling
modules/react/tooltip/lib/TooltipContainer.tsx
Tooltip typography, surface, border, padding, spacing, and focused-state margin are updated.
KBD-in-Tooltip example and story
modules/labs-react/kbd/stories/*
A new InTooltip example renders a keyboard shortcut inside a Tooltip and is added to Storybook and documentation.
Checkbox disabled styling
modules/react/checkbox/lib/CheckboxContainer.tsx
Disabled Checkbox styling no longer applies the disabled opacity token.
Upgrade guide component and codemod updates
modules/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md, modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx
The guides add Toast and Tooltip visual updates and reformat related navigation, codemod blocks, and guidance text.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: williamjstanton, josh-bagwell, sheelah

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning [#3989] Toast and Tooltip style updates are present, but the required Tooltip opt-in Kbd slot implementation is not shown. Implement the Tooltip Kbd slot API and behavior, or document why it cannot ship yet and align the PR scope with the issue.
Out of Scope Changes check ⚠️ Warning The Checkbox disabled opacity change is unrelated to the Toast/Tooltip objectives and appears out of scope. Remove the CheckboxContainer opacity change unless it is required for the linked Toast/Tooltip work.
✅ 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 accurately summarizes the main change: Toast and Tooltip style updates to match Sana.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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

Updates Toast and Tooltip component styling to align with Sana/v16 visual design, and documents these changes in the v16 upgrade guide. Also adds a KBD Storybook example demonstrating use of KBD within a Tooltip title.

Changes:

  • Restyles TooltipContainer (type level, padding, light surface + border, rounding, spacing).
  • Restyles Toast container and subcomponents (container padding/gap/border/shadow, icon sizing, close icon positioning/size, body spacing).
  • Adds KBD “In Tooltip” Storybook example and updates v16 upgrade guides (MDX + LLM copy) with Toast/Tooltip notes.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
modules/react/tooltip/lib/TooltipContainer.tsx Tooltip container visual/token updates for Sana styling
modules/react/toast/lib/Toast.tsx Toast container layout + v16 token styling (padding, border, surface, shadow)
modules/react/toast/lib/ToastBody.tsx Adjust Toast body spacing to match new container padding strategy
modules/react/toast/lib/ToastIcon.tsx Update Toast icon sizing approach
modules/react/toast/lib/ToastCloseIcon.tsx Update close icon positioning and size
modules/labs-react/kbd/stories/KBD.stories.tsx Adds new “InTooltip” story export
modules/labs-react/kbd/stories/KBD.mdx Documents new “In Tooltip” example usage
modules/labs-react/kbd/stories/examples/InTooltip.tsx New example showing KBD content within Tooltip title
modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx Adds Toast/Tooltip upgrade notes
modules/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md Mirrors upgrade notes for LLM docs

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

Comment thread modules/react/tooltip/lib/TooltipContainer.tsx
Comment thread modules/labs-react/kbd/stories/examples/InTooltip.tsx Outdated
Comment thread modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx Outdated
Comment thread modules/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md Outdated
Comment thread modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx

@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: 4

🧹 Nitpick comments (1)
modules/labs-react/kbd/stories/examples/InTooltip.tsx (1)

24-31: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Simplify the KBD nesting structure.

The current structure nests KBD inside KBD.Item inside an outer KBD, which is more complex than the documented pattern. The standard usage shown in KBD.mdx is a flat KBD with KBD.Item children. The outer KBD and its single KBD.Item wrapper add no visual or semantic value.

♻️ Proposed simplification
-          <KBD aria-keyshortcuts="Command+P">
-            <KBD.Item>
-              <KBD variant="plain">
-                <KBD.Item>⌘</KBD.Item>
-                <KBD.Item>C</KBD.Item>
-              </KBD>
-            </KBD.Item>
-          </KBD>
+          <KBD variant="plain">
+            <KBD.Item aria-label="Command">⌘</KBD.Item>
+            <KBD.Item>C</KBD.Item>
+          </KBD>
🤖 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/labs-react/kbd/stories/examples/InTooltip.tsx` around lines 24 - 31,
The KBD example uses an unnecessary nested wrapper pattern, with a KBD inside
KBD.Item inside an outer KBD, which should be simplified to the documented flat
KBD composition. Update the InTooltip story to use the KBD component directly
with KBD.Item children, removing the extra outer KBD and the single-item wrapper
while preserving the same displayed shortcut keys and aria-keyshortcuts
behavior.
🤖 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/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md`:
- Around line 261-273: The Toast entry in the upgrade guide is missing the
standard PR reference used by other Component Updates sections. Update the Toast
section in the docs upgrade guide to include a matching PR link, following the
same `**PR:**` pattern as Avatar, Buttons, and Card so it is consistent and
traceable.

In `@modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx`:
- Around line 267-279: The Toast section under Component Updates is missing the
standard PR reference used by the other component entries. Update the Toast
subsection in the upgrade guide to include a matching `**PR:**` link for
traceability, consistent with the Avatar, Buttons, and Card sections, and place
it alongside the existing Toast notes so the section format stays uniform.

In `@modules/labs-react/kbd/stories/examples/InTooltip.tsx`:
- Around line 24-35: Update the InTooltip example to add accessible names where
assistive text is missing: in the KBD composition, give the glyph item for ⌘ an
aria-label with the spoken modifier name, and give the icon-only SecondaryButton
an aria-label that describes its action. Use the existing KBD and
SecondaryButton usages in InTooltip.tsx to locate the spots and keep the visible
UI unchanged.
- Around line 24-31: The shortcut metadata is attached to the wrong element and
uses the wrong value: in the InTooltip example, `aria-keyshortcuts` on the `KBD`
display should be changed to match the visual shortcut (`Command+C`), and the
actual `aria-keyshortcuts` should be moved onto the `SecondaryButton` control
that the shortcut activates. Update the `KBD`/`KBD.Item` tooltip markup
accordingly so the accessible shortcut exposed to assistive tech matches the
displayed keys and follows the documented pattern.

---

Nitpick comments:
In `@modules/labs-react/kbd/stories/examples/InTooltip.tsx`:
- Around line 24-31: The KBD example uses an unnecessary nested wrapper pattern,
with a KBD inside KBD.Item inside an outer KBD, which should be simplified to
the documented flat KBD composition. Update the InTooltip story to use the KBD
component directly with KBD.Item children, removing the extra outer KBD and the
single-item wrapper while preserving the same displayed shortcut keys and
aria-keyshortcuts behavior.
🪄 Autofix (Beta)

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: e2eea64a-0a8c-46b2-8322-3f722ce09f5f

📥 Commits

Reviewing files that changed from the base of the PR and between df9a69a and e2df3a9.

📒 Files selected for processing (10)
  • modules/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md
  • modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx
  • modules/labs-react/kbd/stories/KBD.mdx
  • modules/labs-react/kbd/stories/KBD.stories.tsx
  • modules/labs-react/kbd/stories/examples/InTooltip.tsx
  • modules/react/toast/lib/Toast.tsx
  • modules/react/toast/lib/ToastBody.tsx
  • modules/react/toast/lib/ToastCloseIcon.tsx
  • modules/react/toast/lib/ToastIcon.tsx
  • modules/react/tooltip/lib/TooltipContainer.tsx

Comment thread modules/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md
Comment thread modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx
Comment thread modules/labs-react/kbd/stories/examples/InTooltip.tsx Outdated
Comment thread modules/labs-react/kbd/stories/examples/InTooltip.tsx Outdated
@cypress

cypress Bot commented Jul 8, 2026

Copy link
Copy Markdown

Workday/canvas-kit    Run #11237

Run Properties:  status check passed Passed #11237  •  git commit e49f3850cf ℹ️: Merge c7b9df51b97ebeadcc46fd11b0a43318b25df5ce into fc927ea8a9cdb16ad227bbfc5d84...
Project Workday/canvas-kit
Branch Review issue3989_toast-tooltip
Run status status check passed Passed #11237
Run duration 02m 25s
Commit git commit e49f3850cf ℹ️: Merge c7b9df51b97ebeadcc46fd11b0a43318b25df5ce into fc927ea8a9cdb16ad227bbfc5d84...
Committer Raisa Primerova
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 17
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 809
View all changes introduced in this branch ↗︎
UI Coverage  19.58%
  Untested elements 1534  
  Tested elements 371  
Accessibility  99.37%
  Failed rules  5 critical   5 serious   0 moderate   2 minor
  Failed elements 72  

@RayRedGoose RayRedGoose added the needs-a11y Extra attention from accessibility is needed label Jul 9, 2026
Comment thread modules/react/tooltip/lib/TooltipContainer.tsx
Comment thread modules/labs-react/kbd/stories/examples/InTooltip.tsx Outdated
Comment thread modules/react/toast/lib/Toast.tsx Outdated

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

LG! Left just a few minor comments.

@williamjstanton williamjstanton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good!

I think I missed some things in the KBD PR examples and we may need to polish many if not all of them. :(

  • aria-keyshortcuts isn't supposed to go on the presentational KBD wrapper, it should be on the interactive control witht he key listener.
  • The <KBD.Item> components that use glyphs need translated aria-label strings. (E.g. "Command", "Control", etc. )

@@ -54,34 +54,28 @@ export const tooltipContainerStencil = createStencil({
tooltipTransformOriginVertical: '',
},
base: ({tooltipTransformOriginHorizontal, tooltipTransformOriginVertical}) => ({

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Toast and Tooltip should include explicit Windows High Contrast support after this restyle. Tooltip removed the previous transparent outline pattern called out in our accessibility guidance, and both components now rely on token borders/backgrounds plus shadows. In forced-colors mode, shadows disappear and authored colors may be overridden, so we should add @media (forced-colors: active) styles that preserve a visible boundary and readable foreground/background using system colors.

E.g.: CanvasText
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/system-color

paddingInline: `${system.padding.md} ${system.padding.xl}`,
gap: base.size150,
borderRadius: system.shape.xl,
border: `${px2rem(1)} solid ${system.color.border.default}`,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Refer to same comment about forced color fall-back on TooltipContainer.tsx

Comment thread modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx
Comment thread modules/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md
Comment thread modules/labs-react/kbd/stories/examples/InTooltip.tsx Outdated

@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/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md`:
- Around line 73-76: Fix both codemod instruction sections by placing the
opening ```sh fence on its own line, putting the complete npx command on the
following line, and closing with a standard ``` fence; update both the v16
command section and the ${canvasKitMajorVersionNumber} section.
🪄 Autofix (Beta)

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: 13cc83d5-10ce-4515-9a85-54dc60d57a63

📥 Commits

Reviewing files that changed from the base of the PR and between 7c051ec and c7b9df5.

📒 Files selected for processing (5)
  • modules/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md
  • modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx
  • modules/labs-react/kbd/stories/examples/InTooltip.tsx
  • modules/react/checkbox/lib/CheckboxContainer.tsx
  • modules/react/toast/lib/Toast.tsx
✅ Files skipped from review due to trivial changes (1)
  • modules/react/checkbox/lib/CheckboxContainer.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • modules/react/toast/lib/Toast.tsx
  • modules/labs-react/kbd/stories/examples/InTooltip.tsx

Comment on lines +73 to +76
The easiest way to run our codemod is to use `npx` in your terminal.```sh npx
@workday/canvas-kit-codemod v16 [path]

````

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Fix broken code fence formatting in codemod instructions.

The opening code fence ```sh is concatenated with the preceding text on the same line (e.g., ...in your terminal.```sh npx), which prevents markdown parsers from recognizing it as a fenced code block. The npx command text is also on the same line as the fence opening. This appears in both the first codemod instructions section (lines 73–76) and the second one (lines 450–453).

📝 Proposed fix for lines 73–76
-The easiest way to run our codemod is to use `npx` in your terminal.```sh npx
-@workday/canvas-kit-codemod v16 [path]
-
-````
+The easiest way to run our codemod is to use `npx` in your terminal.
+
+```sh
+npx `@workday/canvas-kit-codemod` v16 [path]
+```

Proposed fix for lines 450–453

-The easiest way to run our codemod is to use `npx` in your terminal.```sh npx
-@workday/canvas-kit-codemod v${canvasKitMajorVersionNumber} [path]
-
-````
+The easiest way to run our codemod is to use `npx` in your terminal.
+
+```sh
+npx `@workday/canvas-kit-codemod` v${canvasKitMajorVersionNumber} [path]
+```

Also applies to: 450-453

🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 76-76: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 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/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md` around lines 73 - 76,
Fix both codemod instruction sections by placing the opening ```sh fence on its
own line, putting the complete npx command on the following line, and closing
with a standard ``` fence; update both the v16 command section and the
${canvasKitMajorVersionNumber} section.

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

LGTM 👍🏻

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

Labels

needs-a11y Extra attention from accessibility is needed ready for review Code is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants