Skip to content

feat: allow string values for table of contents count prop#1280

Merged
Rotshrek merged 1 commit into
mainfrom
feat/allow-strings-on-toc-count
May 7, 2026
Merged

feat: allow string values for table of contents count prop#1280
Rotshrek merged 1 commit into
mainfrom
feat/allow-strings-on-toc-count

Conversation

@Rotshrek
Copy link
Copy Markdown
Contributor

@Rotshrek Rotshrek commented May 6, 2026

Azure DevOps links

User story

Description

  • Expanded count/value typing to accept both numbers and strings across related UI types.
  • Updated Badge.tsx so Badge value supports number | string.
  • Updated Tabs.types.ts so Tab count supports number | string.
  • Updated TableOfContentsProvider.tsx so Table of Contents item count supports number | string.
  • Scope is type-only; no runtime logic changes.

Copilot AI review requested due to automatic review settings May 6, 2026 12:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR widens the typing for “count/value” fields so consumers can pass either numeric counts or pre-formatted string counts (e.g., "9+") when rendering badges in Tabs and Table of Contents.

Changes:

  • Allow TableOfContentsItemType.count to be number | string.
  • Allow Tab<T>.count to be number | string.
  • Allow BadgeProps.value to be number | string.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/providers/TableOfContentsProvider.tsx Widened TableOfContentsItemType.count typing to accept strings for formatted counts.
src/molecules/Tabs/Tabs.types.ts Widened Tab<T>.count typing to accept strings, aligning with badge/count rendering usage.
src/molecules/Badge/Badge.tsx Widened BadgeProps.value typing to accept strings, enabling formatted badge content.

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 100% (🎯 100%) 17494 / 17494
🔵 Statements 100% (🎯 100%) 17494 / 17494
🔵 Functions 100% (🎯 100%) 1285 / 1285
🔵 Branches 100% (🎯 100%) 4474 / 4474
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/molecules/Badge/Badge.tsx 100% 100% 100% 100%
src/providers/TableOfContentsProvider.tsx 100% 100% 100% 100%
Generated in workflow #2296 for commit c699cae by the Vitest Coverage Report Action

@Rotshrek Rotshrek marked this pull request as ready for review May 6, 2026 13:56
@Rotshrek Rotshrek requested a review from a team as a code owner May 6, 2026 13:56
@Rotshrek Rotshrek requested a review from mariush2 May 6, 2026 13:56
@Rotshrek Rotshrek merged commit 3dbc163 into main May 7, 2026
14 of 15 checks passed
@Rotshrek Rotshrek deleted the feat/allow-strings-on-toc-count branch May 7, 2026 07:01
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