@principal-ai/subsystems-react 0.56.4 → 0.56.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/subsystem/SubsystemComponentGraph.js +1 -1
- package/package.json +1 -1
- package/src/stories/Canvases/C4/C4ToComponentDrill.stories.tsx +1 -1
- package/src/subsystem/GraphSidebar.test.tsx +2 -2
- package/src/subsystem/SubsystemComponentGraph.sidebar.test.tsx +8 -0
- package/src/subsystem/SubsystemComponentGraph.tsx +1 -1
|
@@ -2091,7 +2091,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
|
|
|
2091
2091
|
fontSize: theme.fontSizes[0],
|
|
2092
2092
|
color: theme.colors.textMuted ?? theme.colors.textSecondary,
|
|
2093
2093
|
}, children: fileOverlay.file }), _jsx(FileOverlayCloseButton, { onClose: closeFileOverlay })] }), _jsx("div", { style: { flex: 1, minHeight: 0, overflow: 'auto' }, children: _jsx(FileDrawerContent, { render: renderDrawerContent, file: fileOverlay.file, startLine: fileOverlay.startLine, endLine: fileOverlay.endLine, fullFile: true }) })] }));
|
|
2094
|
-
return (_jsx(GraphWithSidebar, { hidden: !sidebarVisible, bodyHidden: !sidebarBodyVisible, headerMaxHeight: sidebarBodyVisible ? '
|
|
2094
|
+
return (_jsx(GraphWithSidebar, { hidden: !sidebarVisible, bodyHidden: !sidebarBodyVisible, headerMaxHeight: sidebarBodyVisible ? '30%' : '100%', header: sidebarHeader, tabs: sidebarTabs, activeTab: diagnosticsTab, onTabChange: (id) => setDiagnosticsTab(id), sidebarBody: sidebarBody, tabListLabel: issuesActive ? 'Diagnostics view' : 'Sidebar view', defaultWidth: persisted.sidebarWidth ?? 450, minWidth: 240, maxWidth: sidebarMaxWidth, persistKey: persistKey, onResizeEnd: () => requestAnimationFrame(() => fitView()), children: _jsxs("div", { style: { flex: 1, position: 'relative', display: 'flex', flexDirection: committedDirection === 'vertical' ? 'row' : 'column', minHeight: 0, minWidth: 0 }, children: [_jsxs("div", { className: layoutFlipping ? LAYOUT_FLIP_CLASS : undefined, style: {
|
|
2095
2095
|
position: 'relative',
|
|
2096
2096
|
flex: collapseCanvas ? 0 : 1,
|
|
2097
2097
|
minHeight: 0,
|
package/package.json
CHANGED
|
@@ -98,7 +98,7 @@ describe('GraphSidebar chrome', () => {
|
|
|
98
98
|
test('a capped header fits its content while the body fills the remaining space', () => {
|
|
99
99
|
const { container } = renderSidebar({
|
|
100
100
|
header: createElement('span', null, 'description'),
|
|
101
|
-
headerMaxHeight: '
|
|
101
|
+
headerMaxHeight: '30%',
|
|
102
102
|
sidebarBody: createElement('span', null, 'trails'),
|
|
103
103
|
});
|
|
104
104
|
const column = sidebarColumn(container);
|
|
@@ -106,7 +106,7 @@ describe('GraphSidebar chrome', () => {
|
|
|
106
106
|
const body = column.lastElementChild as HTMLElement;
|
|
107
107
|
expect(header.style.flexGrow).toBe('0');
|
|
108
108
|
expect(header.style.flexBasis).toBe('auto');
|
|
109
|
-
expect(header.style.maxHeight).toBe('
|
|
109
|
+
expect(header.style.maxHeight).toBe('30%');
|
|
110
110
|
expect(header.style.boxSizing).toBe('border-box');
|
|
111
111
|
expect(header.style.overflowY).toBe('auto');
|
|
112
112
|
expect(body.style.flexGrow).toBe('1');
|
|
@@ -50,6 +50,14 @@ describe('subsystem graph sidebar', () => {
|
|
|
50
50
|
expect(content?.textContent).not.toContain('Request subsystem');
|
|
51
51
|
});
|
|
52
52
|
|
|
53
|
+
test('caps the scrollable description at 30% above the trails', () => {
|
|
54
|
+
const body = renderGraph();
|
|
55
|
+
const description = body.querySelector('[style*="max-height:30%"]') as HTMLElement;
|
|
56
|
+
expect(description).not.toBeNull();
|
|
57
|
+
expect(description.textContent).toContain('Always visible description.');
|
|
58
|
+
expect(description.style.overflowY).toBe('auto');
|
|
59
|
+
});
|
|
60
|
+
|
|
53
61
|
test('keeps the Files button in the header when no name is provided', () => {
|
|
54
62
|
const body = renderGraph({ title: undefined });
|
|
55
63
|
expect(body.querySelector('header h2')).toBeNull();
|
|
@@ -2848,7 +2848,7 @@ function Inner({ components, trails, graphifyRelations, orderByLine, layoutDirec
|
|
|
2848
2848
|
<GraphWithSidebar
|
|
2849
2849
|
hidden={!sidebarVisible}
|
|
2850
2850
|
bodyHidden={!sidebarBodyVisible}
|
|
2851
|
-
headerMaxHeight={sidebarBodyVisible ? '
|
|
2851
|
+
headerMaxHeight={sidebarBodyVisible ? '30%' : '100%'}
|
|
2852
2852
|
header={sidebarHeader}
|
|
2853
2853
|
tabs={sidebarTabs}
|
|
2854
2854
|
activeTab={diagnosticsTab}
|