Skip to content

feat: SW-1825 stepper component#106

Merged
vmujakovic-ts merged 12 commits into
mainfrom
SW-1825-process-flow-component
Jun 4, 2026
Merged

feat: SW-1825 stepper component#106
vmujakovic-ts merged 12 commits into
mainfrom
SW-1825-process-flow-component

Conversation

@vmujakovic-ts

@vmujakovic-ts vmujakovic-ts commented May 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Type of Change

  • Feature (new functionality)
  • Bug fix
  • Refactor
  • Documentation
  • Chore (build, CI, dependencies)
  • Breaking change

Checklist

  • yarn lint passes
  • yarn build passes
  • yarn test:all passes
  • Storybook stories added/updated
  • Code coverage remains the same or increased

Testing

Verification

  • Deploys to preview environment for manual verification
  • All CI/E2E checks pass

Screenshots

@vercel

vercel Bot commented May 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ts-lib-ui-kit-storybook Ready Ready Preview, Comment Jun 3, 2026 7:59pm

Request Review

@vmujakovic-ts vmujakovic-ts changed the title intro component SW-1825 stepper component May 22, 2026
@vmujakovic-ts vmujakovic-ts marked this pull request as ready for review May 26, 2026 14:02
@vmujakovic-ts vmujakovic-ts requested review from a team as code owners May 26, 2026 14:02
@vmujakovic-ts vmujakovic-ts changed the title SW-1825 stepper component feat: SW-1825 stepper component May 26, 2026

@owilliams-tetrascience owilliams-tetrascience 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 only had one small comment but overall great work

}

const meta: Meta<typeof ProcessFlow> = {
title: "Patterns/ProcessFlow",

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.

Can you update this to "Design patterns". This was a recent change from UX

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.

Abslutely!

);
});

it("does not call onStepSelect for disabled steps", () => {

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.

I thinking generally most of these test should be covered in the storybook e2e tests? are any of these redundant?

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.

Yes they are, but one of the actions in this repo was complaining and fialing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

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 composed ProcessFlow component (stepper/workflow visualizer) to the UI kit, including responsive styling, Storybook coverage, unit tests, and public exports/docs so consuming apps can render parent-owned workflow progress (pending/active/completed/error/disabled).

Changes:

  • Introduces src/components/composed/ProcessFlow/* (component, utilities/types, Storybook stories, and tests).
  • Adds ProcessFlow-specific responsive CSS (container queries + CSS variables) to src/index.tailwind.css.
  • Exposes ProcessFlow from the package entrypoint and documents it in README.md (and adds it to DESIGN.md inventory).

Reviewed changes

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

Show a summary per file
File Description
src/index.ts Exports the new ProcessFlow composed component from the library entrypoint.
src/index.tailwind.css Adds ProcessFlow container-query-driven CSS variables and responsive behavior.
src/components/composed/ProcessFlow/ProcessFlow.utils.ts Defines ProcessFlow types/statuses and utility functions for layout/paths/accessibility labels.
src/components/composed/ProcessFlow/ProcessFlow.tsx Implements the ProcessFlow component (linear + branching layouts), styling hooks, and selection callback API.
src/components/composed/ProcessFlow/ProcessFlow.test.ts Unit tests for the utility helpers (status derivation, positioning, connections, SVG paths).
src/components/composed/ProcessFlow/ProcessFlow.component.test.tsx Component-level rendering/interaction tests in jsdom.
src/components/composed/ProcessFlow/ProcessFlow.stories.tsx Storybook stories + play tests demonstrating multiple layouts/sizes/states.
src/components/composed/ProcessFlow/index.ts Barrel export for the composed ProcessFlow module.
README.md Adds ProcessFlow documentation and improves some formatting/quoting consistency.
DESIGN.md Adds ProcessFlow to the component inventory and re-formats the table.

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

Comment on lines +121 to +129
export function getStepAccessibleLabel(step: ProcessFlowStep, status: ProcessFlowStepStatus, stepNumber: number) {
if (step.ariaLabel) {
return step.ariaLabel;
}

const label = typeof step.label === "string" ? step.label : `Step ${stepNumber}`;

return `${label}, ${STATUS_LABELS[status]}`;
}
Comment on lines +40 to +46
export interface ProcessFlowStepSelectDetails {
/** Zero-based index of the selected step in the steps prop. */
stepIndex: number;
/** Current visual status of the selected step. */
status: ProcessFlowStepStatus;
nativeEvent: MouseEvent<HTMLButtonElement>;
}
Comment on lines +379 to +385
onClick={(nativeEvent) =>
onStepSelect(step, {
nativeEvent,
status,
stepIndex,
})
}
Comment on lines +609 to +613
const positionedSteps = steps.map((step, index) => positionStep(step, index, orientation));
const rowCount = Math.max(...positionedSteps.map((step) => step.row + 1), 1);
const columnCount = Math.max(...positionedSteps.map((step) => step.column + 1), 1);
const resolvedConnections = resolveConnections(positionedSteps, connections);
const descriptionVisibility = getDescriptionVisibility(showDescriptions);
Comment on lines +358 to +364
export const UploadWorkflow: Story = {
args: {
steps: uploadSteps,
selectedStepId: "validate-inputs",
onStepSelect: fn(),
},
render: (args) => <EditableUploadWorkflow {...args} />,
Comment on lines +10 to +27
// Suppress "not configured to support act(...)" warnings in jsdom
(globalThis as Record<string, unknown>).IS_REACT_ACT_ENVIRONMENT = true;

let container: HTMLDivElement;
let root: ReturnType<typeof createRoot>;

beforeEach(() => {
container = document.createElement("div");
document.body.appendChild(container);
root = createRoot(container);
});

afterEach(() => {
act(() => {
root.unmount();
});
container.remove();
});
disabled: "Disabled",
};

export function getDescriptionVisibility(showDescriptions?: boolean): ProcessFlowDescriptionVisibility {

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.

q(non-blocking): is there an intended use for 'auto' in ProcessFlowDescriptionVisibility here?

@54321jenn-ts 54321jenn-ts 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.

Same comments as before, can you update your left nav in story book to "Process Flow" with a space? Also, it'd be nice to use the toolkit button group in the docs. Neither are blockers. Nice work!

@blee-tetrascience blee-tetrascience 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.

Approving with the assumption you will add the empty snippet to your stories:

 parameters: {
    zephyr: { testCaseId: "" },
  },

and then attach the zephyr_sync github label which will generate and sync the test case IDs for your components here into zephyr so we can track successful test executions

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 93.87% (🎯 83%)
⬆️ +0.20%
19923 / 21224
🟢 Statements 93.87% (🎯 83%)
⬆️ +0.20%
19923 / 21224
🟢 Functions 93.02% (🎯 74%)
⬆️ +0.18%
893 / 960
🟢 Branches 87.36% (🎯 81%)
⬆️ +0.52%
3486 / 3990
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/composed/ProcessFlow/ProcessFlow.tsx 100% 100% 100% 100%
src/components/composed/ProcessFlow/ProcessFlow.utils.ts 100% 100% 100% 100%
Generated in workflow #722 for commit d0de9c5 by the Vitest Coverage Report Action

@vmujakovic-ts vmujakovic-ts merged commit b8543e9 into main Jun 4, 2026
7 checks passed
@vmujakovic-ts vmujakovic-ts deleted the SW-1825-process-flow-component branch June 4, 2026 15:29
@blee-tetrascience

Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 0.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants