Skip to content

feat(content-sidebar): Use Blueprint Text for Insights and Details titles - #4834

Open
jackiejou wants to merge 2 commits into
box:masterfrom
jackiejou:fix/sidebar-and-insights-blueprint-text
Open

jackiejou wants to merge 2 commits into
box:masterfrom
jackiejou:fix/sidebar-and-insights-blueprint-text

Conversation

@jackiejou

@jackiejou jackiejou commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Put Content Insights overlay titles and counts on Blueprint Text captionBold when the host passes isRedesignEnabled
  • Added variant and color on CompactCount so the header chip can use bodyLargeBold and textOnLightDefault
  • Put Details panel titles on Text titleLarge and section headers on bodyDefaultBold
  • Threaded isRedesignEnabled through DetailsSidebar and SidebarContentInsights instead of hardcoding it
  • Converted SidebarContent and SidebarSection tests to RTL TypeScript

Why

Insights and Details sidebar type was still on raw spans and old CSS sizes. Blueprint Text variants match the Inter audit sizes. Insights stay host-gated; panel and section titles do not.

Test plan

  • Files sidebar Insights: Previews title and count use captionBold when the host passes isRedesignEnabled
  • Preview Details Insights card uses the same path when detailsSidebarProps.isRedesignEnabled is true
  • Preview Details / Activity / Metadata panel h2 uses titleLarge
  • Section headers (Properties, Skills) use bodyDefaultBold
  • Header chip still needs a host change to pass variant="bodyLargeBold" and color="textOnLightDefault" after this lands
  • Box AI sidebar title uses shared .bcs-title without a variant. It may render at bodyDefault (14px) instead of the old 16px until that title sets a variant. Left that component unchanged.

Summary by CodeRabbit

  • New Features

    • Added an optional redesigned Content Insights presentation for supported sidebars.
    • Added configurable count colors and text variants for redesigned views.
  • Style

    • Standardized sidebar titles and section labels using updated design-system typography.
    • Refined heading sizing and emphasis across sidebar content.
    • Updated Content Insights headers, counts, and metrics with refreshed typography.
  • Tests

    • Added coverage for redesigned Insights rendering, typography variants, count styling, and sidebar title behavior.

…tles

Insights titles and counts use captionBold when the host passes isRedesignEnabled.
CompactCount accepts variant and color so the header chip can use bodyLargeBold.
Details panel and section titles always use titleLarge and bodyDefaultBold.
@jackiejou
jackiejou requested review from a team as code owners September 15, 2026 21:52
@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 4789f75b-c00b-4fad-a14a-869e5d3bf45e

📥 Commits

Reviewing files that changed from the base of the PR and between ba31376 and 4a1e990.

📒 Files selected for processing (3)
  • src/elements/content-sidebar/SidebarContent.js.flow
  • src/elements/content-sidebar/SidebarContent.tsx
  • src/elements/content-sidebar/__tests__/SidebarContent.test.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/elements/content-sidebar/SidebarContent.js.flow

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


Walkthrough

The sidebar now forwards an optional redesign flag to content insights. Sidebar titles use Blueprint Web Text variants. Content insights counts and headers use configurable redesign variants. Tests cover propagation, rendering, defaults, and overrides.

Changes

Content sidebar redesign

Layer / File(s) Summary
Redesign flag wiring
src/elements/content-sidebar/DetailsSidebar.js, src/elements/content-sidebar/SidebarContentInsights.tsx, src/elements/content-sidebar/__tests__/DetailsSidebar.test.js, src/elements/content-sidebar/__tests__/SidebarContentInsights.test.tsx
isRedesignEnabled is accepted by the sidebar, forwarded to ContentInsightsSummary, and verified in default and redesigned renders.
Sidebar typography updates
src/elements/content-sidebar/SidebarContent.*, src/elements/content-sidebar/SidebarSection.js, src/elements/content-sidebar/__tests__/SidebarContent*, src/elements/content-sidebar/__tests__/SidebarSection.test.tsx
Sidebar titles use Blueprint Web Text with titleMedium or bodyDefaultBold variants. The previous title CSS overrides are removed. Tests cover title presence, variants, children, and omitted titles.
Content insights text variants
src/features/content-insights/CompactCount.tsx, src/features/content-insights/HeaderWithCount.tsx, src/features/content-insights/__tests__/*
CompactCount accepts configurable color and variant values. Redesigned headers and counts use captionBold. Tests cover defaults, overrides, and metric summary variants.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant DetailsSidebar
  participant SidebarContentInsights
  participant ContentInsightsSummary
  DetailsSidebar->>SidebarContentInsights: pass isRedesignEnabled
  SidebarContentInsights->>ContentInsightsSummary: pass isRedesignEnabled
  ContentInsightsSummary-->>SidebarContentInsights: render redesigned summary class
Loading

Suggested reviewers: jfox-box, mattfrankowski

Merge Risk: ⚪ Minimal · up to 4a1e9

The typography and redesign-flag changes have no established production, security, or data-integrity failure and are mergeable with normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 13 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: using Blueprint Text for Content Insights and Details sidebar titles. It is concise and related to the changeset.
Description check ✅ Passed The description includes a clear summary, rationale, and test plan. It documents the typography changes, prop threading, test updates, and remaining host integration work. The unchecked test-plan item…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 13 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the sidebar bright
Text brings titles into light
The redesign flag hops downstream
Counts wear a caption-bold theme
Tests watch each variant glow
And tidy headings softly show

Comment @coderabbitai help to get the list of available commands.

Panel headings use the 18px Inter token already shown in preview.
if (isRedesignEnabled) {
return (
<Text as="span" className={className} color="textOnLightSecondary" variant="bodyDefaultSemibold" {...rest}>
<Text as="span" className={className} color={color} variant={variant} {...rest}>

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.

why are color and variant coming from props now?

instead of:

Suggested change
<Text as="span" className={className} color={color} variant={variant} {...rest}>
<Text as="span" className={className} color="textOnLightSecondary" variant="captionBold" {...rest}>

Comment on lines +94 to +96
<Text as="span" variant="bodyDefaultBold">
{title}
</Text>

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.

out of curiosity, any visual difference here?

Comment on lines +42 to +46
{title && (
<Text as="h2" className="bcs-title" variant="titleMedium">
{title}
</Text>
)}

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.

same question, any visual difference here? the native h2 would've had margin / padding on it but the Text from blueprint would reset those properties

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.

nvm I see in src/elements/content-sidebar/SidebarContent.scss that bcs-title removes the margin and padding. now that this is using Text, you don't need those properties anymore?

Comment on lines +11 to +22
jest.mock('@box/blueprint-web', () => ({
Text: ({
as: Component = 'p',
children,
variant,
...rest
}: React.ComponentPropsWithoutRef<'span'> & { as?: React.ElementType; variant?: string }) => (
<Component data-variant={variant} {...rest}>
{children}
</Component>
),
}));

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.

is the blueprint-web mock needed? I thought RTL tests would be able to use blueprint-web components without modification

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.

2 participants