Skip to content

feat: add annotation to steps - #4687

Merged
amanabiy merged 17 commits into
mainfrom
dev-v3-amanabiy-steps-timeline
Jul 27, 2026
Merged

feat: add annotation to steps#4687
amanabiy merged 17 commits into
mainfrom
dev-v3-amanabiy-steps-timeline

Conversation

@amanabiy

@amanabiy amanabiy commented Jul 2, 2026

Copy link
Copy Markdown
Member

Description

Adds an optional annotation slot to the Steps component. It can be used to display supplementary information, such as timestamps, before each step’s status indicator.

Annotations are supported in vertical, horizontal, and custom rendered steps. The layout keeps annotations, status indicators, headers, and details aligned when content wraps. Vertical steps use a single connector that grows with wrapped annotations or details while preserving existing spacing for shorter content.

This change also adds test utility support and a dedicated permutations page covering different annotation layouts.

Related links, issue #, if available: Chorus [AzznTbsZXUA1]

How has this been tested?

  • Unit tests are added and they have been run
  • Screenshot tests

Image:
image

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.62%. Comparing base (51998d0) to head (4516939).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4687   +/-   ##
=======================================
  Coverage   97.62%   97.62%           
=======================================
  Files         956      956           
  Lines       31004    31012    +8     
  Branches    11409    11410    +1     
=======================================
+ Hits        30269    30277    +8     
+ Misses        728      688   -40     
- Partials        7       47   +40     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amanabiy
amanabiy force-pushed the dev-v3-amanabiy-steps-timeline branch from f0eb56b to a1b16c4 Compare July 6, 2026 19:18
@amanabiy
amanabiy force-pushed the dev-v3-amanabiy-steps-timeline branch from a1b16c4 to d193f3f Compare July 6, 2026 22:57
@amanabiy
amanabiy force-pushed the dev-v3-amanabiy-steps-timeline branch from d193f3f to 12ac93e Compare July 7, 2026 08:07
@amanabiy amanabiy changed the title feat: add headerStart to steps to allow building a timeline feat: add annotation to steps to allow building a timeline Jul 15, 2026
@amanabiy
amanabiy force-pushed the dev-v3-amanabiy-steps-timeline branch from add2bde to 67a4f61 Compare July 15, 2026 09:52
@amanabiy
amanabiy force-pushed the dev-v3-amanabiy-steps-timeline branch from 67a4f61 to 3a63d03 Compare July 20, 2026 15:54
import createPermutations from '../utils/permutations';
import PermutationsView from '../utils/permutations-view';
import * as variants from './permutations-utils';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would create a separate permutations page for steps with annotations, where you can feature different layouts, custom steps, etc. Otherwise, the existing permutation pages grow too large.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I agree. Addressed.

pan-kot
pan-kot previously approved these changes Jul 24, 2026
jperals
jperals previously approved these changes Jul 24, 2026
Comment thread src/steps/internal.tsx
if (orientation === 'horizontal') {
return (
<li className={styles.container}>
<div className={styles.header}>

@amanabiy amanabiy Jul 27, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This element does not contain the header, so using the header class here is incorrect. It contains the icon and connector. This is unexpected behavior, which means our test util findHeader is not also being able to find it. The refactor helps to make sure findHeader finds the header.

Comment thread src/steps/internal.tsx
{iconNode}
<hr className={connectorClassName} role="none" />
</div>
<div className={styles['horizontal-header']}>{header}</div>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

A separate horizontal-header class is not necessary anymore because this element is the actual header and can use the existing header class.

Comment thread src/steps/internal.tsx
const connectorClassName = clsx(styles.connector, hideConnectors && styles['connector-hidden']);
return (
<li className={styles.container}>
<div className={styles.header}>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This wrapper was named header even though it does not consistently contain only the header. Renaming it to step-layout reserves header for the actual header content used by findHeader().

Comment thread pages/steps/permutations-annotation.page.tsx Outdated
Comment thread src/steps/internal.tsx
return (
<li className={styles.container}>
<div className={styles.header}>
<StepAnnotation>{annotation}</StepAnnotation>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we include the annotation in renderSteps for feature parity with the header, icon and description?

@amanabiy amanabiy Jul 27, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In the API proposal, we agreed not to include annotation in renderStep because builders can already customize it as a ReactNode. If a use case emerges, we can always add it later, but I’d prefer not to block this PR on it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants