Skip to content

Commit c83f657

Browse files
kubeclaude
andauthored
FE-512: Create FilterableListSubView with keyboard navigation and search (#8532)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 276f316 commit c83f657

36 files changed

Lines changed: 1986 additions & 687 deletions

File tree

libs/@hashintel/petrinaut/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"@xyflow/react": "12.10.1",
4545
"d3-scale": "4.0.2",
4646
"elkjs": "0.11.0",
47+
"fuzzysort": "3.1.0",
4748
"monaco-editor": "0.55.1",
4849
"react-icons": "5.5.0",
4950
"react-resizable-panels": "4.6.5",

libs/@hashintel/petrinaut/src/components/menu.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,20 @@ const itemStyle = cva({
9595
color: "neutral.s120",
9696
cursor: "pointer",
9797
_hover: {
98-
backgroundColor: "neutral.s10",
98+
backgroundColor: "neutral.s25",
99+
},
100+
_highlighted: {
101+
backgroundColor: "neutral.bg.subtle.hover",
99102
},
100103
_disabled: {
101104
opacity: "[0.4]",
102105
cursor: "not-allowed",
103106
_hover: {
104107
backgroundColor: "[transparent]",
105108
},
109+
_highlighted: {
110+
backgroundColor: "[transparent]",
111+
},
106112
},
107113
},
108114
variants: {
@@ -117,7 +123,7 @@ const itemStyle = cva({
117123
},
118124
destructive: {
119125
true: {
120-
color: "red.s60",
126+
color: "red.s100",
121127
},
122128
},
123129
},
@@ -172,7 +178,10 @@ const triggerItemStyle = css({
172178
cursor: "pointer",
173179
justifyContent: "space-between",
174180
_hover: {
175-
backgroundColor: "neutral.s10",
181+
backgroundColor: "neutral.s25",
182+
},
183+
_highlighted: {
184+
backgroundColor: "neutral.bg.subtle.hover",
176185
},
177186
});
178187

libs/@hashintel/petrinaut/src/components/section.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ const sectionListStyle = css({
1515
flex: "[1]",
1616
minHeight: "[0]",
1717
"& > *:not(:last-child)": {
18-
borderBottom: "[1px solid rgba(0, 0, 0, 0.06)]",
18+
borderBottomWidth: "[1px]",
19+
borderBottomStyle: "solid",
20+
borderBottomColor: "neutral.a20",
1921
},
2022
});
2123

libs/@hashintel/petrinaut/src/components/sub-view/types.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ export interface SubView {
2626
title: string;
2727
/** Optional tooltip shown when hovering over the title/tab */
2828
tooltip?: string;
29+
/** Optional icon component displayed before the title in the header. Size is controlled by the container. */
30+
icon?: ComponentType<{ size: number }>;
2931
/** The component to render for this subview */
3032
component: ComponentType;
3133
/**
@@ -38,18 +40,18 @@ export interface SubView {
3840
* Only affects vertical layout. Defaults to false.
3941
*/
4042
flexGrow?: boolean;
41-
/**
42-
* Minimum height for this section in the proportional layout (in pixels).
43-
* Defaults to 100px.
44-
*/
45-
minHeight?: number;
4643
/**
4744
* Whether this is the main (primary) subview.
4845
* When true, shows a non-collapsible header with a larger title style.
4946
* The title and `renderHeaderAction` are displayed in the fixed header,
5047
* and the content should not include its own title/actions.
5148
*/
5249
main?: boolean;
50+
/**
51+
* Optional custom render for the title area of a main subview header.
52+
* When provided, replaces the static title text. Only used when `main` is true.
53+
*/
54+
renderTitle?: () => ReactNode;
5355
/**
5456
* Whether the section can be collapsed by clicking the header.
5557
* Defaults to true. Forced to false when `main` is true.
@@ -60,6 +62,11 @@ export interface SubView {
6062
* Defaults to false (expanded). Ignored when `main` is true.
6163
*/
6264
defaultCollapsed?: boolean;
65+
/**
66+
* When true, the header action is always visible instead of only on hover/focus.
67+
* Defaults to false.
68+
*/
69+
alwaysShowHeaderAction?: boolean;
6370
/**
6471
* Configuration for making the subview resizable when expanded.
6572
* Only affects vertical layout. When set, the section can be resized by dragging its bottom edge.

0 commit comments

Comments
 (0)