Skip to content

Conversation

@georgylobko
Copy link
Member

Description

Introduced a new api method to replace a standard exit expanded mode button for the AI panel

registerLeftDrawer({
  ...,
  exitExpandedModeTrigger: {
    customIcon: `
      <svg width="94" height="24" viewBox="0 0 94 24" fill="none" focusable="false" aria-hidden="true">
        <rect width="94" height="24" rx="4" fill="url(#paint0_linear_145_32649)"/>
      </svg>
    `,
  },
});

Related links, issue #, if available: n/a

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.16%. Comparing base (e06d3c4) to head (a9c8473).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3940   +/-   ##
=======================================
  Coverage   97.16%   97.16%           
=======================================
  Files         854      854           
  Lines       24969    24978    +9     
  Branches     8794     8799    +5     
=======================================
+ Hits        24260    24271   +11     
+ Misses        702      701    -1     
+ Partials        7        6    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines 167 to 168
// eslint-disable-next-line react/no-danger
<span style={{ lineHeight: 0 }} dangerouslySetInnerHTML={{ __html: exitExpandedModeTrigger.customIcon }} />
Copy link
Member

Choose a reason for hiding this comment

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

To reuse number of no-danger exceptions, can we create a reusable utility customTriggerIcon and reuse it for both triggers?

Even if it is one line, at least it confines the eslint exception in one place

activeAiDrawer:
| (InternalDrawer & {
exitExpandedModeTrigger?: {
customIcon?: React.ReactNode;
Copy link
Member

Choose a reason for hiding this comment

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

Why is this ReactNode? We do not use it on the other triggers because it does not work in micro-frontends, so we also don't do it here

Copy link
Member Author

Choose a reason for hiding this comment

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

This customIcon type is what we get after processing the runtime data. The actual plugin api only works with strings

Copy link
Member

Choose a reason for hiding this comment

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

OK I see, there is a string in src/internal/plugins/widget/interfaces.ts update

@georgylobko georgylobko force-pushed the chore/ai-panel-custom-exit-expanded-mode-button branch from 8c4bb62 to a9c8473 Compare October 17, 2025 09:52
@georgylobko georgylobko added this pull request to the merge queue Oct 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 17, 2025
@georgylobko georgylobko added this pull request to the merge queue Oct 17, 2025
Merged via the queue into main with commit cde680f Oct 17, 2025
48 checks passed
@georgylobko georgylobko deleted the chore/ai-panel-custom-exit-expanded-mode-button branch October 17, 2025 10:50
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