From ff0a5b0d9563475b253aa4d44409e1cf63035dca Mon Sep 17 00:00:00 2001 From: liuxuezhuo Date: Fri, 18 Sep 2026 08:50:41 +0800 Subject: [PATCH] feat(composer): keep the resize grip out of the way The grip above the message input drew its outlined pill at all times and popped a tooltip on hover, so the input's top edge never read as a plain border. The tooltip and its translations are gone - the resize cursor and the accent highlight while dragging already signal the drag - and the pill now fades in only when the pointer is inside the input area or the composer has focus. Drag, double-click to reset, and keyboard resizing are unchanged. --- CHANGELOG.md | 11 +++++++++++ src/features/chat/chat-view.ts | 3 --- src/features/chat/ui/composer-resize.ts | 10 ---------- src/i18n/locales/de.json | 3 +-- src/i18n/locales/en.json | 3 +-- src/i18n/locales/es.json | 3 +-- src/i18n/locales/fr.json | 3 +-- src/i18n/locales/ja.json | 3 +-- src/i18n/locales/ko.json | 3 +-- src/i18n/locales/pt.json | 3 +-- src/i18n/locales/ru.json | 3 +-- src/i18n/locales/zh-CN.json | 3 +-- src/i18n/locales/zh-TW.json | 3 +-- src/i18n/types.ts | 1 - src/style/components/input.css | 10 +++++++++- tests/unit/i18n/locales.test.ts | 1 - 16 files changed, 30 insertions(+), 36 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2ec490..ebfa259 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,17 @@ version with its date and start a fresh empty `[Unreleased]` above it. release; click it to open Qoderian's plugin page, where Obsidian's update button lives. +### Changed + +- The resize grip above the message input stays hidden until the pointer is + inside the input area or the composer has focus, so the input's top edge + reads as a plain border while you are reading or scrolling. + +### Removed + +- The hover tooltip on the message input's resize grip; the resize cursor and + the accent highlight while dragging already signal what the grip does. + ## [1.0.11] - 2026-09-16 ### Added diff --git a/src/features/chat/chat-view.ts b/src/features/chat/chat-view.ts index 7ac8ed6..2865c5a 100644 --- a/src/features/chat/chat-view.ts +++ b/src/features/chat/chat-view.ts @@ -417,9 +417,6 @@ export class QoderianView extends ItemView { ); } this.creditsUsageButton?.refreshLocale(); - for (const tab of this.tabManager?.getAllTabs() ?? []) { - tab.ui.composerResize?.refreshLocale(); - } this.updateTabBar(); } diff --git a/src/features/chat/ui/composer-resize.ts b/src/features/chat/ui/composer-resize.ts index 0eda291..5e14fdf 100644 --- a/src/features/chat/ui/composer-resize.ts +++ b/src/features/chat/ui/composer-resize.ts @@ -1,13 +1,9 @@ -import { t } from '../../../i18n/i18n'; -import { setButtonTooltip } from '../../../shared/dom/tooltip'; - export const COMPOSER_MIN_HEIGHT = 140; export const COMPOSER_MAX_HEIGHT_PERCENT = 0.75; export const COMPOSER_KEYBOARD_RESIZE_STEP = 24; export interface ComposerResizeController { destroy(): void; - refreshLocale(): void; reset(): void; } @@ -113,15 +109,10 @@ export function attachComposerResize( applyHeight(currentHeight() + delta); }; - const refreshLocale = (): void => { - setButtonTooltip(handleEl, t('composer.resize')); - }; - handleEl.setAttribute('role', 'separator'); handleEl.setAttribute('aria-orientation', 'horizontal'); handleEl.setAttribute('tabindex', '0'); updateAriaBounds(currentHeight()); - refreshLocale(); handleEl.addEventListener('pointerdown', handlePointerDown); handleEl.addEventListener('dblclick', reset); handleEl.addEventListener('keydown', handleKeydown); @@ -148,7 +139,6 @@ export function attachComposerResize( handleEl.removeEventListener('keydown', handleKeydown); viewWindow?.removeEventListener('blur', stopDragging); }, - refreshLocale, reset, }; } diff --git a/src/i18n/locales/de.json b/src/i18n/locales/de.json index b9ac998..838963a 100644 --- a/src/i18n/locales/de.json +++ b/src/i18n/locales/de.json @@ -23,8 +23,7 @@ }, "composer": { "send": "Nachricht senden", - "stop": "Generierung stoppen", - "resize": "Ziehen, um die Eingabehöhe anzupassen; doppelklicken zum Zurücksetzen" + "stop": "Generierung stoppen" }, "restore": { "failed": "Einige Tabs oder Unterhaltungen konnten nicht wiederhergestellt werden ({count} Problem(e)). Details in der Entwicklerkonsole." diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index e08640c..9062052 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -23,8 +23,7 @@ }, "composer": { "send": "Send message", - "stop": "Stop generation", - "resize": "Drag to resize the message input; double-click to reset" + "stop": "Stop generation" }, "restore": { "failed": "Some of your previous tabs or conversations could not be restored ({count} issue(s)). Details are in the developer console." diff --git a/src/i18n/locales/es.json b/src/i18n/locales/es.json index 92e82a8..12f15ed 100644 --- a/src/i18n/locales/es.json +++ b/src/i18n/locales/es.json @@ -23,8 +23,7 @@ }, "composer": { "send": "Enviar mensaje", - "stop": "Detener generación", - "resize": "Arrastra para ajustar la altura del campo; haz doble clic para restablecer" + "stop": "Detener generación" }, "restore": { "failed": "No se pudieron restaurar algunas pestañas o conversaciones ({count} problema(s)). Detalles en la consola de desarrollador." diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json index 2d54d69..2694f62 100644 --- a/src/i18n/locales/fr.json +++ b/src/i18n/locales/fr.json @@ -23,8 +23,7 @@ }, "composer": { "send": "Envoyer le message", - "stop": "Arrêter la génération", - "resize": "Faites glisser pour redimensionner la saisie ; double-cliquez pour réinitialiser" + "stop": "Arrêter la génération" }, "restore": { "failed": "Certains onglets ou conversations n'ont pas pu être restaurés ({count} problème(s)). Détails dans la console développeur." diff --git a/src/i18n/locales/ja.json b/src/i18n/locales/ja.json index b13f374..7e05e2b 100644 --- a/src/i18n/locales/ja.json +++ b/src/i18n/locales/ja.json @@ -23,8 +23,7 @@ }, "composer": { "send": "メッセージを送信", - "stop": "生成を停止", - "resize": "ドラッグして入力欄の高さを調整。ダブルクリックで自動サイズに戻す" + "stop": "生成を停止" }, "restore": { "failed": "一部のタブまたは会話を復元できませんでした({count} 件の問題)。詳細は開発者コンソールを確認してください。" diff --git a/src/i18n/locales/ko.json b/src/i18n/locales/ko.json index c5957b9..fb7fd8b 100644 --- a/src/i18n/locales/ko.json +++ b/src/i18n/locales/ko.json @@ -23,8 +23,7 @@ }, "composer": { "send": "메시지 보내기", - "stop": "생성 중지", - "resize": "드래그하여 입력 높이 조절; 두 번 클릭하여 자동 높이로 재설정" + "stop": "생성 중지" }, "restore": { "failed": "이전 탭 또는 대화를 완전히 복원하지 못했습니다(문제 {count}건). 자세한 내용은 개발자 콘솔을 확인하세요." diff --git a/src/i18n/locales/pt.json b/src/i18n/locales/pt.json index 9260a2f..aa505fd 100644 --- a/src/i18n/locales/pt.json +++ b/src/i18n/locales/pt.json @@ -23,8 +23,7 @@ }, "composer": { "send": "Enviar mensagem", - "stop": "Parar geração", - "resize": "Arraste para ajustar a altura da entrada; clique duas vezes para redefinir" + "stop": "Parar geração" }, "restore": { "failed": "Algumas abas ou conversas não puderam ser restauradas ({count} problema(s)). Detalhes no console do desenvolvedor." diff --git a/src/i18n/locales/ru.json b/src/i18n/locales/ru.json index 77f93f6..2f14adb 100644 --- a/src/i18n/locales/ru.json +++ b/src/i18n/locales/ru.json @@ -23,8 +23,7 @@ }, "composer": { "send": "Отправить сообщение", - "stop": "Остановить генерацию", - "resize": "Перетащите, чтобы изменить высоту поля; двойной щелчок — сброс" + "stop": "Остановить генерацию" }, "restore": { "failed": "Не удалось восстановить часть вкладок или бесед (проблем: {count}). Подробности — в консоли разработчика." diff --git a/src/i18n/locales/zh-CN.json b/src/i18n/locales/zh-CN.json index 08892fd..dc1fd97 100644 --- a/src/i18n/locales/zh-CN.json +++ b/src/i18n/locales/zh-CN.json @@ -23,8 +23,7 @@ }, "composer": { "send": "发送消息", - "stop": "停止生成", - "resize": "拖动调整输入框高度;双击恢复自动高度" + "stop": "停止生成" }, "restore": { "failed": "部分标签或会话未能恢复({count} 个问题)。详情已输出到开发者控制台。" diff --git a/src/i18n/locales/zh-TW.json b/src/i18n/locales/zh-TW.json index efcbd48..0a9b1ac 100644 --- a/src/i18n/locales/zh-TW.json +++ b/src/i18n/locales/zh-TW.json @@ -23,8 +23,7 @@ }, "composer": { "send": "傳送訊息", - "stop": "停止生成", - "resize": "拖曳調整輸入框高度;按兩下恢復自動高度" + "stop": "停止生成" }, "restore": { "failed": "部分分頁或工作階段未能恢復({count} 個問題)。詳情已輸出到開發者主控台。" diff --git a/src/i18n/types.ts b/src/i18n/types.ts index 2b396e4..fa42840 100644 --- a/src/i18n/types.ts +++ b/src/i18n/types.ts @@ -65,7 +65,6 @@ export type TranslationKey = // Composer - send/stop action button | 'composer.send' | 'composer.stop' - | 'composer.resize' | 'restore.failed' // Chat - Rewind diff --git a/src/style/components/input.css b/src/style/components/input.css index 688d20f..33f759a 100644 --- a/src/style/components/input.css +++ b/src/style/components/input.css @@ -56,8 +56,16 @@ border-radius: 999px; background: var(--background-primary); transform: translateX(-50%); + opacity: 0; + transition: opacity 0.12s ease, border-color 0.12s ease, background 0.12s ease; +} + +/* The grip stays out of the way until the pointer is inside the composer or it has focus. */ +.qoderian-input-wrapper:hover .qoderian-composer-resize-handle::after, +.qoderian-input-wrapper:focus-within .qoderian-composer-resize-handle::after, +.qoderian-composer-resize-handle:focus-visible::after, +.qoderian-composer-resizing .qoderian-composer-resize-handle::after { opacity: 1; - transition: border-color 0.12s ease, background 0.12s ease; } .qoderian-composer-resize-handle:hover::after, diff --git a/tests/unit/i18n/locales.test.ts b/tests/unit/i18n/locales.test.ts index 576b0e8..7b574f6 100644 --- a/tests/unit/i18n/locales.test.ts +++ b/tests/unit/i18n/locales.test.ts @@ -91,7 +91,6 @@ const localizedKeys = [ 'chat.permissionMode.plan.desc', 'chat.permissionMode.changeFailed', 'chat.slashCommand.requiresInteractiveTerminal', - 'composer.resize', 'commands.submitFeedback', 'feedback.title', 'feedback.placeholder',