Skip to content

Comments

feat(classification): add Blueprint rendering behind isRedesignEnabled flag#4448

Merged
mergify[bot] merged 7 commits intobox:masterfrom
Nefaris:redesign-clasification-section
Feb 19, 2026
Merged

feat(classification): add Blueprint rendering behind isRedesignEnabled flag#4448
mergify[bot] merged 7 commits intobox:masterfrom
Nefaris:redesign-clasification-section

Conversation

@Nefaris
Copy link
Contributor

@Nefaris Nefaris commented Feb 19, 2026

Passes the isRedesignEnabled feature flag through the Classification component tree so child components can conditionally render Blueprint vs BUIE variants. This keeps the toggle controlled by the client app.

Changes

  • Add isRedesignEnabled prop to ClassificationSecurityControlsSecurityControlsItem
  • Add Storybook stories for legacy and redesigned variants

Usage

<Classification
  name="BOX-ONLY"
  definition="Internal data only..."
  messageStyle="inline"
  isRedesignEnabled={true}  // enables Blueprint components
/>

Screenshots

Without redesign flag With redesign flag With modernized flag

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced classification component with a redesigned interface featuring improved visual styling and layout for classified states, definitions, and security controls
    • New design maintains full backward compatibility with existing implementations
  • Style

    • New styling added for redesigned classification and security controls components

@Nefaris Nefaris requested a review from a team as a code owner February 19, 2026 18:53
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 19, 2026

Walkthrough

This PR introduces an isRedesignEnabled feature flag to the Classification component and its related SecurityControls subcomponents. When enabled, it switches the UI rendering to use redesigned layouts with Text components, flex containers, and updated styling, while maintaining backward compatibility through default false values. The flag propagates from Classification through SecurityControls to SecurityControlsItem, with corresponding styling and Storybook story variants added.

Changes

Cohort / File(s) Summary
Classification Component
src/features/classification/Classification.js, src/features/classification/Classification.scss
Added isRedesignEnabled prop to Classification component. When enabled, renders ClassifiedBadge as Status with Shield icon, switches definition and modification details to redesigned Text-based layout with flex containers, and applies new styling class. SCSS adds .bdl-Classification--redesign and .bdl-Classification-propertySection classes with flex layout and spacing.
SecurityControls Components
src/features/classification/security-controls/SecurityControls.js, src/features/classification/security-controls/SecurityControlsItem.js, src/features/classification/security-controls/SecurityControls.scss
Propagates isRedesignEnabled prop from SecurityControls to SecurityControlsItem. Updates rendering to use Text-based headers and removes tooltip in redesign mode. Adds .bdl-SecurityControls-viewAllButton class for styling. Conditional rendering based on redesign flag with Text components replacing plain rendering when enabled.
Storybook Stories
src/features/classification/Classification.stories.tsx
Introduces seven story variants: Legacy and Redesigned baselines, with Controls, AiClassification, and Full variants for each. Demonstrates component behavior across legacy and redesigned modes with various prop combinations including aiClassificationReason, controls, and applied-by labels.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

ready-to-merge

Suggested reviewers

  • tjuanitas
  • jpfranco
  • greg-in-a-box

Poem

🐰 A flag hops through the Classification tree,
Enabling redesigns for all to see,
With Text blocks and flex, the UI transforms bright,
SecurityControls align just right! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a Blueprint rendering feature flag (isRedesignEnabled) to the Classification component tree, which is the central objective of this PR.
Description check ✅ Passed The description covers the core changes (prop addition and propagation), provides clear usage examples and screenshots showing the before/after redesign behavior, though it lacks details about testing and specific implementation approach.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (2)
src/features/classification/Classification.stories.tsx (1)

24-79: LGTM — good story coverage across permutations

The matrix of Legacy/Redesigned × plain / with-controls / with-AI-classification gives solid visual regression coverage for the new flag. One gap to consider: an unclassified redesign story (no name prop) to exercise isNotClassifiedMessageVisible under isRedesignEnabled, since it still uses the classic <span className="bdl-Classification-missingMessage"> path regardless of the flag.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/features/classification/Classification.stories.tsx` around lines 24 - 79,
Add a new story that renders the redesigned variant of <Classification> with
isRedesignEnabled set but without providing any name/itemName prop so the
unclassified state is exercised; mirror the existing Redesigned story (use
isRedesignEnabled) but omit itemName/name and any
aiClassificationReason/controls so the component's isNotClassifiedMessageVisible
path (and the <span className="bdl-Classification-missingMessage"> output) is
rendered for visual tests.
src/features/classification/security-controls/SecurityControls.js (1)

119-134: SecurityControls borrows CSS class names from Classification's scope

bdl-Classification-propertySection and bdl-Classification-sectionLabel (Lines 119, 122) are defined in Classification.scss, not in SecurityControls.scss. This creates an implicit cross-component coupling: renaming or moving those classes in Classification.scss will silently break the SecurityControls redesign layout without any compile-time error.

Consider either:

  1. Defining equivalent classes in SecurityControls.scss (e.g. bdl-SecurityControls-section, bdl-SecurityControls-sectionLabel), or
  2. Passing a renderLabel render-prop from Classification so that the wrapping/labelling is entirely owned by the Classification component.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/features/classification/security-controls/SecurityControls.js` around
lines 119 - 134, SecurityControls is using Classification-scoped CSS classes
(bdl-Classification-propertySection, bdl-Classification-sectionLabel) which
couples the components; change SecurityControls to own its styles by renaming
those classNames to component-scoped names (e.g., bdl-SecurityControls-section
and bdl-SecurityControls-sectionLabel) in the JSX where itemsList and
shouldShowSecurityControlsModal are rendered (within the SecurityControls
component) and add corresponding rules in SecurityControls.scss to mirror the
visual behavior; alternatively, if you prefer composition, add a renderLabel
prop to Classification and update SecurityControls to accept and use that render
prop instead of hardcoding label markup—pick one approach and make matching
changes to the class names/SCSS or implement the renderLabel prop and update
usages accordingly (ensure openModal and itemsList behavior remains unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/features/classification/Classification.js`:
- Around line 138-145: The redesign path replaces the semantic 'article' with a
non-semantic 'div' via the Wrapper variable, which removes a navigable landmark;
change the Wrapper assignment so that when isRedesignEnabled is true it uses
'section' (preserving landmark semantics) instead of 'div' (i.e., update the
const Wrapper = isRedesignEnabled ? 'div' : 'article' to use 'section' for the
redesign case) while leaving the className/classNames usage and JSX wrapper
unchanged.
- Around line 146-156: The redesign branch is dropping the onClick handler so
consumers lose the edit interaction; when isRedesignEnabled is true, either
forward the onClick to Status (e.g., wrap Status in a clickable wrapper or pass
through a prop that attaches the handler and
data-resin-target="editclassification") or add an explicit guard/comment and a
development-time console.warn to indicate edit is not supported; update the JSX
around isRedesignEnabled/Status (and keep ClassifiedBadge behavior unchanged) so
onClick is preserved or the omission is clearly signaled.
- Line 148: The Status component is being passed an arbitrary hex string via the
color prop (variable color) which violates the Status Color type; update the
code that sets/provides color to use one of the allowed design-token values
(e.g., SurfaceStatusSurfaceGray, SurfaceStatusSurfaceYellow,
SurfaceStatusSurfaceOrange, SurfaceStatusSurfaceRed, SurfaceStatusSurfacePurple,
SurfaceStatusSurfaceLightBlue, SurfaceStatusSurfaceDarkBlue,
SurfaceStatusSurfaceGreen) or replace Status with a component that accepts
arbitrary colors; locate where Status is rendered (Status color={color}
icon={Shield} iconPosition="left" text={name}) and either map the current hex
values to the correct token constants or change the source of color to return a
token name instead.

In `@src/features/classification/security-controls/SecurityControls.js`:
- Around line 117-150: The "View All" TextButton is currently rendered only
inside the shouldRenderLabel branch causing no trigger when
isRedesignEnabled=true and shouldRenderLabel=false; update the SecurityControls
component by removing the TextButton from inside the
shouldRenderLabel/isRedesignEnabled conditional (the block that sets itemsList)
and instead render a single conditional trigger in the return JSX alongside the
existing PlainButton: when isRedesignEnabled is true and
shouldShowSecurityControlsModal is true render the TextButton
(onClick={this.openModal}), and when isRedesignEnabled is false render the
existing PlainButton (onClick={this.openModal}); keep itemsList and
securityControlsModal unchanged and ensure openModal is used as the click
handler.

---

Nitpick comments:
In `@src/features/classification/Classification.stories.tsx`:
- Around line 24-79: Add a new story that renders the redesigned variant of
<Classification> with isRedesignEnabled set but without providing any
name/itemName prop so the unclassified state is exercised; mirror the existing
Redesigned story (use isRedesignEnabled) but omit itemName/name and any
aiClassificationReason/controls so the component's isNotClassifiedMessageVisible
path (and the <span className="bdl-Classification-missingMessage"> output) is
rendered for visual tests.

In `@src/features/classification/security-controls/SecurityControls.js`:
- Around line 119-134: SecurityControls is using Classification-scoped CSS
classes (bdl-Classification-propertySection, bdl-Classification-sectionLabel)
which couples the components; change SecurityControls to own its styles by
renaming those classNames to component-scoped names (e.g.,
bdl-SecurityControls-section and bdl-SecurityControls-sectionLabel) in the JSX
where itemsList and shouldShowSecurityControlsModal are rendered (within the
SecurityControls component) and add corresponding rules in SecurityControls.scss
to mirror the visual behavior; alternatively, if you prefer composition, add a
renderLabel prop to Classification and update SecurityControls to accept and use
that render prop instead of hardcoding label markup—pick one approach and make
matching changes to the class names/SCSS or implement the renderLabel prop and
update usages accordingly (ensure openModal and itemsList behavior remains
unchanged).

Copy link
Contributor

@tjuanitas tjuanitas left a comment

Choose a reason for hiding this comment

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

lgtm

@Nefaris Nefaris assigned Nefaris and unassigned Nefaris Feb 19, 2026
@mergify mergify bot added the queued label Feb 19, 2026
@mergify mergify bot merged commit 5581999 into box:master Feb 19, 2026
10 of 11 checks passed
@mergify
Copy link
Contributor

mergify bot commented Feb 19, 2026

Merge Queue Status

Rule: Automatic strict merge


  • Entered queue2026-02-19 19:39 UTC
  • Checks passed · in-place
  • Merged2026-02-19 19:39 UTC · at ac795d475b8339f15ce2c694212d207aeb67144d

This pull request spent 7 seconds in the queue, with no time running CI.

Required conditions to merge

@mergify mergify bot removed the queued label Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants