Skip to content

Conversation

@kduncanhsu
Copy link
Contributor

@kduncanhsu kduncanhsu commented Dec 16, 2025

JIRA ticket link

https://jira.inside-box.net/browse/WEBAPP-42958

Description

Update Skills and DocGen tabs in SidebarNav to use Blueprint icons

Screenshots

Before After
old new
old new
old new
old new

Summary by CodeRabbit

  • New Features

    • Added MagicWand and DocGen icons to the public icon set.
  • Improvements

    • Sidebar navigation now uses updated icon variants to support preview-modernized visuals and correct active-state styling via internal variant switching.

✏️ Tip: You can customize this high-level summary in your review settings.

@kduncanhsu kduncanhsu requested review from a team as code owners December 16, 2025 23:58
@CLAassistant
Copy link

CLAassistant commented Dec 16, 2025

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

Walkthrough

Adds Flow exports for MagicWand and DocGen icons in @box/blueprint-web-assets stubs and introduces two internal SidebarNav wrappers (SkillsIconWrapper, DocGenIconWrapper) that select icon variants and colors based on the preview-modernization flag and active state.

Changes

Cohort / File(s) Summary
Flow type declarations
flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
Added declare export var MagicWand: React$ComponentType<any>; and declare export var DocGen: React$ComponentType<any>; to @box/blueprint-web-assets/icons/Medium and added declare export var MagicWand: React$ComponentType<any>; to @box/blueprint-web-assets/icons/MediumFilled.
Icon wrappers and SidebarNav updates
src/elements/content-sidebar/SidebarNav.js
Added internal SkillsIconWrapper and DocGenIconWrapper that choose between base/filled icon variants and color based on preview-modernization and active state; replaced direct icon usages for Skills and DocGen tabs with these wrappers and updated imports.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify Flow stub module paths and exported names match the actual package layout.
  • Review SidebarNav wrapper logic for correct preview-modernization flag handling and active-state color selection.
  • Confirm imports reference the newly exported icon names.

Possibly related PRs

Suggested reviewers

  • tjuanitas
  • JChan106
  • bfoxx1906

Poem

🐇 I found two icons, wand and doc in tow,
I tucked them in wrappers so they swap and glow.
Sidebar listens to flags and state,
I hop, I patch, then celebrate. ✨🪄📄

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: updating Skills and DocGen icons to use Blueprint icons in SidebarNav, with reference to the JIRA ticket.
Description check ✅ Passed The PR description includes a JIRA ticket link, clear description of changes, and before-and-after screenshots demonstrating the visual changes. However, it lacks detailed technical context about the implementation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8571e73 and a2add9a.

📒 Files selected for processing (2)
  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js (1 hunks)
  • src/elements/content-sidebar/SidebarNav.js (4 hunks)
🧰 Additional context used
🧠 Learnings (10)
📓 Common learnings
Learnt from: rafalmaksymiuk
Repo: box/box-ui-elements PR: 4144
File: src/elements/content-sidebar/versions/VersionsList.js:24-33
Timestamp: 2025-06-17T13:30:02.172Z
Learning: In the box-ui-elements codebase, Flow components use .flow.js type definition files, not TypeScript .ts files. The InternalSidebarNavigation type is a union type where different variants may have different properties like versionId, and proper type safety is ensured through conditional checks in methods like getSelectedVersionId.
📚 Learning: 2025-09-03T18:10:42.760Z
Learnt from: fpan225
Repo: box/box-ui-elements PR: 4239
File: src/elements/content-sidebar/SidebarNav.js:195-206
Timestamp: 2025-09-03T18:10:42.760Z
Learning: In src/elements/content-sidebar/SidebarNav.js, the maintainer wants users to be able to override data-* attributes (data-resin-target, data-target-id, data-testid) through navButtonProps for custom tabs. The spread of {...navButtonProps} should come after the data-* attributes to allow overriding, not before them.

Applied to files:

  • src/elements/content-sidebar/SidebarNav.js
📚 Learning: 2025-09-03T18:10:29.467Z
Learnt from: fpan225
Repo: box/box-ui-elements PR: 4239
File: src/elements/content-sidebar/SidebarNav.js:94-106
Timestamp: 2025-09-03T18:10:29.467Z
Learning: In the ContentSidebar CustomSidebarPanel API, the navButtonProps spread should come after explicit data-* attributes to allow users to override analytics tracking attributes like data-resin-target, data-target-id, and data-testid when needed. This is intentional API design for flexibility.

Applied to files:

  • src/elements/content-sidebar/SidebarNav.js
📚 Learning: 2025-06-17T13:30:02.172Z
Learnt from: rafalmaksymiuk
Repo: box/box-ui-elements PR: 4144
File: src/elements/content-sidebar/versions/VersionsList.js:24-33
Timestamp: 2025-06-17T13:30:02.172Z
Learning: In the box-ui-elements codebase, Flow components use .flow.js type definition files, not TypeScript .ts files. The InternalSidebarNavigation type is a union type where different variants may have different properties like versionId, and proper type safety is ensured through conditional checks in methods like getSelectedVersionId.

Applied to files:

  • src/elements/content-sidebar/SidebarNav.js
  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
📚 Learning: 2025-09-09T18:21:24.552Z
Learnt from: bfoxx1906
Repo: box/box-ui-elements PR: 4244
File: src/components/form-elements/draft-js-mention-selector/DraftTimestampItem.tsx:10-22
Timestamp: 2025-09-09T18:21:24.552Z
Learning: For DraftTimestampItem component in box-ui-elements, the user confirmed to keep the div element and not switch to span, maintaining the current aria-label implementation without child text.

Applied to files:

  • src/elements/content-sidebar/SidebarNav.js
📚 Learning: 2025-06-25T13:09:54.538Z
Learnt from: rafalmaksymiuk
Repo: box/box-ui-elements PR: 4160
File: src/elements/content-sidebar/SidebarToggle.js:21-27
Timestamp: 2025-06-25T13:09:54.538Z
Learning: The box-ui-elements project uses Flow for type annotations in JavaScript files, as indicated by flow directives in file headers. Type annotations like `: Props` are valid Flow syntax, not TypeScript syntax.

Applied to files:

  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
📚 Learning: 2025-06-25T13:10:19.128Z
Learnt from: rafalmaksymiuk
Repo: box/box-ui-elements PR: 4160
File: src/elements/content-sidebar/SidebarToggle.js:11-11
Timestamp: 2025-06-25T13:10:19.128Z
Learning: In the box-ui-elements codebase, Flow files support `import type` syntax for type-only imports. The `import type` statement is valid Flow syntax, not just TypeScript, and should not be flagged as an error when used in Flow files (indicated by flow comments).

Applied to files:

  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
📚 Learning: 2025-08-12T18:04:17.698Z
Learnt from: tjuanitas
Repo: box/box-ui-elements PR: 4224
File: package.json:296-297
Timestamp: 2025-08-12T18:04:17.698Z
Learning: In the box-ui-elements project, the team is comfortable with raising peerDependency minimum versions when upgrading blueprint-web packages, even if it's a breaking change for consumers.

Applied to files:

  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
📚 Learning: 2025-06-25T13:09:45.168Z
Learnt from: rafalmaksymiuk
Repo: box/box-ui-elements PR: 4160
File: src/elements/content-sidebar/SidebarToggle.js:13-19
Timestamp: 2025-06-25T13:09:45.168Z
Learning: Files with `flow` or `flow strict` comments at the top use Flow type syntax, not TypeScript. Flow type definitions like `type Props = { ... }` and type imports like `type { RouterHistory }` are valid Flow syntax and should not be flagged as TypeScript-only features.

Applied to files:

  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
📚 Learning: 2025-09-03T18:30:44.447Z
Learnt from: fpan225
Repo: box/box-ui-elements PR: 4239
File: src/elements/content-sidebar/SidebarPanels.js:0-0
Timestamp: 2025-09-03T18:30:44.447Z
Learning: In the CustomSidebarPanel type, the component field is required (React.ComponentType<any>), so runtime checks for component existence are unnecessary since Flow will catch missing components at compile time. User fpan225 prefers to rely on the type system rather than adding redundant runtime checks.

Applied to files:

  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
🧬 Code graph analysis (1)
src/elements/content-sidebar/SidebarNav.js (2)
src/components/sidebar-toggle-button/SidebarToggleButton.js (1)
  • isPreviewModernizationEnabled (44-44)
src/elements/content-sidebar/additional-tabs/AdditionalTabTooltip.js (1)
  • isPreviewModernizationEnabled (23-23)
🪛 Biome (2.1.2)
src/elements/content-sidebar/SidebarNav.js

[error] 98-98: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.

TypeScript only syntax

(parse)


[error] 109-109: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.

TypeScript only syntax

(parse)

flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js

[error] 19-20: The 'declare' modifier can only be used in TypeScript files.

(parse)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: lint_test_build
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Summary
🔇 Additional comments (5)
flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js (1)

16-24: LGTM! Type declarations correctly added for new Blueprint icons.

The Flow type stubs properly declare the new icon exports (MagicWand and DocGen in Medium, MagicWand in MediumFilled) that are now used in SidebarNav.js. The declarations follow the established pattern and correctly reflect that DocGen doesn't have a filled variant.

src/elements/content-sidebar/SidebarNav.js (4)

17-18: LGTM! Blueprint icon imports correctly added.

The new imports for MagicWandIcon, BPDocGenIcon, and MagicWandIconFilled are properly structured and align with the type declarations added to the Flow stubs.

Also applies to: 24-24


98-107: LGTM! SkillsIconWrapper follows the established pattern.

The implementation correctly switches between legacy and Blueprint icons based on the preview modernization flag, and uses the filled variant with blue color for the active state, consistent with other icon wrappers in the file.


109-118: LGTM! DocGenIconWrapper correctly handles the missing filled variant.

The implementation appropriately uses the same icon variant for both states, differentiating the active state through the color prop. This is the correct approach given that DocGen doesn't have a filled variant available.


251-251: LGTM! Icon wrappers correctly integrated.

The new icon wrappers are properly used within their respective SidebarNavButton components, consistent with how other icon wrappers are used throughout the file.

Also applies to: 278-278


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: 2

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03bd678 and add268a.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js (1 hunks)
  • package.json (1 hunks)
  • src/elements/content-sidebar/SidebarNav.js (4 hunks)
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: tjuanitas
Repo: box/box-ui-elements PR: 4224
File: package.json:296-297
Timestamp: 2025-08-12T18:04:17.698Z
Learning: In the box-ui-elements project, the team is comfortable with raising peerDependency minimum versions when upgrading blueprint-web packages, even if it's a breaking change for consumers.
Learnt from: rafalmaksymiuk
Repo: box/box-ui-elements PR: 4144
File: src/elements/content-sidebar/versions/VersionsList.js:24-33
Timestamp: 2025-06-17T13:30:02.172Z
Learning: In the box-ui-elements codebase, Flow components use .flow.js type definition files, not TypeScript .ts files. The InternalSidebarNavigation type is a union type where different variants may have different properties like versionId, and proper type safety is ensured through conditional checks in methods like getSelectedVersionId.
Learnt from: rafalmaksymiuk
Repo: box/box-ui-elements PR: 4160
File: src/elements/content-sidebar/SidebarToggle.js:21-27
Timestamp: 2025-06-25T13:09:54.538Z
Learning: The box-ui-elements project uses Flow for type annotations in JavaScript files, as indicated by flow directives in file headers. Type annotations like `: Props` are valid Flow syntax, not TypeScript syntax.
📚 Learning: 2025-06-25T13:09:54.538Z
Learnt from: rafalmaksymiuk
Repo: box/box-ui-elements PR: 4160
File: src/elements/content-sidebar/SidebarToggle.js:21-27
Timestamp: 2025-06-25T13:09:54.538Z
Learning: The box-ui-elements project uses Flow for type annotations in JavaScript files, as indicated by flow directives in file headers. Type annotations like `: Props` are valid Flow syntax, not TypeScript syntax.

Applied to files:

  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
📚 Learning: 2025-06-25T13:10:19.128Z
Learnt from: rafalmaksymiuk
Repo: box/box-ui-elements PR: 4160
File: src/elements/content-sidebar/SidebarToggle.js:11-11
Timestamp: 2025-06-25T13:10:19.128Z
Learning: In the box-ui-elements codebase, Flow files support `import type` syntax for type-only imports. The `import type` statement is valid Flow syntax, not just TypeScript, and should not be flagged as an error when used in Flow files (indicated by flow comments).

Applied to files:

  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
📚 Learning: 2025-08-12T18:04:17.698Z
Learnt from: tjuanitas
Repo: box/box-ui-elements PR: 4224
File: package.json:296-297
Timestamp: 2025-08-12T18:04:17.698Z
Learning: In the box-ui-elements project, the team is comfortable with raising peerDependency minimum versions when upgrading blueprint-web packages, even if it's a breaking change for consumers.

Applied to files:

  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
  • package.json
📚 Learning: 2025-06-17T13:30:02.172Z
Learnt from: rafalmaksymiuk
Repo: box/box-ui-elements PR: 4144
File: src/elements/content-sidebar/versions/VersionsList.js:24-33
Timestamp: 2025-06-17T13:30:02.172Z
Learning: In the box-ui-elements codebase, Flow components use .flow.js type definition files, not TypeScript .ts files. The InternalSidebarNavigation type is a union type where different variants may have different properties like versionId, and proper type safety is ensured through conditional checks in methods like getSelectedVersionId.

Applied to files:

  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
📚 Learning: 2025-09-16T14:53:03.538Z
Learnt from: bfoxx1906
Repo: box/box-ui-elements PR: 4275
File: src/components/form-elements/draft-js-mention-selector/index.js:4-4
Timestamp: 2025-09-16T14:53:03.538Z
Learning: The createMentionSelectorState export in src/components/form-elements/draft-js-mention-selector/index.js was confirmed to be internal-only within the box-ui-elements package, with no external references or documentation, making the breaking rename to createMentionTimestampSelectorState safe.

Applied to files:

  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
📚 Learning: 2025-06-25T13:09:45.168Z
Learnt from: rafalmaksymiuk
Repo: box/box-ui-elements PR: 4160
File: src/elements/content-sidebar/SidebarToggle.js:13-19
Timestamp: 2025-06-25T13:09:45.168Z
Learning: Files with `flow` or `flow strict` comments at the top use Flow type syntax, not TypeScript. Flow type definitions like `type Props = { ... }` and type imports like `type { RouterHistory }` are valid Flow syntax and should not be flagged as TypeScript-only features.

Applied to files:

  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
📚 Learning: 2025-09-03T18:30:44.447Z
Learnt from: fpan225
Repo: box/box-ui-elements PR: 4239
File: src/elements/content-sidebar/SidebarPanels.js:0-0
Timestamp: 2025-09-03T18:30:44.447Z
Learning: In the CustomSidebarPanel type, the component field is required (React.ComponentType<any>), so runtime checks for component existence are unnecessary since Flow will catch missing components at compile time. User fpan225 prefers to rely on the type system rather than adding redundant runtime checks.

Applied to files:

  • flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
📚 Learning: 2025-09-03T18:10:42.760Z
Learnt from: fpan225
Repo: box/box-ui-elements PR: 4239
File: src/elements/content-sidebar/SidebarNav.js:195-206
Timestamp: 2025-09-03T18:10:42.760Z
Learning: In src/elements/content-sidebar/SidebarNav.js, the maintainer wants users to be able to override data-* attributes (data-resin-target, data-target-id, data-testid) through navButtonProps for custom tabs. The spread of {...navButtonProps} should come after the data-* attributes to allow overriding, not before them.

Applied to files:

  • src/elements/content-sidebar/SidebarNav.js
🧬 Code graph analysis (1)
src/elements/content-sidebar/SidebarNav.js (2)
src/components/sidebar-toggle-button/SidebarToggleButton.js (1)
  • isPreviewModernizationEnabled (35-35)
src/elements/content-sidebar/additional-tabs/AdditionalTabTooltip.js (1)
  • isPreviewModernizationEnabled (23-23)
🪛 Biome (2.1.2)
flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js

[error] 15-16: The 'declare' modifier can only be used in TypeScript files.

(parse)

src/elements/content-sidebar/SidebarNav.js

[error] 98-98: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.

TypeScript only syntax

(parse)


[error] 109-109: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.

TypeScript only syntax

(parse)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: lint_test_build
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Summary
🔇 Additional comments (4)
src/elements/content-sidebar/SidebarNav.js (3)

17-25: LGTM! New icon imports are properly organized.

The imports for MagicWand and DocGen icons from both Medium and MediumFilled modules are correctly structured and use appropriate aliases to avoid naming conflicts.


98-107: LGTM! MagicWandIconWrapper follows the established pattern.

The wrapper correctly implements the conditional rendering logic: it uses the filled variant with blue color when active, the regular variant when inactive, and falls back to the legacy icon when preview modernization is disabled.


251-251: LGTM! Icon wrappers are correctly integrated.

The new MagicWandIconWrapper and DocGenIconWrapper components are properly used in place of the legacy icon components, with the isPreviewModernizationEnabled prop correctly passed through.

Also applies to: 278-278

flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js (1)

12-13: DocGen does not have a filled variant in blueprint-web-assets 4.88.2—current implementation is acceptable.

The Flow types confirm that DocGen is only exported from the Medium module (line 13) and is absent from MediumFilled (which includes MagicWand). The DocGenIconWrapper implementation correctly uses the same DocGen icon for both active and inactive states, only changing the color. Since no filled variant exists, this implementation is consistent with the available assets.

JChan106
JChan106 previously approved these changes Dec 17, 2025
Copy link
Contributor

@JChan106 JChan106 left a comment

Choose a reason for hiding this comment

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

lgtm!

dealwith
dealwith previously approved these changes Dec 17, 2025
JChan106
JChan106 previously approved these changes Dec 17, 2025
jmcbgaston
jmcbgaston previously approved these changes Dec 17, 2025
@kduncanhsu kduncanhsu dismissed stale reviews from jmcbgaston and JChan106 via 9a5953b December 18, 2025 00:26
tjuanitas
tjuanitas previously approved these changes Dec 18, 2025
@mergify mergify bot added the queued label Dec 19, 2025
@mergify mergify bot merged commit e63cd39 into box:master Dec 19, 2025
9 checks passed
@mergify
Copy link
Contributor

mergify bot commented Dec 19, 2025

Merge Queue Status

✅ The pull request has been merged at a2add9a

This pull request spent 7 seconds in the queue, with no time running CI.
The checks were run in-place.

Required conditions to merge

@mergify mergify bot removed the queued label Dec 19, 2025
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.

6 participants