Skip to content

feat: Vertical divider variant - #4081

Open
jaclynjessup wants to merge 1 commit into
Workday:masterfrom
jaclynjessup:ISSUE-4063
Open

feat: Vertical divider variant#4081
jaclynjessup wants to merge 1 commit into
Workday:masterfrom
jaclynjessup:ISSUE-4063

Conversation

@jaclynjessup

@jaclynjessup jaclynjessup commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

Resolves: #4063

New Vertical Variant for Divider

Release Category

Components

Release Note

New Vertical Variant for Divider


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

Thank You Gif (optional)

thanks claudette

Summary by CodeRabbit

  • New Features

    • Added support for vertical dividers alongside the existing horizontal orientation.
    • Added configurable divider orientation and accessibility information.
    • Added an example demonstrating vertical dividers between inline statistics.
  • Documentation

    • Updated spacing guidance and added vertical divider usage examples.

@jaclynjessup
jaclynjessup requested a review from a team as a code owner July 22, 2026 21:57
@jaclynjessup jaclynjessup added enhancement New feature or request ai author This pull request is primarily or entirely written by an agent, not a human. Review carefully. labels Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Divider component now supports horizontal and vertical orientations, including orientation-specific styling, spacing, documentation, and ARIA output. A vertical stats example demonstrates separators between adjacent items.

Changes

Divider orientation support

Layer / File(s) Summary
Orientation-aware Divider
modules/preview-react/divider/lib/Divider.tsx
Adds horizontal and vertical stencil variants, an orientation prop defaulting to horizontal, orientation-aware spacing, vertical usage documentation, and aria-orientation output.
Vertical usage example
modules/preview-react/divider/stories/examples/Vertical.tsx
Adds token-based stat styling and renders vertical Dividers between mapped stat items, excluding the final item.

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

Sequence Diagram(s)

sequenceDiagram
  participant Divider
  participant dividerStencil
  participant RenderedHR
  Divider->>dividerStencil: pass space and orientation
  dividerStencil->>RenderedHR: apply orientation-specific styles
  Divider->>RenderedHR: set aria-orientation
Loading

Suggested labels: ready for review

Suggested reviewers: mannycarrera4, rayredgoose

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes add a vertical Divider orientation, update props/docs, and include a vertical usage example, matching issue #4063.
Out of Scope Changes check ✅ Passed The added story/example is directly related to the new vertical Divider variant and nothing else appears unrelated.
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 addition of the vertical Divider variant.
✨ 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 22, 2026

Copy link
Copy Markdown

Workday/canvas-kit    Run #11310

Run Properties:  status check passed Passed #11310  •  git commit 41b78bc37a ℹ️: Merge ba55fe1c4510752ab989e35f0b18f304e4adc0c8 into 02dd284d77ccf92991d5526190f4...
Project Workday/canvas-kit
Branch Review ISSUE-4063
Run status status check passed Passed #11310
Run duration 02m 24s
Commit git commit 41b78bc37a ℹ️: Merge ba55fe1c4510752ab989e35f0b18f304e4adc0c8 into 02dd284d77ccf92991d5526190f4...
Committer Jaclyn
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.51%
  Untested elements 1537  
  Tested elements 370  
Accessibility  99.47%
  Failed rules  5 critical   5 serious   0 moderate   2 minor
  Failed elements 72  

@jaclynjessup jaclynjessup changed the title feat: vertical divider variant feat: Vertical divider variant Jul 23, 2026
@RayRedGoose
RayRedGoose requested a review from Copilot July 29, 2026 16:27

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 vertical orientation variant to the Preview Divider component so it can be used as either a horizontal rule (default) or a vertical separator in row-based layouts.

Changes:

  • Introduces orientation?: 'horizontal' | 'vertical' on Divider and updates the stencil to render horizontal vs. vertical styles.
  • Sets aria-orientation based on the orientation prop for improved accessibility semantics.
  • Adds a new Vertical example showcasing usage of vertical dividers between inline stats.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
modules/preview-react/divider/stories/examples/Vertical.tsx Adds a new example for vertical dividers in a horizontal row layout.
modules/preview-react/divider/lib/Divider.tsx Adds orientation support in the stencil + component, and wires ARIA orientation.
Comments suppressed due to low confidence (1)

modules/preview-react/divider/stories/examples/Vertical.tsx:34

  • The array returned by stats.map(...) uses an unkeyed fragment (<>...</>), which will trigger React’s “missing key” warning. Use a keyed Fragment (or another keyed wrapper) for each iteration.
      {stats.map((stat, index) => (
        <>

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

Comment on lines +29 to +31
export const Vertical = () => {
const lastIndex = stats.length - 1;
return (
Comment on lines +1 to +3
import {Divider} from '@workday/canvas-kit-preview-react/divider';
import {createStyles} from '@workday/canvas-kit-styling';
import {system} from '@workday/canvas-tokens-web';
Comment on lines +93 to 99
Component: ({space, orientation = 'horizontal', ...elemProps}: DividerProps, ref, Element) => (
<Element
ref={ref}
aria-orientation={orientation}
{...handleCsProp(elemProps, dividerStencil({space, orientation}))}
/>
),
Comment on lines +59 to +67
/**
* Sets the orientation of the `Divider`.
* * `horizontal` - renders a horizontal rule to segment stacked content.
* * `vertical` - renders a vertical rule to segment content laid out in a row. The `Divider` stretches to fill
* the height of its container, so it should be placed inside an element with a defined height (e.g. a flex or
* grid container).
* @default 'horizontal'
*/
orientation?: 'horizontal' | 'vertical';
@mannycarrera4
mannycarrera4 changed the base branch from prerelease/major to master August 3, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai author This pull request is primarily or entirely written by an agent, not a human. Review carefully. enhancement New feature or request v16-Fast-Follow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add vertical variant for Divider component

3 participants