Skip to content

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

Open
mannycarrera4 wants to merge 19 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 19 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

  • New Features

    • Added upgrade guide entries for the Action Bar and Segmented Control components.
    • Included updated visual notes for the latest Segmented Control and Action Bar appearance changes.
  • Style

    • Refined Segmented Control spacing, sizing, typography, and selected-state styling.
    • Updated Action Bar padding for improved layout consistency.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates styling tokens for the ActionBarList and SegmentedControl (List and Item) components, switching padding, border-radius, background, gap, and typography values to new system/base legacy tokens. It also updates v16 upgrade guide documentation (markdown and MDX) and the MCP config to reference the new guide file.

Changes

Component styling and docs

Layer / File(s) Summary
Action Bar padding token update
modules/react/action-bar/lib/ActionBarList.tsx
Import switches to only system token, and fixed-bar padding removes base.legacy.size500 in favor of system.legacy.padding.md.
Segmented Control item styling
modules/react/segmented-control/lib/SegmentedControlItem.tsx
Adds px2rem/base imports; updates base font weight, border radius, hover tokens; reworks pressed-state boxShadow/focus styling; updates size modifiers (large/medium/small) and iconWithText compound padding across sizes.
Segmented Control list styling
modules/react/segmented-control/lib/SegmentedControlList.tsx
Adds base import; updates base background/border-radius/padding/gridGap tokens; revises size-modifier spacing; wires model.state.size into the stencil call.
Upgrade guide and config documentation
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 TOC entries and "Visual Updates" sections with PR references in both guide formats; adds the new guide file to the MCP upgradeGuideFiles list.

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

Possibly related PRs

  • Workday/canvas-kit#3999: Related through initial creation of the same v16 upgrade guide MDX file that this PR further updates.

Suggested reviewers: RayRedGoose

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Segmented Control appears token-only, but the required Action Bar small-screen behavior and Storybook updates are not shown in the changes. Add the Action Bar single-button small-screen width change and the Storybook updates, then confirm the acceptance criteria are met.
✅ Passed checks (4 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed The docs and config updates are ancillary to the component changes and do not look unrelated to the PR objectives.
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 reflects the main Segmented Control and Action Bar style updates for Sana Canvas.
✨ 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 #11230

Run Properties:  status check passed Passed #11230  •  git commit a959bbb36d ℹ️: Merge 1e42f4240de89b00b4cb87fefa08469eb261f847 into 3f302de58e8b2f669ada3ee97831...
Project Workday/canvas-kit
Branch Review mc-segmented-control-sana
Run status status check passed Passed #11230
Run duration 02m 32s
Commit git commit a959bbb36d ℹ️: Merge 1e42f4240de89b00b4cb87fefa08469eb261f847 into 3f302de58e8b2f669ada3ee97831...
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.53%
  Untested elements 1539  
  Tested elements 371  
Accessibility  99.41%
  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
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.

1 participant