diff --git a/CHANGELOG.md b/CHANGELOG.md index c17614e6c..fb7e0f81f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ ### Changed +- Open new tabs on Recent Files so users can choose a document before creating a blank canvas. - Pan horizontally with Shift+wheel while preserving native horizontal trackpad movement. - Move MCP connections into their own Settings destination instead of presenting them as part of model configuration. diff --git a/src/app/tabs/index.ts b/src/app/tabs/index.ts index b66b3f30d..2122aea04 100644 --- a/src/app/tabs/index.ts +++ b/src/app/tabs/index.ts @@ -45,6 +45,7 @@ export const allTabs = computed(() => tabsRef.value.map((t) => ({ id: t.id, name: t.store.state.documentName, + isHome: t.showHome, isActive: t.id === activeTabId.value })) ) @@ -81,8 +82,9 @@ export function createTab(store?: EditorStore, initialGraph?: SceneGraph, showHo export function leaveHome(tabId: string): void { const tabIndex = tabsRef.value.findIndex((candidate) => candidate.id === tabId) + if (tabIndex === -1) return const tab = tabsRef.value[tabIndex] - if (!tab?.showHome) return + if (!tab.showHome) return tabsRef.value = tabsRef.value.with(tabIndex, { ...tab, showHome: false }) } diff --git a/src/components/TabBar.vue b/src/components/TabBar.vue index b66020998..bea5b7a64 100644 --- a/src/components/TabBar.vue +++ b/src/components/TabBar.vue @@ -19,6 +19,10 @@ const modelValue = computed({ set: (id: string) => switchTab(id) }) +function openRecentFilesTab() { + createTab(undefined, undefined, true) +} + function onMiddleClick(e: MouseEvent, tabId: string) { if (e.button === 1) { e.preventDefault() @@ -34,7 +38,7 @@ function onClose(e: MouseEvent, tabId: string) {