From 8c0535539e747f4ed9d5bd639582f93b1e80f111 Mon Sep 17 00:00:00 2001 From: William Laverty Date: Wed, 4 Feb 2026 01:07:55 -0800 Subject: [PATCH 1/2] Fix: Status bar not updating when workspace first opens (#1729) The status bar's Line/Col information wasn't appearing until the first tab switch because tabBarTabIdSubject (a PassthroughSubject) only emitted values when selectedTab CHANGED, not its initial value. Fixed by: 1. Sending the current selectedTab value immediately in switchToActiveEditor() 2. Using dropFirst() on the publisher subscription to avoid duplicate emissions This ensures subscribers like StatusBarCursorPositionLabel receive the initial tab state when the workspace loads. Fixes #1729 --- CodeEdit/Features/Editor/Models/EditorManager.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CodeEdit/Features/Editor/Models/EditorManager.swift b/CodeEdit/Features/Editor/Models/EditorManager.swift index 4e8eae3493..72b5441d2f 100644 --- a/CodeEdit/Features/Editor/Models/EditorManager.swift +++ b/CodeEdit/Features/Editor/Models/EditorManager.swift @@ -101,7 +101,12 @@ class EditorManager: ObservableObject { func switchToActiveEditor() { cancellable?.cancel() cancellable = nil + + // Send the current value immediately so subscribers get the initial state + tabBarTabIdSubject.send(activeEditor.selectedTab) + cancellable = activeEditor.$selectedTab + .dropFirst() // Avoid duplicate emission since we just sent the current value .sink { [weak self] tab in self?.tabBarTabIdSubject.send(tab) } From a60d4e2665b7078aebb3bf4b86528d94d17cdb20 Mon Sep 17 00:00:00 2001 From: William Laverty Date: Wed, 4 Feb 2026 01:09:29 -0800 Subject: [PATCH 2/2] Auto-select name for editing when creating new files/folders (#2029) When creating a new file or folder in the project navigator, the name field should automatically be selected for editing, matching standard macOS UX expectations and Finder behavior. The newFileFromClipboard() function already had this behavior by calling renameFile() at the end. Applied the same pattern to newFile() and newFolder(). Fixes #2029 --- .../OutlineView/ProjectNavigatorMenuActions.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorMenuActions.swift b/CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorMenuActions.swift index 1aa65af926..b9d4e18201 100644 --- a/CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorMenuActions.swift +++ b/CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorMenuActions.swift @@ -90,6 +90,7 @@ extension ProjectNavigatorMenu { if let newFile = try workspace?.workspaceFileManager?.addFile(fileName: "untitled", toFile: item) { workspace?.listenerModel.highlightedFileItem = newFile workspace?.editorManager?.openTab(item: newFile) + renameFile() } } catch { let alert = NSAlert(error: error) @@ -147,6 +148,7 @@ extension ProjectNavigatorMenu { do { if let newFolder = try workspace?.workspaceFileManager?.addFolder(folderName: "untitled", toFile: item) { workspace?.listenerModel.highlightedFileItem = newFolder + renameFile() } } catch { let alert = NSAlert(error: error)