Skip to content

feat(OneDataCollection): let secondary actions show a counter - #5249

Merged
sauldom102 merged 2 commits into
mainfrom
feat/odc-secondary-action-counter
Sep 1, 2026
Merged

feat(OneDataCollection): let secondary actions show a counter#5249
sauldom102 merged 2 commits into
mainfrom
feat/odc-secondary-action-counter

Conversation

@AngelMsaa

@AngelMsaa AngelMsaa commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What

Lets a OneDataCollection secondary action carry a counter, rendered on its button.

secondaryActions={{
  expanded: 1,
  actions: () => [
    { label: 'To review', counterValue: 3, onClick: openPanel },
  ],
}}

Changes

  • SecondaryActionItem gains an optional counterValue?: number.
  • CollectionActions forwards it to the action's F0Button.
  • Ignored while the action is collapsed into the overflow (⋮) menu — menu items have no counter slot.

Tests

  • CollectionActions.test.tsx — asserts counterValue reaches the rendered button.

Note

Additive; existing callers unaffected. How that counter looks is the paired F0Button PR #5225.

A secondary action that concerns a set of items — "3 to review", "5 to
approve" — could name the count only in its label, which reads as a sentence
rather than a button. F0Button already renders a counter to the right of its
label; this threads `counterValue` through the collection's secondary-action
descriptor to it, so the count sits in a pill beside the label. Collapsed into
the overflow menu the value is ignored, as menu items have no counter slot.
@github-actions github-actions Bot added feat react Changes affect packages/react labels Aug 26, 2026
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🔍 Review policy: Feature

The PR title starts with feat, so this is a feature: it needs one approval from f0-devs AND one from f0-designers (rule 3).

Required approvals

Team Why Status
@factorialco/f0-devs Features need a dev approval ✅ approved by @sauldom102
@factorialco/f0-designers Features need a design approval ⏳ pending
How this was decided
  • PRs touching only sds/ modules require their owners and nothing else.
  • Otherwise, docs-only changes (*.md, *.mdx, *.stories.tsx, anything in __stories__/) → one f0-general approval.
  • Otherwise, feat: titles → one f0-devs and one f0-designers approval. Not a feature? Fix the title prefix.
  • Anything else → one f0-devs approval.
  • Add the needs-design-review label to also request a design approval on any PR.
  • Creating a new sds/ module (new package.yml) additionally requires an f0-general approval.

Policy source: ownership/review-policy.ts · Team members: ownership/teams.yml

@github-actions

Copy link
Copy Markdown
Contributor

✅ No New Circular Dependencies

No new circular dependencies detected. Current count: 0

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🔍 Visual review for your branch is published 🔍

Here are the links to:

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

📦 Alpha Package Version Published

Use pnpm i github:factorialco/f0#npm/alpha-pr-5249 to install the package

Use pnpm i github:factorialco/f0#68fb3b909337b139313fb6d10cb7493f3b386e47 to install this specific commit

@AngelMsaa AngelMsaa changed the title feat(OneDataCollection): support a counter on secondary actions feat(OneDataCollection): let secondary actions show a counter Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ No breaking public API changes

No public exports were removed, renamed, or had existing props/types changed in a breaking way compared to main.

Comparing f0, experimental and ai against main. Adding components, types, or optional props is safe. This check is non-blocking.

⚠️ Could not analyze component-status (no-base) — a build may have failed; results may be incomplete.

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

♿ Accessibility (axe) — components changed in this PR

6 issues across 3 stories — all non-blocking (todo).

Story Rule WCAG Impact Nodes Mode
Patterns/Data Collection/Empty State / Error Example nested-interactive WCAG 4.1.2 A (2.0) serious 1 🟡 todo
Patterns/Data Collection/Empty State / Error Example target-size WCAG 2.5.8 AA (2.2) serious 1 🟡 todo
Patterns/Data Collection/Empty State / Custom Messages And Actions nested-interactive WCAG 4.1.2 A (2.0) serious 1 🟡 todo
Patterns/Data Collection/Empty State / Custom Messages And Actions target-size WCAG 2.5.8 AA (2.2) serious 1 🟡 todo
Patterns/Data Collection/Empty State / Empty To Data Example nested-interactive WCAG 4.1.2 A (2.0) serious 1 🟡 todo
Patterns/Data Collection/Empty State / Empty To Data Example target-size WCAG 2.5.8 AA (2.2) serious 1 🟡 todo

Scope: only stories in the files/component folders this PR changed. It can't yet flag downstream ripple from shared-code/token changes, or diff against main (planned: base-vs-head delta).

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/react

Status Category Percentage Covered / Total
🔵 Lines 69.78% 30318 / 43443
🔵 Statements 68.73% 32144 / 46768
🔵 Functions 62.61% 7251 / 11581
🔵 Branches 62.57% 22804 / 36442
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/react/src/patterns/OneDataCollection/actions.tsx 46.66% 9.09% 36.36% 48.27% 35-38, 79, 85, 91-105, 132-137, 149-152
packages/react/src/patterns/OneDataCollection/components/CollectionActions/CollectionActions.tsx 75% 87.5% 66.66% 75% 42-48, 83, 122
Generated in workflow #17716 for commit 1ac843c by the Vitest Coverage Report Action

@github-actions

Copy link
Copy Markdown
Contributor

✅ No untranslated copy added

Every user-visible string in this PR comes from the i18n layer. Codebase total unchanged at 133.

@github-actions

github-actions Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

✅ Storybook docs — no pages lost

Every page reachable on main is still reachable here.

Links point at this PR's Storybook build — browse the full Storybook.

Snapshot of the Storybook index (docs pages + stories) compared against main. Non-blocking.

@AngelMsaa
AngelMsaa marked this pull request as ready for review August 31, 2026 15:30
@AngelMsaa
AngelMsaa requested a review from a team as a code owner August 31, 2026 15:30
@sauldom102
sauldom102 merged commit d7c8230 into main Sep 1, 2026
56 of 57 checks passed
@sauldom102
sauldom102 deleted the feat/odc-secondary-action-counter branch September 1, 2026 10:10
@eliseo-juan eliseo-juan mentioned this pull request Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat react Changes affect packages/react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants