Skip to content

Commit 2eabfc8

Browse files
Copilothotlong
andcommitted
fix: address code review - type-safe visible prop, unique filter IDs
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent c5779fc commit 2eabfc8

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/plugin-list/src/ListView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export const ListView: React.FC<ListViewProps> = ({
334334
// Apply tab filter if defined
335335
if (tab.filter) {
336336
const tabFilters: FilterGroup = {
337-
id: 'tab-filter',
337+
id: `tab-filter-${tab.name}`,
338338
logic: tab.filter.logic || 'and',
339339
conditions: tab.filter.conditions || [],
340340
};

packages/plugin-list/src/components/TabBar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface ViewTab {
1919
order?: number;
2020
pinned?: boolean;
2121
isDefault?: boolean;
22-
visible?: string;
22+
visible?: string | boolean;
2323
}
2424

2525
export interface TabBarProps {
@@ -48,7 +48,7 @@ function resolveIcon(iconName?: string): LucideIcon | null {
4848
*/
4949
function getVisibleTabs(tabs: ViewTab[]): ViewTab[] {
5050
return tabs
51-
.filter(tab => tab.pinned || (tab.visible !== 'false' && tab.visible !== (false as any)))
51+
.filter(tab => tab.pinned || (tab.visible !== 'false' && tab.visible !== false))
5252
.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
5353
}
5454

0 commit comments

Comments
 (0)