mirror of
https://github.com/stablyai/orca
synced 2026-04-21 14:17:16 +00:00
fix: prevent title bar flickering with multiple split-pane agents (#701)
This commit is contained in:
parent
c2d312888e
commit
e17d917afe
2 changed files with 30 additions and 2 deletions
|
|
@ -98,7 +98,14 @@ export function connectPanePty(
|
|||
const onTitleChange = (title: string, rawTitle: string): void => {
|
||||
manager.setPaneGpuRendering(pane.id, !isGeminiTerminalTitle(rawTitle))
|
||||
deps.setRuntimePaneTitle(deps.tabId, pane.id, title)
|
||||
deps.updateTabTitle(deps.tabId, title)
|
||||
// Why: only the focused pane should drive the tab title — otherwise two
|
||||
// agents in split panes cause rapid title flickering as each emits OSC
|
||||
// sequences. Mirrors Ghostty's approach: only the active split's title
|
||||
// propagates to the tab. When focus changes, onActivePaneChange syncs
|
||||
// the newly active pane's stored title to the tab.
|
||||
if (manager.getActivePane()?.id === pane.id) {
|
||||
deps.updateTabTitle(deps.tabId, title)
|
||||
}
|
||||
|
||||
if (!hasConsideredInitialCacheTimerSeed) {
|
||||
hasConsideredInitialCacheTimerSeed = true
|
||||
|
|
|
|||
|
|
@ -304,13 +304,34 @@ export function useTerminalPaneLifecycle({
|
|||
// Dismiss the rename dialog if it was open for the closed pane,
|
||||
// otherwise it would submit against a non-existent pane.
|
||||
setRenamingPaneId((prev) => (prev === paneId ? null : prev))
|
||||
// Why: PaneManager.closePane() reassigns activePaneId directly without
|
||||
// calling setActivePane(), so onActivePaneChange does not fire. Sync the
|
||||
// tab title to the survivor's stored title here so the tab label doesn't
|
||||
// stay stuck on the closed pane's last title.
|
||||
const newActivePane = managerRef.current?.getActivePane()
|
||||
if (newActivePane) {
|
||||
const paneTitles = useAppStore.getState().runtimePaneTitlesByTabId[tabId] ?? {}
|
||||
const activeTitle = paneTitles[newActivePane.id]
|
||||
if (activeTitle) {
|
||||
updateTabTitle(tabId, activeTitle)
|
||||
}
|
||||
}
|
||||
scheduleRuntimeGraphSync()
|
||||
},
|
||||
onActivePaneChange: () => {
|
||||
onActivePaneChange: (pane) => {
|
||||
scheduleRuntimeGraphSync()
|
||||
if (shouldPersistLayout) {
|
||||
persistLayoutSnapshot()
|
||||
}
|
||||
// Why: when the user switches focus between split panes, update the
|
||||
// tab title to the newly active pane's last-known title so the tab
|
||||
// label reflects the focused agent — not a stale title from the
|
||||
// previously focused pane.
|
||||
const paneTitles = useAppStore.getState().runtimePaneTitlesByTabId[tabId] ?? {}
|
||||
const paneTitle = paneTitles[pane.id]
|
||||
if (paneTitle) {
|
||||
updateTabTitle(tabId, paneTitle)
|
||||
}
|
||||
},
|
||||
onLayoutChanged: () => {
|
||||
scheduleRuntimeGraphSync()
|
||||
|
|
|
|||
Loading…
Reference in a new issue