diskfile_tabs.svelte.ts view source
Manages tabs for diskfiles in the editor with preview behavior.
inheritance
Cell<typeof DiskfileTabsJson>
selected_tab_id
type Uuid | null
preview_tab_id
type Uuid | null
tab_order
type Array<Uuid>
recent_tab_ids
type Array<Uuid>
max_tab_history
type number
items
type IndexedCollection<DiskfileTab>
by_diskfile_id
Map for looking up tabs by their associated diskfile_id.
type Map<Uuid, DiskfileTab>
ordered_tabs
Ordered array of tabs derived directly from tab_order. Includes tabs in the explicit order plus any tabs not yet in the order.
type Array<DiskfileTab>
selected_tab
The currently selected tab.
type DiskfileTab | undefined
selected_diskfile_id
The selected tab's diskfile id.
type Uuid | null
preview_tab
The preview tab, if any.
type DiskfileTab | undefined
recent_tabs
type Array<DiskfileTab>
recently_closed_tabs
Recently closed tabs for potential reopening.
type Array<DiskfileTab>
closed_tab_diskfiles
Map of closed tab ids to their diskfile ids - used for browser navigation.
type SvelteMap<Uuid, Uuid>
constructor
type new (options: DiskfileTabsOptions): DiskfileTabs
options
find_most_recent_tab
Returns the most recently accessed tab id that still exists, excluding the specified tab id.
type (exclude_id: string & $brand<"Uuid">): (string & $brand<"Uuid">) | null
exclude_id
string & $brand<"Uuid">(string & $brand<"Uuid">) | nullselect_tab
Sets the selected tab.
type (tab_id: string & $brand<"Uuid">): void
tab_id
string & $brand<"Uuid">voidpreview_diskfile
Handles preview state when opening a file. If a preview tab for this file already exists, it just selects it.
type (diskfile_id: string & $brand<"Uuid">): DiskfileTab
diskfile_id
string & $brand<"Uuid">open_diskfile
Opens a diskfile as a permanent tab (not preview). If the file is already in a preview tab, promotes it to permanent.
type (diskfile_id: string & $brand<"Uuid">): DiskfileTab
diskfile_id
string & $brand<"Uuid">promote_preview_to_permanent
Promotes the current preview tab to a permanent tab.
type (): boolean
booleantrue if a tab was promoted, false otherwise
close_tab
Closes a tab by id.
type (tab_id: string & $brand<"Uuid">): void
tab_id
string & $brand<"Uuid">voidnavigate_to_tab
Navigates to a tab by id. If the tab doesn't exist but was previously closed, creates a preview tab for that diskfile.
type (tab_id: string & $brand<"Uuid">): { resulting_tab_id: (string & $brand<"Uuid">) | null; created_preview: boolean; }
tab_id
The tab id to navigate to
string & $brand<"Uuid">{ resulting_tab_id: (string & $brand<"Uuid">) | null; created_preview: boolean; }Object containing the resulting tab id and a boolean indicating if a new tab was created
open_tab
Opens (makes permanent) a tab by id.
type (tab_id: string & $brand<"Uuid">): void
tab_id
string & $brand<"Uuid">voidreorder_tabs
Reorders tabs by dragging.
type (from_index: number, to_index: number): void
from_index
numberto_index
numbervoidreopen_last_closed_tab
Reopens the last closed tab.
type (): void
voidclose_all_tabs
Closes all tabs.
type (): void
void