Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@red-hat-developer-hub/backstage-plugin-intelligent-assistant': patch
---

Restore missing visual separators in the notebook file attachments sidebar (RHDHBUGS-3511). Adds a horizontal divider between the notebook title and documents sections, a visible border on the drawer resize splitter, and a CSS fallback color when PatternFly theme variables are unavailable.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,26 @@ describe('DocumentSidebar', () => {
expect(screen.getByText('Test Notebook')).toBeInTheDocument();
});

it('should render a separator between the title and documents sections', () => {
render(<DocumentSidebar {...defaultProps} />);
const separator = screen.getByRole('separator');
expect(separator).toBeInTheDocument();
expect(separator.className).toMatch(/sectionDivider/);
expect(
Array.from(document.styleSheets).some(sheet => {
try {
return Array.from(sheet.cssRules).some(rule =>
rule.cssText.includes(
'--pf-t--global--border--color--default, #c7c7c7',
),
);
} catch {
return false;
}
}),
).toBe(true);
});

it('should render nothing when collapsed', () => {
const { container } = render(
<DocumentSidebar {...defaultProps} collapsed />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,15 @@
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
marginBottom: theme.spacing(2),
gap: theme.spacing(1),
},
sectionDivider: {
borderTop: '1px solid var(--pf-t--global--border--color--default, #c7c7c7)',
marginTop: theme.spacing(2),
marginBottom: theme.spacing(2),
marginLeft: -theme.spacing(2),
marginRight: -theme.spacing(2),
},
title: {
fontWeight: 500,
fontSize: '1.25rem',
Expand Down Expand Up @@ -178,6 +184,12 @@
</Tooltip>
</div>

<div
className={classes.sectionDivider}
role="separator"
aria-orientation="horizontal"
/>

Check warning on line 191 in workspaces/intelligent-assistant/plugins/intelligent-assistant/src/components/notebooks/DocumentSidebar.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use <hr> instead of the "separator" role to ensure accessibility across all devices.

See more on https://sonarcloud.io/project/issues?id=redhat-developer_rhdh-plugins&issues=AZ-6gcoVd5yvFw-g0Rog&open=AZ-6gcoVd5yvFw-g0Rog&pullRequest=4135

<div className={classes.documentsRow}>
<Typography className={classes.documentCount}>
{t('notebook.view.documents.count', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const useStyles = makeStyles(theme => ({
'& .pf-v6-c-drawer__splitter, & .pf-v5-c-drawer__splitter': {
backgroundColor:
'var(--pf-t--global--background--color--floating--default)',
borderRight: '1px solid var(--pf-t--global--border--color--default)',
},
},
expandStrip: {
Expand Down
Loading