diff --git a/src/renderer/src/assets/main.css b/src/renderer/src/assets/main.css index 867ed6e958f..61725dc762d 100644 --- a/src/renderer/src/assets/main.css +++ b/src/renderer/src/assets/main.css @@ -166,14 +166,14 @@ --terminal-pane-title-on-dark-fg: rgb(255 255 255 / 0.52); --terminal-pane-title-on-dark-input-fg: rgb(255 255 255 / 0.7); --terminal-pane-title-on-dark-placeholder: rgb(255 255 255 / 0.38); - --terminal-pane-title-on-dark-button-fg: rgb(255 255 255 / 0.3); + --terminal-pane-title-on-dark-button-fg: rgb(255 255 255 / 0.48); --terminal-pane-title-on-dark-button-hover-fg: rgb(255 255 255 / 0.8); --terminal-pane-title-on-dark-input-bg: rgb(255 255 255 / 0.04); --terminal-pane-title-on-dark-separator: rgb(255 255 255 / 0.06); --terminal-pane-title-on-light-fg: rgb(24 24 27 / 0.64); --terminal-pane-title-on-light-input-fg: rgb(24 24 27 / 0.82); --terminal-pane-title-on-light-placeholder: rgb(24 24 27 / 0.48); - --terminal-pane-title-on-light-button-fg: rgb(24 24 27 / 0.42); + --terminal-pane-title-on-light-button-fg: rgb(24 24 27 / 0.58); --terminal-pane-title-on-light-button-hover-fg: rgb(24 24 27 / 0.82); --terminal-pane-title-on-light-input-bg: rgb(24 24 27 / 0.05); --terminal-pane-title-on-light-separator: rgb(24 24 27 / 0.1); @@ -247,14 +247,14 @@ --terminal-pane-title-on-dark-fg: rgb(255 255 255 / 0.52); --terminal-pane-title-on-dark-input-fg: rgb(255 255 255 / 0.7); --terminal-pane-title-on-dark-placeholder: rgb(255 255 255 / 0.38); - --terminal-pane-title-on-dark-button-fg: rgb(255 255 255 / 0.3); + --terminal-pane-title-on-dark-button-fg: rgb(255 255 255 / 0.48); --terminal-pane-title-on-dark-button-hover-fg: rgb(255 255 255 / 0.8); --terminal-pane-title-on-dark-input-bg: rgb(255 255 255 / 0.04); --terminal-pane-title-on-dark-separator: rgb(255 255 255 / 0.06); --terminal-pane-title-on-light-fg: rgb(24 24 27 / 0.64); --terminal-pane-title-on-light-input-fg: rgb(24 24 27 / 0.82); --terminal-pane-title-on-light-placeholder: rgb(24 24 27 / 0.48); - --terminal-pane-title-on-light-button-fg: rgb(24 24 27 / 0.42); + --terminal-pane-title-on-light-button-fg: rgb(24 24 27 / 0.58); --terminal-pane-title-on-light-button-hover-fg: rgb(24 24 27 / 0.82); --terminal-pane-title-on-light-input-bg: rgb(24 24 27 / 0.05); --terminal-pane-title-on-light-separator: rgb(24 24 27 / 0.1); diff --git a/src/renderer/src/assets/terminal.css b/src/renderer/src/assets/terminal.css index c78145379ca..92c0868929b 100644 --- a/src/renderer/src/assets/terminal.css +++ b/src/renderer/src/assets/terminal.css @@ -353,6 +353,11 @@ background: transparent; border-bottom: none; padding: 0 4px; + pointer-events: none; +} + +.pane-title-bar[data-chromeless] .pane-title-actions { + pointer-events: auto; } .pane-title-close { diff --git a/src/renderer/src/components/terminal-pane/TerminalPane.tsx b/src/renderer/src/components/terminal-pane/TerminalPane.tsx index d49b48c0fa7..def670bfdc1 100644 --- a/src/renderer/src/components/terminal-pane/TerminalPane.tsx +++ b/src/renderer/src/components/terminal-pane/TerminalPane.tsx @@ -1760,27 +1760,24 @@ export default function TerminalPane({ return subscribeTerminalPaneAttention(tabId, applyTerminalPaneAttention) }, [tabId, paneCount, applyTerminalPaneAttention]) - // Sync the pane title reservation before paint. The title UI stays outside - // xterm's DOM, but xterm must still fit below it so the first terminal row is - // never hidden under the title strip. + // Sync the pane title reservation before paint. Text/banner chrome stays + // outside xterm's DOM, but xterm must still fit below it so the first + // terminal row is never hidden under meaningful status UI. useLayoutEffect(() => { const manager = managerRef.current if (!manager) { return } - // Show the title bar space when the pane has a title, is being - // inline-edited, or has transient startup chrome. Unread activity does - // not reserve this space; its overlay should not reflow terminal content. + // Show title space only for text/status chrome. Chromeless pane controls + // float over xterm so untitled panes keep their first row. const needsFit = syncSessionRestoredBannerTitleSpace({ panes: manager.getPanes(), paneTitles, renamingPaneId, - sessionRestoredBannerPaneIds, - reservePaneHeaderSpace: isActive && (isVisible || shouldMeasureHiddenStartup) + sessionRestoredBannerPaneIds }) if (needsFit && (isVisible || shouldMeasureHiddenStartup)) { - // Why: inactive terminal tabs can drop active-only header reservation. - // Fitting that hidden geometry changes PTY rows and wakes TUIs with + // Why: fitting hidden geometry changes PTY rows and wakes TUIs with // SIGWINCH; the visible resume path owns any real layout correction. fitPanes(manager) } @@ -1790,7 +1787,6 @@ export default function TerminalPane({ paneTitles, renamingPaneId, sessionRestoredBannerPaneIds, - isActive, isVisible, shouldMeasureHiddenStartup ]) diff --git a/src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.test.tsx b/src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.test.tsx index 6178db32516..78e80b3231e 100644 --- a/src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.test.tsx +++ b/src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.test.tsx @@ -127,11 +127,13 @@ describe('TerminalPaneHeaderOverlay', () => { expect(onClosePane).not.toHaveBeenCalledWith(1) }) - it('keeps close-pane available for untitled split pane headers', () => { + it('keeps split and close-pane controls available for untitled split pane headers', () => { const { container, onClosePane, onRemoveTitle } = renderOverlay({ paneTitles: { 1: '', 2: '' } }) + expect(container.querySelector('button[aria-label="Split Terminal Right"]')).not.toBeNull() + expect(container.querySelector('.pane-title-drag-handle')).toBeNull() const closePane = container.querySelector('button[aria-label="Close Pane"]') expect(closePane).not.toBeNull() diff --git a/src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.tsx b/src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.tsx index ca10b1ac38b..2aa1d729745 100644 --- a/src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.tsx +++ b/src/renderer/src/components/terminal-pane/TerminalPaneHeaderOverlay.tsx @@ -182,7 +182,7 @@ export default function TerminalPaneHeaderOverlay({ /> ) : ( <> - {paneCount > 1 && ( + {paneCount > 1 && !isChromeless && (