Skip to content

feat: Update Segmented Control and Action per Sana Canvas updates#4048

Open
mannycarrera4 wants to merge 25 commits into
Workday:prerelease/majorfrom
mannycarrera4:mc-segmented-control-sana
Open

feat: Update Segmented Control and Action per Sana Canvas updates#4048
mannycarrera4 wants to merge 25 commits into
Workday:prerelease/majorfrom
mannycarrera4:mc-segmented-control-sana

Conversation

@mannycarrera4

@mannycarrera4 mannycarrera4 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes: #3977

Release Category

Components

Release Note

Segmented Control

  • Container background changed from surface.alt.strong to surface.alt.default (a lighter background color).
  • Border radius changed to shape.full (full rounded corners) on the container.
  • Grid gap reduced from gap.sm (8px) to gap.xs (4px).
  • Selected/pressed item now uses boxShadow: system.depth[2] instead of a visible border.
  • Font weight changed from bold to medium (base and small sizes);
  • Medium size now uses semi bold font weight.
  • Size adjustments: large height shrunk to size.sm (32px) (was size.md (40px));
  • Medium size is now 28px in height (was 32px).

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 to add Action Bar and Segmented Control sections with detailed visual notes.
    • Improved Segmented Control screen reader guidance for icon-only items by clarifying accessible name requirements.
    • Registered the updated v16 upgrade guide in the documentation set.
  • Style
    • Refreshed Action Bar fixed positioning and padding behavior.
    • Updated Segmented Control visuals, including spacing, sizing, typography, selected/pressed styling, overlay surfaces, focus-visible styling, and icon-with-text and icon-only layouts.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@mannycarrera4, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 24 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 40f251ff-22ae-4077-a56a-a385055829af

📥 Commits

Reviewing files that changed from the base of the PR and between 16983b7 and 83cfc8b.

📒 Files selected for processing (2)
  • modules/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md
  • modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx
📝 Walkthrough

Walkthrough

This PR updates Action Bar and Segmented Control styling tokens, wires Segmented Control sizing through its list stencil, documents v16 visual changes, and registers the markdown upgrade guide in MCP configuration.

Changes

Component styling and documentation

Layer / File(s) Summary
Action Bar padding token update
modules/react/action-bar/lib/ActionBarList.tsx
Replaces the fixed-bar padding composition with system.legacy.padding.md.
Segmented Control item styling and accessibility guidance
modules/react/segmented-control/lib/SegmentedControlItem.tsx, modules/react/segmented-control/stories/SegmentedControl.mdx
Updates visual tokens, pressed and focus states, size variants, icon spacing, and icon-only accessible-name guidance.
Segmented Control list styling
modules/react/segmented-control/lib/SegmentedControlList.tsx
Updates container and size spacing tokens and passes the model size into the stencil.
Upgrade guide and MCP configuration
modules/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md, modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx, modules/mcp/lib/config.json
Adds Action Bar and Segmented Control entries and visual-update details to both guides, and registers the markdown guide file.

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

Possibly related PRs

Suggested labels: needs-a11y

Suggested reviewers: williamjstanton, josh-bagwell, rayredgoose

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning [#3977] Segmented Control updates align, but the Action Bar changes shown do not include the required depth or small-screen single-button behavior update. Add the Action Bar depth token updates and the small-screen single-button width behavior change, then verify Storybook and visual regression coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main scope: Segmented Control and Action Bar updates for Sana Canvas.
Out of Scope Changes check ✅ Passed The changes are focused on the requested upgrade guide, component styling, Storybook, and config updates.
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.

@cypress

cypress Bot commented Jul 8, 2026

Copy link
Copy Markdown

Workday/canvas-kit    Run #11251

Run Properties:  status check passed Passed #11251  •  git commit 58e6295a3b ℹ️: Merge 83cfc8bddf1d8326bf5e0175d6d1a37bf462b027 into bad40564ba682746a1cb34087431...
Project Workday/canvas-kit
Branch Review mc-segmented-control-sana
Run status status check passed Passed #11251
Run duration 02m 20s
Commit git commit 58e6295a3b ℹ️: Merge 83cfc8bddf1d8326bf5e0175d6d1a37bf462b027 into bad40564ba682746a1cb34087431...
Committer Manuel Carrera
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.5%
  Untested elements 1542  
  Tested elements 371  
Accessibility  99.37%
  Failed rules  5 critical   5 serious   0 moderate   2 minor
  Failed elements 72  

@mannycarrera4 mannycarrera4 marked this pull request as ready for review July 9, 2026 19:42
@mannycarrera4 mannycarrera4 requested a review from a team as a code owner July 9, 2026 19:42
@mannycarrera4 mannycarrera4 added the ready for review Code is ready for review label Jul 9, 2026

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

🧹 Nitpick comments (4)
modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx (1)

30-30: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use spaces instead of tab for TOC indentation.

Line 30 uses a tab character while all other TOC entries use spaces.

📝 Proposed fix
-	- [Segmented Control](`#segmented-control`)
+  - [Segmented Control](`#segmented-control`)
🤖 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/mdx/16.0-UPGRADE-GUIDE.mdx` at line 30, The TOC entry for
Segmented Control uses a tab for indentation while the rest of the markdown
table of contents uses spaces. Update the markdown list item in the TOC to use
the same space-based indentation style as the other entries so formatting stays
consistent across the 16.0-UPGRADE-GUIDE.mdx document.
modules/react/segmented-control/lib/SegmentedControlItem.tsx (2)

105-105: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove commented-out dead code.

The commented-out border token line is dead code. Since the pressed state now uses boxShadow instead of a border (as documented in the upgrade guide), this line should be removed for clarity.

♻️ Proposed fix
     "&[aria-pressed='true']": {
       [buttonStencil.vars.background]: system.legacy.color.surface.default,
-      // [buttonStencil.vars.border]: system.color.border.inverse.default,
       [systemIconStencil.vars.color]: system.color.fg.strong,
🤖 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/segmented-control/lib/SegmentedControlItem.tsx` at line 105,
Remove the commented-out border token from SegmentedControlItem so the
pressed-state styling no longer contains dead code. Update the
SegmentedControlItem component by deleting the obsolete commented line near the
boxShadow-based pressed state styling, keeping the current press visual behavior
aligned with the upgrade guide and preserving only the active styling logic.

110-113: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Redundant hover block inside pressed state.

The &:hover, &.hover block at lines 110-113 sets [systemIconStencil.vars.color] and [buttonStencil.vars.label] to system.color.fg.strong, but the parent &[aria-pressed='true'] block already sets these exact values at lines 106-107. This block has no effect and can be removed.

♻️ Proposed fix
       boxShadow: system.depth[2],
 
-      '&:hover, &.hover': {
-        [systemIconStencil.vars.color]: system.color.fg.strong,
-        [buttonStencil.vars.label]: system.color.fg.strong,
-      },
-
       '&:focus-visible, &.focus': {
🤖 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/segmented-control/lib/SegmentedControlItem.tsx` around lines
110 - 113, The hover block inside the pressed-state styles in
SegmentedControlItem is redundant because `&[aria-pressed='true']` already
applies the same `systemIconStencil.vars.color` and `buttonStencil.vars.label`
values. Remove the `&:hover, &.hover` override from the styled item so the
`SegmentedControlItem` styling stays simpler and avoids duplicate rules.
modules/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md (1)

26-26: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use spaces instead of tab for TOC indentation.

Line 26 uses a tab character for indentation while all other TOC entries use spaces. This inconsistency can cause rendering issues in some Markdown parsers.

📝 Proposed fix
-	- [Segmented Control](`#segmented-control`)
+  - [Segmented Control](`#segmented-control`)
🤖 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` at line 26, The TOC
entry for Segmented Control uses a tab instead of spaces, which makes the
indentation inconsistent with the other entries. Update the markdown in the
upgrade guide TOC so the Segmented Control anchor line matches the same
space-based indentation style used by the rest of the table of contents, keeping
the entry under the existing TOC block.
🤖 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 249-265: The Segmented Control upgrade guide has a duplicated
“Visual Updates” heading and a hyphenation issue in the size/weight bullets. In
the markdown section for the upgrade guide, keep only one `#### Visual Updates`
heading and change the “semi bold” wording to “semi-bold” so the content passes
markdownlint and LanguageTool. Use the existing Segmented Control subsection to
locate and clean up the repeated heading and bullet text.

In `@modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx`:
- Around line 255-271: The Segmented Control upgrade notes in the MDX guide have
a duplicated “Visual Updates” heading and a hyphenation issue in the font-weight
note. In the documentation content for the Segmented Control section, remove the
extra repeated “#### Visual Updates” heading and update the “semi bold” text to
“semi-bold” so the section reads cleanly.

---

Nitpick comments:
In `@modules/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md`:
- Line 26: The TOC entry for Segmented Control uses a tab instead of spaces,
which makes the indentation inconsistent with the other entries. Update the
markdown in the upgrade guide TOC so the Segmented Control anchor line matches
the same space-based indentation style used by the rest of the table of
contents, keeping the entry under the existing TOC block.

In `@modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx`:
- Line 30: The TOC entry for Segmented Control uses a tab for indentation while
the rest of the markdown table of contents uses spaces. Update the markdown list
item in the TOC to use the same space-based indentation style as the other
entries so formatting stays consistent across the 16.0-UPGRADE-GUIDE.mdx
document.

In `@modules/react/segmented-control/lib/SegmentedControlItem.tsx`:
- Line 105: Remove the commented-out border token from SegmentedControlItem so
the pressed-state styling no longer contains dead code. Update the
SegmentedControlItem component by deleting the obsolete commented line near the
boxShadow-based pressed state styling, keeping the current press visual behavior
aligned with the upgrade guide and preserving only the active styling logic.
- Around line 110-113: The hover block inside the pressed-state styles in
SegmentedControlItem is redundant because `&[aria-pressed='true']` already
applies the same `systemIconStencil.vars.color` and `buttonStencil.vars.label`
values. Remove the `&:hover, &.hover` override from the styled item so the
`SegmentedControlItem` styling stays simpler and avoids duplicate rules.
🪄 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: 765fb73b-4a4e-41c1-9145-0bacd3007954

📥 Commits

Reviewing files that changed from the base of the PR and between 3f302de and a8d6678.

📒 Files selected for processing (6)
  • modules/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md
  • modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx
  • modules/mcp/lib/config.json
  • modules/react/action-bar/lib/ActionBarList.tsx
  • modules/react/segmented-control/lib/SegmentedControlItem.tsx
  • modules/react/segmented-control/lib/SegmentedControlList.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/docs/llm/upgrade-guides/16.0-UPGRADE-GUIDE.md
Comment thread modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx Outdated
Comment thread modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx Outdated
"upgrade-guides/13.0-UPGRADE-GUIDE.md",
"upgrade-guides/14.0-UPGRADE-GUIDE.md",
"upgrade-guides/15.0-UPGRADE-GUIDE.md",
"upgrade-guides/16.0-UPGRADE-GUIDE.md",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

adding this to the MCP

@mannycarrera4 mannycarrera4 changed the title feat: Update Segmented Control and Action per Sana Styles feat: Update Segmented Control and Action per Sana Canvas updates Jul 9, 2026

@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! Just adding this feedback to a file that wasn't in the diff:

SegmentedControl.mdx lines 71-74
Medium: The docs say icon-only tooltip text is “announced along with” the button role/state, but the implementation actually uses the tooltip title as the button’s accessible name by default. That difference matters for consumers copying examples.

Recommendation:
I’d reword this to say icon-only items must have an accessible name, supplied by visible text, aria-label, or a Tooltip in label mode.

Comment thread modules/docs/mdx/16.0-UPGRADE-GUIDE.mdx Outdated
- [Color Input](#color-input)
- [Color Picker](#color-picker)
- [Form Field](#form-field)
- [Segmented Control](#segmented-control)

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.

Low: The upgrade guide’s table of contents nests Text Area and Text Input under Segmented Control, is there an indentation mistake here?

Actually shouldn't this go underneath button? (Sibling to Delete?)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fixed

- [Color Input](#color-input)
- [Color Picker](#color-picker)
- [Form Field](#form-field)
- [Segmented Control](#segmented-control)

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.

See same comment in mdx upgrade guide.

position: 'fixed',
insetBlockEnd: 0,
insetInline: 0,
'@media (max-width: 767.5px)': {

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.

Do we want to call out this padding change on mobile widths in the upgrade guide?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ah yeah good call ty

modifiers: {size: 'small', variant: 'iconWithText'},
styles: {
paddingInline: `${system.legacy.padding.xs} ${system.legacy.padding.sm}`,
paddingInline: `${base.size75} ${system.legacy.padding.xs}`,

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.

Do we want to use base.legacy.size75 here instead so we have a fallback value?

height: system.legacy.size.sm,
height: base.legacy.size350,
fontWeight: system.sana.fontWeight.semibold,
[systemIconStencil.vars.size]: 14,

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.

I'm guessing we couldn't make this work with one of our standard icon sizes so we have to hardcode the 14?

@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 a couple minor comments.

@mannycarrera4 mannycarrera4 added approved Code has been reviewed and approved (ship it) and removed ready for review Code is ready for review labels Jul 14, 2026
Comment on lines +22 to +27
- [Color Input](#color-input)
- [Color Picker](#color-picker)
- [Form Field](#form-field)
- [Segmented Control](#segmented-control)
- [Text Area](#text-area)
- [Text Input](#text-input)

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.

all input components should be under inputs sections and there is should be accessibility note about bg color change. I see it in line 28th here, so seems like problem with merge conflict

Comment on lines 57 to 59
fontSize: system.legacy.fontSize.subtext.lg,
lineHeight: system.legacy.lineHeight.subtext.lg,
letterSpacing: system.legacy.letterSpacing.subtext.lg,

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.

you can replace that by ...system.legacy.type.subtext.lg as it's got fixed

mixinColor: system.legacy.color.surface.overlay.mixin,
mixinValue: system.legacy.opacity.surface.hover,
}),
[buttonStencil.vars.background]: system.color.surface.overlay.hover.default,

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.

system.legacy.color.surface.overlay.hover.default

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

why is this legacy? didn't we have this in previous versions?

mixinColor: system.legacy.color.surface.overlay.mixin,
mixinValue: system.legacy.opacity.surface.pressed,
}),
[buttonStencil.vars.background]: system.color.surface.overlay.pressed.default,

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.

legacy here too

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

some tokens needs to be from system.legacy.* object to provide fallback

},

'&:focus-visible, &.focus': {
boxShadow: `0 0 0 ${px2rem(2)} ${system.color.border.inverse.default},0 0 0 ${px2rem(4)} ${system.color.brand.border.primary}`,

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.

should be legacy tokens here

@RayRedGoose RayRedGoose added ready for review Code is ready for review and removed approved Code has been reviewed and approved (ship it) labels Jul 14, 2026
@RayRedGoose

Copy link
Copy Markdown
Contributor

approved label can be added if PR approved by William and one eng from the canvas team

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

Labels

ready for review Code is ready for review

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants