From de09da5855b92991cfaa4d736b83ff19a5956983 Mon Sep 17 00:00:00 2001 From: sunrioa <178722768+sunrioa@users.noreply.github.com> Date: Mon, 14 Sep 2026 12:19:11 +0800 Subject: [PATCH] fix(desktop): preserve empty composer caret height Keep the scrolling editable at least one line plus its block padding through inert session transitions. Cover draft restoration, empty disabled states, multiline scrolling, send-clear, and compact WorkHub geometry. Refs #5264 Generated-by: Codex --- apps/desktop/src/renderer/styles/composer.css | 15 +++ apps/desktop/src/renderer/styles/workhub.css | 4 +- apps/desktop/stories/app-shell.stories.tsx | 96 ++++++++++++++++++- apps/desktop/stories/workhub.stories.tsx | 21 ++++ 4 files changed, 132 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src/renderer/styles/composer.css b/apps/desktop/src/renderer/styles/composer.css index 6eb49c157b..8d6abd5052 100644 --- a/apps/desktop/src/renderer/styles/composer.css +++ b/apps/desktop/src/renderer/styles/composer.css @@ -40,6 +40,21 @@ max-width: var(--maka-reading-measure); } +.maka-composer-editor { + --maka-editor-padding-block: var(--space-1); +} + +/* An empty scrolling contenteditable can lose its line box when shown under + an inert session-switching parent (#5264). Astryx's outer minimum does not + protect the caret inside it. Keep one line plus the actual block padding, + including compact WorkHub's override, without fixing the multiline height. + Match only the editor, not nested contenteditable=false reference tokens; + keep the minimum while the editor itself is disabled, too. */ +.maka-composer-editor > [contenteditable] { + padding-block: var(--maka-editor-padding-block); + min-height: calc(1lh + 2 * var(--maka-editor-padding-block)); +} + .maka-return-workhub { --_button-radius: var(--radius-chat); display: flex; diff --git a/apps/desktop/src/renderer/styles/workhub.css b/apps/desktop/src/renderer/styles/workhub.css index 05d5b7e2db..07fc1649df 100644 --- a/apps/desktop/src/renderer/styles/workhub.css +++ b/apps/desktop/src/renderer/styles/workhub.css @@ -215,8 +215,8 @@ .workHubLive[data-conversation-expanded='false'] .maka-chat-layout { overflow: hidden; scrollbar-width: none; } .workHubLive[data-conversation-expanded='false'] .maka-chat-layout > div:last-child > div:has(> div > .workHubComposerSurface) { padding: 0; } .workHubLive[data-conversation-expanded='false'] .maka-composer { --shadow-low: none; --shadow-med: none; } - .workHubLive[data-conversation-expanded='false'] .maka-composer-editor { padding-right: 24px; } - .workHubLive[data-conversation-expanded='false'] .maka-composer-editor [contenteditable='true'] { padding-block: 6px; overscroll-behavior-y: contain; scrollbar-gutter: stable; scrollbar-width: thin; scroll-padding-block: 6px; } + .workHubLive[data-conversation-expanded='false'] .maka-composer-editor { --maka-editor-padding-block: var(--space-1-5); padding-right: 24px; } + .workHubLive[data-conversation-expanded='false'] .maka-composer-editor > [contenteditable] { overscroll-behavior-y: contain; scrollbar-gutter: stable; scrollbar-width: thin; scroll-padding-block: var(--maka-editor-padding-block); } .workHubLive[data-conversation-expanded='false'] .workHubComposerSurface { position: relative; -webkit-app-region: drag; } .workHubLive[data-conversation-expanded='false'] .workHubComposerSurface :is(button, input, textarea, [contenteditable='true'], [role='listbox'], [role='option'], a) { -webkit-app-region: no-drag; } .workHubExpandButton { position: absolute; top: 6px; right: 8px; z-index: 2; color: var(--muted-foreground); -webkit-app-region: no-drag; } diff --git a/apps/desktop/stories/app-shell.stories.tsx b/apps/desktop/stories/app-shell.stories.tsx index 542c0551ad..2360d459d0 100644 --- a/apps/desktop/stories/app-shell.stories.tsx +++ b/apps/desktop/stories/app-shell.stories.tsx @@ -347,6 +347,9 @@ function ComposedShell(props: { session?: (Omit, 'id'> & { streaming?: boolean }) | null; chat?: Partial; composer?: Partial; + /** The mainColumn interaction gate and ChatSurfaceLayout visibility in app-shell.tsx. */ + switchingSession?: boolean; + chatHidden?: boolean; detailChildren?: ReactNode; motionEnabled?: boolean; /** @@ -484,8 +487,9 @@ function ComposedShell(props: { // the chat column (app-shell.tsx). `.mainColumn` owns composer // padding, so a story without it measures its own box. (
-
+