Skip to content

fix(intelligent-assistant): restore IA UI styling for RHDHBUGS-3733 - #4753

Closed
ciiay wants to merge 21 commits into
redhat-developer:mainfrom
ciiay:rhdhbugs-3733-fix-IA-ui
Closed

ciiay wants to merge 21 commits into
redhat-developer:mainfrom
ciiay:rhdhbugs-3733-fix-IA-ui

Conversation

@ciiay

@ciiay ciiay commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Description

After the PatternFly update, global theme styles were overriding Intelligent Assistant-specific layout and control styling. This PR restores intended IA chrome across overlay, docked, and fullscreen modes while preferring PatternFly defaults where custom CSS is no longer needed (message bar controls, table sort indicators, and several footer width hacks were trimmed in follow-up commits).

Fixed

  • RHDHBUGS-3733 — PF update causes style override failures in Intelligent Assistant

Change list

  1. Shared tokens and icon styling — Add chatShellTokens.ts and PlainIconButton.tsx (drawer collapse sizing/icons, chat history drawer close affordance, shared message bar shell CSS); consolidate duplicated shell rules out of LightSpeedChat.tsx where practical.
  2. Chat shell layout — Fix borders/corner clipping; docked mode uses a left border on the chat panel; header divider spacing; hide the PatternFly footer divider above the message input; fullscreen layout when chat history and MCP settings are both open (including welcome prompt grid when applicable).
  3. Message bar — Bordered pill message bar region and footer alignment; simplify MessageBarModelSelector and remove redundant custom CSS for attach/mic/send/stop where PF layout is sufficient.
  4. Chat history UI — Header history toggle (aria.chatHistoryMenu) and drawer panel close (aria.closeDrawerPanel); refresh CollapsedHistoryStrip (expand / quick new chat).
  5. MCP settings table — Use PF Table with sortable headers via @patternfly/react-styles (McpTableSortHeader); row/column alignment and hover edit control; plain icon buttons for panel/table actions; scroll jump buttons when content overflows.
  6. MCP configure modal — Layout and plain close/clear controls; scope modal backdrop z-index with backdropClassName (remove global backdrop GlobalStyles from MCP settings).
  7. PF6 duplicate icons — Apply pf6HideNestedRhUiIconCss on settings shells (MCP / saved prompts) so nested RH UI glyphs do not double-render pencil icons.
  8. Notebooks — Header/sidebar controls, document sidebar collapse, document row alignment (badge, name, kebab), footer parity with chat, and back-to-top / back-to-bottom jump buttons after switching Chat ↔ Notebooks tabs (useChatContentScrollOverflow, chatMessageScrollLayout).
  9. Tests — Update unit tests (MCP settings, chat); e2e locators for MCP modal close and chat history drawer (chatHistoryDrawer.ts uses aria.chatHistoryMenu / aria.closeDrawerPanel, not tooltip-only “Collapse chat history” names).
  10. Release — Patch changeset for @red-hat-developer-hub/backstage-plugin-intelligent-assistant; add @patternfly/react-styles dependency for MCP table sort styling.

Screen recording (after fix)

rhdhbugs_3733.mp4

Test plan

  • Open Intelligent Assistant in overlay, docked, and /intelligent-assistant fullscreen; confirm chat border, header divider spacing, and no stray footer <hr> above the input.
  • Verify message bar layout and model selector row; exercise attach/mic/send in overlay and docked modes.
  • Open MCP settings and configure-server modal; confirm table sort, row alignment, close controls, and modal stacks above the settings drawer in docked mode.
  • Collapse/expand chat history and notebook document sidebar; confirm jump buttons after tab switches.
  • yarn test --watchAll=false in plugins/intelligent-assistant; APP_MODE=legacy yarn test:e2e (or targeted lightspeed.ui.test.ts) in workspaces/intelligent-assistant.

Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

Made with Cursor

@rhdh-gh-app

rhdh-gh-app Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-intelligent-assistant workspaces/intelligent-assistant/plugins/intelligent-assistant patch v5.2.0

@codecov

codecov Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.85294% with 82 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.27%. Comparing base (4c40170) to head (d65ba18).
⚠️ Report is 19 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4753   +/-   ##
=======================================
  Coverage   63.26%   63.27%           
=======================================
  Files        2675     2679    +4     
  Lines      106439   106526   +87     
  Branches    29778    29781    +3     
=======================================
+ Hits        67340    67399   +59     
- Misses      38539    38569   +30     
+ Partials      560      558    -2     
Flag Coverage Δ *Carryforward flag
adoption-insights 84.77% <ø> (ø) Carriedforward from 853ee14
ai-integrations 78.80% <ø> (ø) Carriedforward from 853ee14
app-defaults 54.82% <ø> (ø) Carriedforward from 853ee14
augment 46.67% <ø> (ø) Carriedforward from 853ee14
boost 84.97% <ø> (ø) Carriedforward from 853ee14
bulk-import 73.12% <ø> (ø) Carriedforward from 853ee14
cost-management 13.53% <ø> (ø) Carriedforward from 853ee14
dcm 73.47% <ø> (ø) Carriedforward from 853ee14
e2e-adoption-insights 60.00% <ø> (ø) Carriedforward from 853ee14
e2e-extensions 62.31% <ø> (ø) Carriedforward from 853ee14
e2e-global-header 49.71% <ø> (ø) Carriedforward from 853ee14
e2e-homepage 61.11% <ø> (ø) Carriedforward from 853ee14
e2e-intelligent-assistant 46.30% <ø> (+0.28%) ⬆️ Carriedforward from 853ee14
e2e-orchestrator 49.49% <ø> (ø) Carriedforward from 853ee14
e2e-orchestrator-plugin 49.48% <ø> (ø) Carriedforward from 853ee14
e2e-quickstart 55.21% <ø> (ø) Carriedforward from 853ee14
e2e-scorecard 50.05% <ø> (ø) Carriedforward from 853ee14
e2e-theme 16.36% <ø> (ø) Carriedforward from 853ee14
extensions 58.30% <ø> (ø) Carriedforward from 853ee14
global-floating-action-button 71.18% <ø> (ø) Carriedforward from 853ee14
global-header 67.88% <ø> (ø) Carriedforward from 853ee14
homepage 48.39% <ø> (ø) Carriedforward from 853ee14
install-dynamic-plugins 71.77% <ø> (ø) Carriedforward from 853ee14
intelligent-assistant 77.84% <69.85%> (-0.15%) ⬇️
konflux 91.98% <ø> (ø) Carriedforward from 853ee14
lightspeed 69.02% <ø> (ø) Carriedforward from 853ee14
mcp-integrations 84.46% <ø> (ø) Carriedforward from 853ee14
orchestrator 77.32% <ø> (ø) Carriedforward from 853ee14
quickstart 63.74% <ø> (ø) Carriedforward from 853ee14
sandbox 79.56% <ø> (ø) Carriedforward from 853ee14
scorecard 88.48% <ø> (ø) Carriedforward from 853ee14
theme 87.91% <ø> (ø) Carriedforward from 853ee14
translations 5.12% <ø> (ø) Carriedforward from 853ee14
x2a 78.44% <ø> (ø) Carriedforward from 853ee14

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4c40170...d65ba18. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ciiay
ciiay force-pushed the rhdhbugs-3733-fix-IA-ui branch from 283a98b to 1d6de18 Compare September 15, 2026 12:27
@its-mitesh-kumar

Copy link
Copy Markdown
Member

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:11 AM UTC · Completed 11:16 AM UTC

Commit: c218464 · View workflow run →

Runtime: claude · Model: opus → claude-opus-4-6 · Cost: $1.95

},
'& > .pf-v6-c-divider, & > .pf-v5-c-divider': {
display: 'none',
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we can't avoid these overrides please raise upstream issue and put issue link as comment.

@fullsend-ai-review

Copy link
Copy Markdown

Review — comment

PR: #4753 — fix(intelligent-assistant): restore IA UI styling for RHDHBUGS-3733
Verdict: comment — one medium finding worth noting, none that should block

Summary

This PR restores Intelligent Assistant UI styling after PatternFly theme overrides broke layout across overlay, docked, and fullscreen modes. The change introduces a shared PlainIconButton.tsx module (centralized CSS-in-JS style tokens), extracts the useChatContentScrollOverflow hook and chatMessageScrollLayout components from inline code, refactors MCP settings/modal close placement, updates the drawer collapse aria-label to a more descriptive label, and switches icon usage from PenIcon to PencilAltIcon.

Overall this is a well-structured refactor with consistent styling patterns. Tests (unit and e2e) are updated to match. A patch changeset is correctly included.

Findings

1 · i18n regression — hardcoded "Close" aria-label on MCP modal (medium)

The MCP configure-server modal close button's aria-label changed from the translated t('mcp.settings.closeConfigureModalAriaLabel') to a hardcoded English string "Close":

// McpConfigureServerModal.tsx (new)
<ConfigureModalCloseButton
  className={MCP_CONFIGURE_MODAL_CLOSE_CLASS}
  aria-label="Close"    // was t('mcp.settings.closeConfigureModalAriaLabel')
  icon={<TimesIcon />}
  variant="plain"
  onClick={close}
/>

The translation key mcp.settings.closeConfigureModalAriaLabel has existing translations in German, Italian, Japanese, Spanish, and French. With this change, non-English screen-reader users will hear "Close" instead of their localized string (e.g., "設定モーダルを閉じる" in Japanese).

The corresponding e2e test helper mcpConfigureModalCloseButton also hardcodes name: 'Close' instead of using a translation key, which will fail if e2e tests run in a non-English locale.

Remediation: Use the existing translation key: aria-label={t('mcp.settings.closeConfigureModalAriaLabel')}, and update the e2e helper accordingly.

2 · Commented-out code (low)

In McpServersSettings.tsx, there is a commented-out line in the styled close button CSS:

[`& .${mcpClasses.closeButton}`]: {
    ...compactPlainCircleButtonCss,
    // minWidth: '2.5rem !important',
    width: '2.25rem !important',
    ...

This should be removed to keep the code clean.

Notes

  • The PlainIconButton.tsx module is 525 lines, which is large, but it centralizes PatternFly CSS override tokens that were previously scattered across multiple components. This is a net improvement for maintainability.
  • The useChatContentScrollOverflow hook extraction is a clean 1:1 extraction of the inline useEffect from LightSpeedChat.tsx, with an added enabled guard parameter — a good improvement.
  • The drawer close button aria-label change from t('aria.closeDrawerPanel') to t('tooltip.collapseHistoryPanel') is an improvement — "Collapse chat history" is more descriptive and context-appropriate than "Close drawer panel." Both keys have translations in all supported languages.
  • The chatMessageScrollLayout.ts module cleanly extracts ChatMessageContentShell and ChatMessageScroll styled components, reusing them in both chat and notebook views — good code reuse.
  • The PenIcon to PencilAltIcon switch is intentional and tests are updated.
  • The event.currentTarget.blur() in the MCP edit-server button click handler is a reasonable UX tweak to prevent persistent focus styling after clicking.
  • The fullscreen MCP layout now conditionally renders the settings pane instead of always rendering it, which is correct.
  • The compact MCP layout switches from replacing chat content with FlatSettings to layering with CompactChatLayer / CompactMcpLayer, preserving chat state across MCP panel toggles.
  • No security concerns identified. No injection vectors, RBAC bypasses, or data exposure risks.
  • No cross-repo contract concerns — all changes are scoped to the intelligent-assistant workspace with no public API changes.

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See the review comment for full details.

@fullsend-ai-review fullsend-ai-review Bot added the requires-manual-review Review requires human judgment label Sep 16, 2026

@its-mitesh-kumar its-mitesh-kumar left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can't have so much styles override, override is only accepted for must be fox styles issues. Other styles which is not matching prototype is fine we can raise upstream issues and get it done there. Adding this much styles override will be very hard to maintain.

Comment on lines +274 to +286
border: contentBorder,
borderRadius: 24,
padding: theme.spacing(0.5),
'&::after': {
display: 'none',
},
},
...messageBarActionsAlignCss,
[messageBarAttachMicrophoneSelector]: messageBarAttachMicrophoneButtonCss,
[messageBarMicrophoneActiveSelector]: messageBarMicrophoneActiveButtonCss,
[messageBarSendStopSelector]: {
...messageBarSendStopButtonCss,
borderRadius: 'var(--pf-t--global--border--radius--pill) !important',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we can't avoid these overrides please raise upstream issue and put issue link as comment.

Comment on lines +164 to +222
const chatHistoryDrawerCollapseCloseCss = {
'& .pf-v6-c-drawer__close, & .pf-v5-c-drawer__close': {
marginTop: 0,
marginRight: 0,
},
'& .pf-v6-c-drawer__close .pf-v6-c-button svg, & .pf-v5-c-drawer__close .pf-v5-c-button svg':
{
display: 'none',
},
'& .pf-v6-c-drawer__close .pf-v6-c-button, & .pf-v5-c-drawer__close .pf-v5-c-button':
{
...drawerCollapseButtonSizeCss,
...compactPlainIconButtonRadiusCss,
...plainCircleButtonAfterCss,
position: 'relative',
display: 'inline-flex',
alignItems: 'center',
justifyContent: 'center',
lineHeight: 0,
'--pf-v6-c-button--BorderWidth': '0',
'--pf-v6-c-button--m-plain--BorderWidth': '0',
'--pf-v6-c-button--m-plain--hover--BorderWidth': '0',
'--pf-v6-c-button--BackgroundColor':
'var(--pf-t--global--background--color--action--plain--default)',
'--pf-v6-c-button--hover--BackgroundColor':
'var(--pf-t--global--background--color--action--plain--hover)',
'--pf-v6-c-button--m-plain--BackgroundColor':
'var(--pf-t--global--background--color--action--plain--default)',
'--pf-v6-c-button--m-plain--hover--BackgroundColor':
'var(--pf-t--global--background--color--action--plain--hover)',
'&:hover:not(:disabled), &:focus-visible:not(:disabled)': {
...compactPlainIconButtonRadiusCss,
backgroundColor:
'var(--pf-t--global--background--color--action--plain--hover) !important',
'--pf-v6-c-button--hover--BackgroundColor':
'var(--pf-t--global--background--color--action--plain--hover)',
'--pf-v6-c-button--m-plain--hover--BackgroundColor':
'var(--pf-t--global--background--color--action--plain--hover)',
},
'& .pf-v6-c-button__icon, & .pf-v5-c-button__icon':
drawerCollapseIconSlotCss,
'& .pf-v6-c-button__icon::before, & .pf-v5-c-button__icon::before': {
content: '""',
display: 'block',
width: 24,
height: 24,
flexShrink: 0,
mask: COLLAPSE_PANEL_ICON_SVG,
WebkitMask: COLLAPSE_PANEL_ICON_SVG,
maskSize: 'contain',
WebkitMaskSize: 'contain',
maskRepeat: 'no-repeat',
WebkitMaskRepeat: 'no-repeat',
maskPosition: 'center',
WebkitMaskPosition: 'center',
backgroundColor: 'currentColor',
},
},
} as const;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can't take this much overrides, lets discuss what all styles will break without these overrides.

Comment on lines +273 to +286
'&.pf-chatbot--embedded': {
overflow: 'hidden',
boxShadow: 'none !important',
...(isDockedMode
? {
border: 'none !important',
borderInlineStart: `${contentBorder} !important`,
borderRadius: 0,
}
: {
border: `${contentBorder} !important`,
borderRadius: isCompact
? 'var(--pf-t--global--border--radius--medium)'
: '1rem',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we can't avoid these overrides please raise upstream issue and put issue link as comment.

Comment on lines +298 to +303
'& .pf-chatbot__header .pf-v6-c-menu-toggle.pf-chatbot__button--toggle-options, & .pf-chatbot__header .pf-chatbot__button--toggle-options':
chatHeaderOptionsToggleCss,
'& .pf-chatbot__history': {
...chatHistoryDrawerCollapseCloseCss,
// History drawer wraps main chat too — scope icon toggles to search/sort and row kebabs only.
'& .pf-chatbot__history-search-actions .pf-v6-c-menu-toggle, & .pf-chatbot__history-search-actions .pf-v5-c-menu-toggle, & .pf-chatbot__history-actions .pf-v6-c-menu-toggle, & .pf-chatbot__history-actions .pf-v5-c-menu-toggle, & .pf-chatbot__menu-item .pf-v6-c-menu-toggle, & .pf-chatbot__menu-item .pf-v5-c-menu-toggle':

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we can't avoid these overrides please raise upstream issue and put issue link as comment.

ciiay and others added 7 commits September 16, 2026 09:14
Align chat, dock, MCP, notebooks, and message bar controls with the
intended prototype after MUI migration regressions, using shared plain
icon styling and stable compact MCP/history layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
Center the file type badge, filename, and kebab menu on one row in the
notebook documents sidebar.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ator

Update e2e locators to match the hardcoded aria-label "Close" on the
configure modal close button.

Assisted-by: Auto
Co-authored-by: Cursor <cursoragent@cursor.com>
… tab switch

Share scroll overflow detection and centered jump-button layout between
chat and notebook message views so back-to-top controls stay visible and
aligned when switching tabs.

Fixes: https://redhat.atlassian.net/browse/RHDHBUGS-3733
Signed-off-by: Yi Cai <yicai@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Yi Cai <yicai@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Use translated aria-label in the modal and align unit/e2e locators with the message key.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ciiay
ciiay force-pushed the rhdhbugs-3733-fix-IA-ui branch from c218464 to 9ce40b0 Compare September 16, 2026 13:23
ciiay and others added 4 commits September 16, 2026 10:25
StyledChatbotContent references ChatbotContent; missing import broke the IA app at runtime.

Co-authored-by: Cursor <cursoragent@cursor.com>
Match the chat history nav close button aria-label after rebase onto saved prompts.

Co-authored-by: Cursor <cursoragent@cursor.com>
…aved prompts

Re-merge pre-rebase IA layout (docked borders, history drawer controls,
CompactPlainIconButton header actions, message bar footer chrome) while
keeping SettingsPanel and scroll jump hooks. Omit attach/mic hover
suppression so message bar matches PF chatbot plain icon behavior.

Co-authored-by: Cursor <cursoragent@cursor.com>
…verrides

Replace custom PlainIconButton wrappers with stock PatternFly plain buttons,
keep layout-only message bar and drawer helpers, and fix chat history drawer
close styling (chatbot pill sizing and duplicate icon in fullscreen).

Co-authored-by: Cursor <cursoragent@cursor.com>
ciiay and others added 10 commits September 16, 2026 17:07
…kens

Fix docked MCP server row edit hover, table width alignment, and PF6 pencil rendering; consolidate floating-shell and duplicate-icon CSS into chatShellTokens for easier PR comparison with main.

Co-authored-by: Cursor <cursoragent@cursor.com>
…able props

Use PF plain table mode, cell layout styles, row hover edit, and wrapped
name/status cells while reducing grid and shell padding overrides.

Co-authored-by: Cursor <cursoragent@cursor.com>
Rely on PF compact table row padding, move toggle inset to cell layout
styles, and dedupe sort header button styling.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use PF table button markup for sort headers with SortAmount icons, and
middle-align body cells when name or status text wraps.

Co-authored-by: Cursor <cursoragent@cursor.com>
Add @patternfly/react-styles and load table class maps from the Table
component module so McpTableSortHeader resolves at runtime.

Co-authored-by: Cursor <cursoragent@cursor.com>
Apply pf6HideNestedRhUiIconCss on docked and fullscreen MCP settings
containers so table edit buttons no longer need local overrides.

Co-authored-by: Cursor <cursoragent@cursor.com>
Move backdrop stacking from global selectors in MCP settings to the
configure modal backdropClassName and PF backdrop z-index tokens.

Co-authored-by: Cursor <cursoragent@cursor.com>
Drop custom active/inactive sort icon color classes and use PatternFly
table sort selected state for MCP column headers.

Co-authored-by: Cursor <cursoragent@cursor.com>
Remove unused PlainIconButton message-bar tokens, drop footer-container
width hacks in chat and notebook views, and style the model selector locally.

Co-authored-by: Cursor <cursoragent@cursor.com>
…names

Playwright looked for tooltip collapse labels, but the UI exposes
aria.chatHistoryMenu and aria.closeDrawerPanel. Centralize drawer helpers
so display mode and sidebar tests open and close history reliably.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

Copy link
Copy Markdown

@ciiay

ciiay commented Sep 28, 2026

Copy link
Copy Markdown
Member Author

Closing this in favor of #5003

@ciiay ciiay closed this Sep 28, 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.

2 participants