@@ -1081,13 +1081,14 @@ function pickInitiallySelectedTable(
1081
1081
function TablePickerPane ( props : {
1082
1082
horizontal : boolean ;
1083
1083
tablesAndViews : ( Table | View ) [ ] ;
1084
+ allTables : Table [ ] ;
1084
1085
selectedTableName : Signal < string | undefined > ;
1085
1086
schemaRefetch : ( ) => Promise < void > ;
1086
1087
} ) {
1087
1088
const tablesAndViews = createMemo ( ( ) =>
1088
1089
props . tablesAndViews . toSorted ( ( a , b ) => {
1089
- const aHidden = a . name . startsWith ( "_" ) ;
1090
- const bHidden = b . name . startsWith ( "_" ) ;
1090
+ const aHidden = hiddenTable ( a ) ;
1091
+ const bHidden = hiddenTable ( b ) ;
1091
1092
1092
1093
if ( aHidden == bHidden ) {
1093
1094
return a . name . localeCompare ( b . name ) ;
@@ -1096,10 +1097,6 @@ function TablePickerPane(props: {
1096
1097
return aHidden ? 1 : - 1 ;
1097
1098
} ) ,
1098
1099
) ;
1099
- const tables = ( ) =>
1100
- tablesAndViews ( ) . filter (
1101
- ( either ) => ( either as Table ) !== undefined ,
1102
- ) as Table [ ] ;
1103
1100
1104
1101
const showHidden = useStore ( $showHiddenTables ) ;
1105
1102
@@ -1169,7 +1166,7 @@ function TablePickerPane(props: {
1169
1166
< SheetContent class = { sheetMaxWidth } >
1170
1167
< CreateAlterTableForm
1171
1168
schemaRefetch = { props . schemaRefetch }
1172
- allTables = { tables ( ) }
1169
+ allTables = { props . allTables }
1173
1170
setSelected = { setSelectedTableName }
1174
1171
{ ...sheet }
1175
1172
/>
@@ -1219,11 +1216,11 @@ function TableSplitView(props: {
1219
1216
) : ( Table | View ) [ ] {
1220
1217
return schemas . filter ( ( s ) => showHidden || ! s . name . startsWith ( "_" ) ) ;
1221
1218
}
1222
- const tablesAndViews = ( ) =>
1223
- filterHidden (
1224
- [ ...props . schemas . tables , ... props . schemas . views ] ,
1225
- showHidden ( ) ,
1226
- ) ;
1219
+ const allTablesAndViews = ( ) => [
1220
+ ... props . schemas . tables ,
1221
+ ...props . schemas . views ,
1222
+ ] ;
1223
+ const tablesAndViews = ( ) => filterHidden ( allTablesAndViews ( ) , showHidden ( ) ) ;
1227
1224
1228
1225
const [ searchParams ] = useSearchParams < { table : string } > ( ) ;
1229
1226
const selectedTableNameSignal = createSignal < string | undefined > (
@@ -1245,6 +1242,7 @@ function TableSplitView(props: {
1245
1242
< TablePickerPane
1246
1243
horizontal = { p . horizontal }
1247
1244
tablesAndViews = { tablesAndViews ( ) }
1245
+ allTables = { props . schemas . tables }
1248
1246
selectedTableName = { selectedTableNameSignal }
1249
1247
schemaRefetch = { props . schemaRefetch }
1250
1248
/>
0 commit comments