@@ -26,14 +26,14 @@ import { EMPTY_PANEL } from "./types.ts";
2626export function remove_child ( panel : Layout , child : string ) : Layout {
2727 // If this is a child panel, handle tab removal
2828 if ( panel . type === "child-panel" ) {
29- if ( panel . child . includes ( child ) ) {
30- const newChild = panel . child . filter ( ( c ) => c !== child ) ;
29+ if ( panel . tabs . includes ( child ) ) {
30+ const newChild = panel . tabs . filter ( ( c ) => c !== child ) ;
3131 if ( newChild . length === 0 ) {
3232 return structuredClone ( EMPTY_PANEL ) ;
3333 }
3434 return {
3535 type : "child-panel" ,
36- child : newChild ,
36+ tabs : newChild ,
3737 } ;
3838 }
3939
@@ -46,15 +46,15 @@ export function remove_child(panel: Layout, child: string): Layout {
4646 // Try to remove the child from this split panel's children
4747 const index = result . children . findIndex ( ( p ) => {
4848 if ( p . type === "child-panel" ) {
49- return p . child . includes ( child ) ;
49+ return p . tabs . includes ( child ) ;
5050 }
5151
5252 return false ;
5353 } ) ;
5454
5555 if ( index !== - 1 ) {
5656 const tab_layout = result . children [ index ] as TabLayout ;
57- if ( tab_layout . child . length === 1 ) {
57+ if ( tab_layout . tabs . length === 1 ) {
5858 // Found the child at this level - remove it
5959 const newChildren = result . children . filter ( ( _ , i ) => i !== index ) ;
6060 const newSizes = remove_and_redistribute ( result . sizes , index ) ;
@@ -67,10 +67,10 @@ export function remove_child(panel: Layout, child: string): Layout {
6767 result . children = newChildren ;
6868 result . sizes = newSizes ;
6969 } else {
70- tab_layout . child . splice ( tab_layout . child . indexOf ( child ) , 1 ) ;
70+ tab_layout . tabs . splice ( tab_layout . tabs . indexOf ( child ) , 1 ) ;
7171 if (
7272 tab_layout . selected &&
73- tab_layout . selected >= tab_layout . child . length
73+ tab_layout . selected >= tab_layout . tabs . length
7474 ) {
7575 tab_layout . selected -- ;
7676 }
0 commit comments