Skip to content

fix(docgen-sidebar): adjust fixed accordion items#4500

Open
pyaromchyk-stack wants to merge 1 commit intobox:masterfrom
pyaromchyk-stack:DOCGEN-9873
Open

fix(docgen-sidebar): adjust fixed accordion items#4500
pyaromchyk-stack wants to merge 1 commit intobox:masterfrom
pyaromchyk-stack:DOCGEN-9873

Conversation

@pyaromchyk-stack
Copy link
Copy Markdown
Contributor

@pyaromchyk-stack pyaromchyk-stack commented Apr 10, 2026

Adjusting tags to have consistent look in according in docgen side pannel, as a request from design team. Had to do padding overwrite as well as text-size because designs are different for old and modernized blueprint components

Before After
Before 1 After 1
Before 2 After 2

Summary by CodeRabbit

  • New Features

    • Added preview modernization feature to enable/disable enhanced styling in the DocGen sidebar.
  • Style

    • Updated tag path styling with bold font weight and improved typography.
    • Introduced modernized variant with refined spacing and font-sizing properties.

@pyaromchyk-stack pyaromchyk-stack requested review from a team as code owners April 10, 2026 10:05
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 10, 2026

Walkthrough

This PR updates DocGenSidebar styling and TagTree component to support the preview modernization feature. It replaces global accordion width/padding rules with CSS custom properties, introduces a modernized font-size variant for tag paths, and conditionally applies a modernized CSS class based on the previewModernization feature flag. The Storybook story is updated to enable this feature flag.

Changes

Cohort / File(s) Summary
Styling Updates
src/elements/content-sidebar/DocGenSidebar/DocGenSidebar.scss
Replaced padding-left with font-weight: bold on .bcs-DocGen-tagPath, added --modernized modifier for alternate font sizing, removed global accordion * rule in favor of CSS custom property overrides for padding.
Feature Flag Integration
src/elements/content-sidebar/DocGenSidebar/TagTree.tsx
Added useFeatureConfig('previewModernization') hook and conditional application of bcs-DocGen-tagPath--modernized CSS class based on feature flag state.
Storybook Configuration
src/elements/content-sidebar/DocGenSidebar/stories/DocGenSidebar.stories.tsx
Updated withModernizedBlueprint story args to include explicit features object with previewModernization: { enabled: true } override.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

ready-to-merge

Suggested reviewers

  • jfox-box
  • tjuanitas
  • myu-box

Poem

🐰 A modernized path, so sleek and bold,
Feature flags whisper stories untold,
Styles refined with a dapper touch,
Blueprints bloom—oh, we love it much! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main change: adjusting accordion item styling in the docgen sidebar component. It is concise and specifically relates to the primary purpose of the PR.
Description check ✅ Passed The PR description provides context about design team requirements, before/after visual comparisons, and explanation of the technical changes. However, it uses the template as boilerplate (merge queue instructions) rather than custom substantive content about the actual changes.
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 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

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

Copy link
Copy Markdown
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: 1

🧹 Nitpick comments (1)
src/elements/content-sidebar/DocGenSidebar/DocGenSidebar.scss (1)

52-55: Prefer setting accordion custom properties on the container, not *.

Applying these vars on every descendant is overly broad. Set them on .bcs-DocGen-collapsible so they still inherit where needed with lower selector cost and less override risk.

Suggested refactor
 .bcs-DocGen-collapsible {
     min-width: 0;
     border: none;
     width: 100%;
-
-    * {
-        --accordion-fixed-content-padding-block: 16px;
-        --accordion-fixed-content-padding-inline: 16px;
-    }
+    --accordion-fixed-content-padding-block: 16px;
+    --accordion-fixed-content-padding-inline: 16px;
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/elements/content-sidebar/DocGenSidebar/DocGenSidebar.scss` around lines
52 - 55, Move the CSS custom property declarations off the universal selector
and onto the component container selector to avoid over-broad application:
instead of defining --accordion-fixed-content-padding-block and
--accordion-fixed-content-padding-inline on *, set them on
.bcs-DocGen-collapsible so descendant accordion parts still inherit the values
with lower specificity and less risk of accidental overrides.
🤖 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/elements/content-sidebar/DocGenSidebar/TagTree.tsx`:
- Around line 39-42: In the TagTree component (TagTree.tsx) remove interactive
semantics from the fixed leaf label by deleting tabIndex={0}, role="button", and
aria-disabled="true" on that JSX element (the leaf tag label) so it renders as
plain text; if needed, replace with a non-interactive semantic like a span with
role="text" or no role at all and ensure any event handlers/keyboard handlers
tied to that element are also removed or moved to an actual interactive control.

---

Nitpick comments:
In `@src/elements/content-sidebar/DocGenSidebar/DocGenSidebar.scss`:
- Around line 52-55: Move the CSS custom property declarations off the universal
selector and onto the component container selector to avoid over-broad
application: instead of defining --accordion-fixed-content-padding-block and
--accordion-fixed-content-padding-inline on *, set them on
.bcs-DocGen-collapsible so descendant accordion parts still inherit the values
with lower specificity and less risk of accidental overrides.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a4a83c13-0633-4b52-b490-6a8ac9860a34

📥 Commits

Reviewing files that changed from the base of the PR and between b455cdf and 44fe866.

📒 Files selected for processing (3)
  • src/elements/content-sidebar/DocGenSidebar/DocGenSidebar.scss
  • src/elements/content-sidebar/DocGenSidebar/TagTree.tsx
  • src/elements/content-sidebar/DocGenSidebar/stories/DocGenSidebar.stories.tsx

Comment on lines +39 to +42
tabIndex={0}
role="button"
aria-disabled="true"
>
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.

⚠️ Potential issue | 🟡 Minor

Remove interactive semantics from non-interactive tag labels.

This creates a focusable, disabled pseudo-button with no action. Use plain text semantics for the fixed leaf label to avoid confusing keyboard/screen-reader navigation.

Suggested fix
                                 <span
                                     className={classNames('bcs-DocGen-tagPath', {
                                         'bcs-DocGen-tagPath--modernized': isPreviewModernizationEnabled,
                                     })}
-                                    tabIndex={0}
-                                    role="button"
-                                    aria-disabled="true"
                                 >
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tabIndex={0}
role="button"
aria-disabled="true"
>
<span
className={classNames('bcs-DocGen-tagPath', {
'bcs-DocGen-tagPath--modernized': isPreviewModernizationEnabled,
})}
>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/elements/content-sidebar/DocGenSidebar/TagTree.tsx` around lines 39 - 42,
In the TagTree component (TagTree.tsx) remove interactive semantics from the
fixed leaf label by deleting tabIndex={0}, role="button", and
aria-disabled="true" on that JSX element (the leaf tag label) so it renders as
plain text; if needed, replace with a non-interactive semantic like a span with
role="text" or no role at all and ensure any event handlers/keyboard handlers
tied to that element are also removed or moved to an actual interactive control.

Copy link
Copy Markdown
Contributor

@myu-box myu-box left a comment

Choose a reason for hiding this comment

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

LGTM. verified the style

Image

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