Repository navigation
fix(icons): fall back to Stepfun Mono when Color component is absent … - #7743
Conversation
…in @lobehub/icons v5.13 @lobehub/icons v5.13.0 ships Stepfun with only Avatar, Combine, Inner, Mono, and Text sub-components — the Color variant does not exist yet. Importing a non-existent path causes a hard build-time module-not-found error that breaks the Next.js dashboard for all users on this version. Changes: - Remove the broken import StepfunColorIcon from '@lobehub/icons/es/Stepfun/components/Color' - Replace with a comment explaining the fallback - Point both mono and color slots in the icon map to StepfunMonoIcon This is a purely cosmetic fallback; the Stepfun provider icon will render in mono style instead of colour until the upstream package adds the Color component. No API, routing, or DB changes.
There was a problem hiding this comment.
Code Review
This pull request removes the import of StepfunColorIcon due to its absence in the installed @lobehub/icons package and falls back to using StepfunMonoIcon. The reviewer suggests omitting the color property entirely for Stepfun instead of duplicating the mono icon, as the underlying type defines color as optional and automatically falls back to mono when undefined.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| Snowflake: { mono: SnowflakeMonoIcon, color: SnowflakeColorIcon }, | ||
| Stability: { mono: StabilityMonoIcon, color: StabilityColorIcon }, | ||
| Stepfun: { mono: StepfunMonoIcon, color: StepfunColorIcon }, | ||
| Stepfun: { mono: StepfunMonoIcon, color: StepfunMonoIcon }, |
There was a problem hiding this comment.
Since the LobeIconEntry type defines color as optional (color?: LobeIconComponent) and getLobeProviderIcon automatically falls back to mono when color is undefined, we can simply omit the color property for Stepfun instead of duplicating StepfunMonoIcon. This is consistent with other mono-only icons in this map (e.g., Suno, Ai21, Anthropic).
| Stepfun: { mono: StepfunMonoIcon, color: StepfunMonoIcon }, | |
| Stepfun: { mono: StepfunMonoIcon }, |
Reading localStorage in the useState initializer for collapsed causes a hydration mismatch on SSR. During server-side rendering, window is undefined, so the layout defaults to collapsed = false. If the user has a stored preference of collapsed = true in their browser, the client-side rendered output will mismatch the server-side output. Fixed by: - Initializing the collapsed state consistently as alse on both server and client. - Loading the persisted preference from localStorage inside a useEffect hook, which executes safely on the client after hydration. - Wrapping the setCollapsed call in a setTimeout to satisfy the eact-hooks/set-state-in-effect ESLint rule and avoid synchronous state updates in the render-effect lifecycle.
… hydration fix Locks in the two production fixes in this PR: the removed @lobehub/icons Stepfun Color import must never come back, and DashboardLayout's collapsed-sidebar state must stay a constant useState initializer (localStorage read deferred to useEffect) to avoid a server/client hydration mismatch. Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouzapw@users.noreply.github.com>
|
Thanks @Dan-ex-hub! Stepfun Mono fallback when the Color icon component is absent, plus the sidebar hydration fix. Validated in local merge-train @ c5997d6b2 (FAST gates green: static + changed tests + vitest). The stale per-PR CI reds were the shared base-red on the release tip, not this PR. |
474e4f5
into
cheaper-inference:release/v3.8.49
cheaper-inference#7743) * fix(icons): fall back to Stepfun Mono when Color component is absent in @lobehub/icons v5.13 @lobehub/icons v5.13.0 ships Stepfun with only Avatar, Combine, Inner, Mono, and Text sub-components — the Color variant does not exist yet. Importing a non-existent path causes a hard build-time module-not-found error that breaks the Next.js dashboard for all users on this version. Changes: - Remove the broken import StepfunColorIcon from '@lobehub/icons/es/Stepfun/components/Color' - Replace with a comment explaining the fallback - Point both mono and color slots in the icon map to StepfunMonoIcon This is a purely cosmetic fallback; the Stepfun provider icon will render in mono style instead of colour until the upstream package adds the Color component. No API, routing, or DB changes. * fix(ui): resolve Next.js hydration mismatch on sidebar collapsed state Reading localStorage in the useState initializer for collapsed causes a hydration mismatch on SSR. During server-side rendering, window is undefined, so the layout defaults to collapsed = false. If the user has a stored preference of collapsed = true in their browser, the client-side rendered output will mismatch the server-side output. Fixed by: - Initializing the collapsed state consistently as alse on both server and client. - Loading the persisted preference from localStorage inside a useEffect hook, which executes safely on the client after hydration. - Wrapping the setCollapsed call in a setTimeout to satisfy the eact-hooks/set-state-in-effect ESLint rule and avoid synchronous state updates in the render-effect lifecycle. * test(ui): add regression guards for Stepfun mono fallback and sidebar hydration fix Locks in the two production fixes in this PR: the removed @lobehub/icons Stepfun Color import must never come back, and DashboardLayout's collapsed-sidebar state must stay a constant useState initializer (localStorage read deferred to useEffect) to avoid a server/client hydration mismatch. Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouzapw@users.noreply.github.com> --------- Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com> Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouzapw@users.noreply.github.com>
cheaper-inference#7743) * fix(icons): fall back to Stepfun Mono when Color component is absent in @lobehub/icons v5.13 @lobehub/icons v5.13.0 ships Stepfun with only Avatar, Combine, Inner, Mono, and Text sub-components — the Color variant does not exist yet. Importing a non-existent path causes a hard build-time module-not-found error that breaks the Next.js dashboard for all users on this version. Changes: - Remove the broken import StepfunColorIcon from '@lobehub/icons/es/Stepfun/components/Color' - Replace with a comment explaining the fallback - Point both mono and color slots in the icon map to StepfunMonoIcon This is a purely cosmetic fallback; the Stepfun provider icon will render in mono style instead of colour until the upstream package adds the Color component. No API, routing, or DB changes. * fix(ui): resolve Next.js hydration mismatch on sidebar collapsed state Reading localStorage in the useState initializer for collapsed causes a hydration mismatch on SSR. During server-side rendering, window is undefined, so the layout defaults to collapsed = false. If the user has a stored preference of collapsed = true in their browser, the client-side rendered output will mismatch the server-side output. Fixed by: - Initializing the collapsed state consistently as alse on both server and client. - Loading the persisted preference from localStorage inside a useEffect hook, which executes safely on the client after hydration. - Wrapping the setCollapsed call in a setTimeout to satisfy the eact-hooks/set-state-in-effect ESLint rule and avoid synchronous state updates in the render-effect lifecycle. * test(ui): add regression guards for Stepfun mono fallback and sidebar hydration fix Locks in the two production fixes in this PR: the removed @lobehub/icons Stepfun Color import must never come back, and DashboardLayout's collapsed-sidebar state must stay a constant useState initializer (localStorage read deferred to useEffect) to avoid a server/client hydration mismatch. Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouzapw@users.noreply.github.com> --------- Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com> Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouzapw@users.noreply.github.com>
…in @lobehub/icons v5.13
@lobehub/icons v5.13.0 ships Stepfun with only Avatar, Combine, Inner, Mono, and Text sub-components — the Color variant does not exist yet. Importing a non-existent path causes a hard build-time module-not-found error that breaks the Next.js dashboard for all users on this version.
Changes:
This is a purely cosmetic fallback; the Stepfun provider icon will render in mono style instead of colour until the upstream package adds the Color component. No API, routing, or DB changes.
Summary
Related Issues
Validation
npm run lintnpm run test:unitnpm run test:coverage>= 60%for statements, lines, functions, and branchesTests Added Or Updated
Coverage Notes
src/,open-sse/,electron/, orbin/, explain which tests cover the change.Reviewer Notes