Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
π‘ Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 234717f30a
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| > | ||
| {title} | ||
| </Text> | ||
| {count && prvCount && percentage && percentage !== 0 ? ( |
There was a problem hiding this comment.
Render zero-count percentage changes
When either metric is legitimately zero, this truthiness guard drops the percentage tag even though calcGrowthPercentage handles those cases. For example count={0} with prvCount={100} should show a 100% decrease, and count={5} with prvCount={0} should show the 100% increase path from the helper, but both render no badge because count && prvCount is false.
Useful? React with πΒ / π.
| {title} | ||
| </Text> | ||
| {count && prvCount && percentage && percentage !== 0 ? ( | ||
| <Tag className={isUp ? styles.percentUp : styles.percentDown} variant={'borderless'}> |
There was a problem hiding this comment.
Use Tag color props for percentage badges
Passing the success/warning class here does not color the badge because Tag always writes an inline color: colors?.textColor defaulting to colorTextSecondary (src/Tag/Tag.tsx lines 41 and 98-103), and that inline style overrides styles.percentUp/percentDown. As a result all TitleWithPercentage badges render neutral instead of green/orange; pass the appropriate color or inline style based on isUp.
Useful? React with πΒ / π.
Summary
Adds a self-contained
StatisticCardcomponent family to lobe-ui, so lobe-chat can drop its@ant-design/pro-components-based wrapper.Linear: LOBE-11988
Components (all exported from
@lobehub/ui)StatisticCardβ metric card with flat API:title / extra / loading / value / precision / prefix / suffix / description / variant, plusclassNames/stylesslot overrides (root/header/title/extra/content/value/description)Statisticβ compact label + value pair for thedescriptionslotTitleWithPercentageβ title with growth-percentage tag (β 14.4%/β 3.2%) for thetitleslotDesign
base-uiconventions (cvavariants,cssVartokens,prefers-reduced-motion)colorTextSecondary), hero 28/500 value withtabular-numsand β1% tracking, 12px description 4px belowvariant:borderless(default) /outlined/filled; outlined hover brightens the border only (160mscubic-bezier(0.32,0.72,0,1)), matching base-ui Buttonresponsive.sm): drops border/radius, usescolorBgContainerLoader2spin icon in the extra slotDocs
src/StatisticCard/index.mdx(Data Display) + StoryBook demo with leva controlssite/content/navigationSections.jsondocs/superpowers/specs/2026-07-17-statistic-card-design.mdTesting
eslintclean on changed files;tsc --noEmitpassesFollow-up (separate PR in lobe-chat)
Replace the three pro-components usages (
StatisticCardwrapper,ProTablein ApiKey,ProDescriptionsin AgentInfoDescription) and remove the dependency.