From 6bdab44488bb5656e4c1a12d1e9f4ed3ed68f0a7 Mon Sep 17 00:00:00 2001 From: Marqle Date: Tue, 19 May 2026 15:31:23 +0800 Subject: [PATCH] fix click expanded --- src/apps/{vcoder => ohos}/.gitignore | 0 src/apps/{vcoder => ohos}/AppScope/app.json5 | 0 .../resources/base/element/string.json | 0 .../resources/base/media/background.png | Bin .../resources/base/media/foreground.png | Bin .../resources/base/media/layered_image.json | 0 src/apps/{vcoder => ohos}/build-profile.json5 | 0 src/apps/{vcoder => ohos}/code-linter.json5 | 0 src/apps/{vcoder => ohos}/entry/.gitignore | 0 .../entry/build-profile.json5 | 0 src/apps/{vcoder => ohos}/entry/hvigorfile.ts | 0 .../entry/obfuscation-rules.txt | 0 .../entry/oh-package-lock.json5 | 0 .../{vcoder => ohos}/entry/oh-package.json5 | 0 .../entry/src/main/cpp/CMakeLists.txt | 0 .../entry/src/main/cpp/napi_init.cpp | 0 .../types/libbitfun_desktop_lib/Index.d.ts | 0 .../libbitfun_desktop_lib/oh-package.json5 | 0 .../src/main/cpp/types/libentry/Index.d.ts | 0 .../main/cpp/types/libentry/oh-package.json5 | 0 .../main/ets/entryability/EntryAbility.ets | 0 .../entrybackupability/EntryBackupAbility.ets | 0 .../entry/src/main/ets/pages/Index.ets | 0 .../main/ets/utils/CommonEventListener.ets | 0 .../entry/src/main/ets/utils/CommonUtils.ets | 0 .../entry/src/main/ets/utils/DevecoStart.ets | 0 .../entry/src/main/ets/utils/Result.ets | 0 .../entry/src/main/module.json5 | 0 .../main/resources/base/element/color.json | 0 .../main/resources/base/element/float.json | 0 .../main/resources/base/element/string.json | 0 .../main/resources/base/media/background.png | Bin .../main/resources/base/media/bitfun_icon.png | Bin .../main/resources/base/media/foreground.png | Bin .../resources/base/media/layered_image.json | 0 .../main/resources/base/media/startIcon.png | Bin .../resources/base/profile/backup_config.json | 0 .../resources/base/profile/main_pages.json | 0 .../main/resources/dark/element/color.json | 0 .../entry/src/mock/mock-config.json5 | 0 .../src/ohosTest/ets/test/Ability.test.ets | 0 .../entry/src/ohosTest/ets/test/List.test.ets | 0 .../entry/src/ohosTest/module.json5 | 0 .../entry/src/test/List.test.ets | 0 .../entry/src/test/LocalUnit.test.ets | 0 .../hvigor/hvigor-config.json5 | 0 src/apps/{vcoder => ohos}/hvigorfile.ts | 0 .../{vcoder => ohos}/oh-package-lock.json5 | 0 src/apps/{vcoder => ohos}/oh-package.json5 | 0 .../flow_chat/tool-cards/CompactToolCard.tsx | 17 ++++++++---- .../flow_chat/tool-cards/DefaultToolCard.tsx | 22 ++++++++++++--- .../flow_chat/tool-cards/GitToolDisplay.tsx | 19 ++++++++++--- .../tool-cards/GlobSearchDisplay.tsx | 18 ++++++++++--- .../tool-cards/GrepSearchDisplay.tsx | 19 ++++++++++--- .../src/flow_chat/tool-cards/LSDisplay.tsx | 16 ++++++++--- .../tool-cards/ModelThinkingDisplay.tsx | 23 +++++++++++++--- .../flow_chat/tool-cards/ReadFileDisplay.tsx | 23 ++++++++++++++-- .../tool-cards/SessionControlToolCard.tsx | 25 ++++++++++++++---- .../tool-cards/SessionMessageToolCard.tsx | 25 ++++++++++++++---- .../flow_chat/tool-cards/TerminalToolCard.tsx | 22 ++++++++++++--- .../flow_chat/tool-cards/WebSearchCard.tsx | 19 ++++++++++--- 61 files changed, 204 insertions(+), 44 deletions(-) rename src/apps/{vcoder => ohos}/.gitignore (100%) rename src/apps/{vcoder => ohos}/AppScope/app.json5 (100%) rename src/apps/{vcoder => ohos}/AppScope/resources/base/element/string.json (100%) rename src/apps/{vcoder => ohos}/AppScope/resources/base/media/background.png (100%) rename src/apps/{vcoder => ohos}/AppScope/resources/base/media/foreground.png (100%) rename src/apps/{vcoder => ohos}/AppScope/resources/base/media/layered_image.json (100%) rename src/apps/{vcoder => ohos}/build-profile.json5 (100%) rename src/apps/{vcoder => ohos}/code-linter.json5 (100%) rename src/apps/{vcoder => ohos}/entry/.gitignore (100%) rename src/apps/{vcoder => ohos}/entry/build-profile.json5 (100%) rename src/apps/{vcoder => ohos}/entry/hvigorfile.ts (100%) rename src/apps/{vcoder => ohos}/entry/obfuscation-rules.txt (100%) rename src/apps/{vcoder => ohos}/entry/oh-package-lock.json5 (100%) rename src/apps/{vcoder => ohos}/entry/oh-package.json5 (100%) rename src/apps/{vcoder => ohos}/entry/src/main/cpp/CMakeLists.txt (100%) rename src/apps/{vcoder => ohos}/entry/src/main/cpp/napi_init.cpp (100%) rename src/apps/{vcoder => ohos}/entry/src/main/cpp/types/libbitfun_desktop_lib/Index.d.ts (100%) rename src/apps/{vcoder => ohos}/entry/src/main/cpp/types/libbitfun_desktop_lib/oh-package.json5 (100%) rename src/apps/{vcoder => ohos}/entry/src/main/cpp/types/libentry/Index.d.ts (100%) rename src/apps/{vcoder => ohos}/entry/src/main/cpp/types/libentry/oh-package.json5 (100%) rename src/apps/{vcoder => ohos}/entry/src/main/ets/entryability/EntryAbility.ets (100%) rename src/apps/{vcoder => ohos}/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets (100%) rename src/apps/{vcoder => ohos}/entry/src/main/ets/pages/Index.ets (100%) rename src/apps/{vcoder => ohos}/entry/src/main/ets/utils/CommonEventListener.ets (100%) rename src/apps/{vcoder => ohos}/entry/src/main/ets/utils/CommonUtils.ets (100%) rename src/apps/{vcoder => ohos}/entry/src/main/ets/utils/DevecoStart.ets (100%) rename src/apps/{vcoder => ohos}/entry/src/main/ets/utils/Result.ets (100%) rename src/apps/{vcoder => ohos}/entry/src/main/module.json5 (100%) rename src/apps/{vcoder => ohos}/entry/src/main/resources/base/element/color.json (100%) rename src/apps/{vcoder => ohos}/entry/src/main/resources/base/element/float.json (100%) rename src/apps/{vcoder => ohos}/entry/src/main/resources/base/element/string.json (100%) rename src/apps/{vcoder => ohos}/entry/src/main/resources/base/media/background.png (100%) rename src/apps/{vcoder => ohos}/entry/src/main/resources/base/media/bitfun_icon.png (100%) rename src/apps/{vcoder => ohos}/entry/src/main/resources/base/media/foreground.png (100%) rename src/apps/{vcoder => ohos}/entry/src/main/resources/base/media/layered_image.json (100%) rename src/apps/{vcoder => ohos}/entry/src/main/resources/base/media/startIcon.png (100%) rename src/apps/{vcoder => ohos}/entry/src/main/resources/base/profile/backup_config.json (100%) rename src/apps/{vcoder => ohos}/entry/src/main/resources/base/profile/main_pages.json (100%) rename src/apps/{vcoder => ohos}/entry/src/main/resources/dark/element/color.json (100%) rename src/apps/{vcoder => ohos}/entry/src/mock/mock-config.json5 (100%) rename src/apps/{vcoder => ohos}/entry/src/ohosTest/ets/test/Ability.test.ets (100%) rename src/apps/{vcoder => ohos}/entry/src/ohosTest/ets/test/List.test.ets (100%) rename src/apps/{vcoder => ohos}/entry/src/ohosTest/module.json5 (100%) rename src/apps/{vcoder => ohos}/entry/src/test/List.test.ets (100%) rename src/apps/{vcoder => ohos}/entry/src/test/LocalUnit.test.ets (100%) rename src/apps/{vcoder => ohos}/hvigor/hvigor-config.json5 (100%) rename src/apps/{vcoder => ohos}/hvigorfile.ts (100%) rename src/apps/{vcoder => ohos}/oh-package-lock.json5 (100%) rename src/apps/{vcoder => ohos}/oh-package.json5 (100%) diff --git a/src/apps/vcoder/.gitignore b/src/apps/ohos/.gitignore similarity index 100% rename from src/apps/vcoder/.gitignore rename to src/apps/ohos/.gitignore diff --git a/src/apps/vcoder/AppScope/app.json5 b/src/apps/ohos/AppScope/app.json5 similarity index 100% rename from src/apps/vcoder/AppScope/app.json5 rename to src/apps/ohos/AppScope/app.json5 diff --git a/src/apps/vcoder/AppScope/resources/base/element/string.json b/src/apps/ohos/AppScope/resources/base/element/string.json similarity index 100% rename from src/apps/vcoder/AppScope/resources/base/element/string.json rename to src/apps/ohos/AppScope/resources/base/element/string.json diff --git a/src/apps/vcoder/AppScope/resources/base/media/background.png b/src/apps/ohos/AppScope/resources/base/media/background.png similarity index 100% rename from src/apps/vcoder/AppScope/resources/base/media/background.png rename to src/apps/ohos/AppScope/resources/base/media/background.png diff --git a/src/apps/vcoder/AppScope/resources/base/media/foreground.png b/src/apps/ohos/AppScope/resources/base/media/foreground.png similarity index 100% rename from src/apps/vcoder/AppScope/resources/base/media/foreground.png rename to src/apps/ohos/AppScope/resources/base/media/foreground.png diff --git a/src/apps/vcoder/AppScope/resources/base/media/layered_image.json b/src/apps/ohos/AppScope/resources/base/media/layered_image.json similarity index 100% rename from src/apps/vcoder/AppScope/resources/base/media/layered_image.json rename to src/apps/ohos/AppScope/resources/base/media/layered_image.json diff --git a/src/apps/vcoder/build-profile.json5 b/src/apps/ohos/build-profile.json5 similarity index 100% rename from src/apps/vcoder/build-profile.json5 rename to src/apps/ohos/build-profile.json5 diff --git a/src/apps/vcoder/code-linter.json5 b/src/apps/ohos/code-linter.json5 similarity index 100% rename from src/apps/vcoder/code-linter.json5 rename to src/apps/ohos/code-linter.json5 diff --git a/src/apps/vcoder/entry/.gitignore b/src/apps/ohos/entry/.gitignore similarity index 100% rename from src/apps/vcoder/entry/.gitignore rename to src/apps/ohos/entry/.gitignore diff --git a/src/apps/vcoder/entry/build-profile.json5 b/src/apps/ohos/entry/build-profile.json5 similarity index 100% rename from src/apps/vcoder/entry/build-profile.json5 rename to src/apps/ohos/entry/build-profile.json5 diff --git a/src/apps/vcoder/entry/hvigorfile.ts b/src/apps/ohos/entry/hvigorfile.ts similarity index 100% rename from src/apps/vcoder/entry/hvigorfile.ts rename to src/apps/ohos/entry/hvigorfile.ts diff --git a/src/apps/vcoder/entry/obfuscation-rules.txt b/src/apps/ohos/entry/obfuscation-rules.txt similarity index 100% rename from src/apps/vcoder/entry/obfuscation-rules.txt rename to src/apps/ohos/entry/obfuscation-rules.txt diff --git a/src/apps/vcoder/entry/oh-package-lock.json5 b/src/apps/ohos/entry/oh-package-lock.json5 similarity index 100% rename from src/apps/vcoder/entry/oh-package-lock.json5 rename to src/apps/ohos/entry/oh-package-lock.json5 diff --git a/src/apps/vcoder/entry/oh-package.json5 b/src/apps/ohos/entry/oh-package.json5 similarity index 100% rename from src/apps/vcoder/entry/oh-package.json5 rename to src/apps/ohos/entry/oh-package.json5 diff --git a/src/apps/vcoder/entry/src/main/cpp/CMakeLists.txt b/src/apps/ohos/entry/src/main/cpp/CMakeLists.txt similarity index 100% rename from src/apps/vcoder/entry/src/main/cpp/CMakeLists.txt rename to src/apps/ohos/entry/src/main/cpp/CMakeLists.txt diff --git a/src/apps/vcoder/entry/src/main/cpp/napi_init.cpp b/src/apps/ohos/entry/src/main/cpp/napi_init.cpp similarity index 100% rename from src/apps/vcoder/entry/src/main/cpp/napi_init.cpp rename to src/apps/ohos/entry/src/main/cpp/napi_init.cpp diff --git a/src/apps/vcoder/entry/src/main/cpp/types/libbitfun_desktop_lib/Index.d.ts b/src/apps/ohos/entry/src/main/cpp/types/libbitfun_desktop_lib/Index.d.ts similarity index 100% rename from src/apps/vcoder/entry/src/main/cpp/types/libbitfun_desktop_lib/Index.d.ts rename to src/apps/ohos/entry/src/main/cpp/types/libbitfun_desktop_lib/Index.d.ts diff --git a/src/apps/vcoder/entry/src/main/cpp/types/libbitfun_desktop_lib/oh-package.json5 b/src/apps/ohos/entry/src/main/cpp/types/libbitfun_desktop_lib/oh-package.json5 similarity index 100% rename from src/apps/vcoder/entry/src/main/cpp/types/libbitfun_desktop_lib/oh-package.json5 rename to src/apps/ohos/entry/src/main/cpp/types/libbitfun_desktop_lib/oh-package.json5 diff --git a/src/apps/vcoder/entry/src/main/cpp/types/libentry/Index.d.ts b/src/apps/ohos/entry/src/main/cpp/types/libentry/Index.d.ts similarity index 100% rename from src/apps/vcoder/entry/src/main/cpp/types/libentry/Index.d.ts rename to src/apps/ohos/entry/src/main/cpp/types/libentry/Index.d.ts diff --git a/src/apps/vcoder/entry/src/main/cpp/types/libentry/oh-package.json5 b/src/apps/ohos/entry/src/main/cpp/types/libentry/oh-package.json5 similarity index 100% rename from src/apps/vcoder/entry/src/main/cpp/types/libentry/oh-package.json5 rename to src/apps/ohos/entry/src/main/cpp/types/libentry/oh-package.json5 diff --git a/src/apps/vcoder/entry/src/main/ets/entryability/EntryAbility.ets b/src/apps/ohos/entry/src/main/ets/entryability/EntryAbility.ets similarity index 100% rename from src/apps/vcoder/entry/src/main/ets/entryability/EntryAbility.ets rename to src/apps/ohos/entry/src/main/ets/entryability/EntryAbility.ets diff --git a/src/apps/vcoder/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/src/apps/ohos/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets similarity index 100% rename from src/apps/vcoder/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets rename to src/apps/ohos/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets diff --git a/src/apps/vcoder/entry/src/main/ets/pages/Index.ets b/src/apps/ohos/entry/src/main/ets/pages/Index.ets similarity index 100% rename from src/apps/vcoder/entry/src/main/ets/pages/Index.ets rename to src/apps/ohos/entry/src/main/ets/pages/Index.ets diff --git a/src/apps/vcoder/entry/src/main/ets/utils/CommonEventListener.ets b/src/apps/ohos/entry/src/main/ets/utils/CommonEventListener.ets similarity index 100% rename from src/apps/vcoder/entry/src/main/ets/utils/CommonEventListener.ets rename to src/apps/ohos/entry/src/main/ets/utils/CommonEventListener.ets diff --git a/src/apps/vcoder/entry/src/main/ets/utils/CommonUtils.ets b/src/apps/ohos/entry/src/main/ets/utils/CommonUtils.ets similarity index 100% rename from src/apps/vcoder/entry/src/main/ets/utils/CommonUtils.ets rename to src/apps/ohos/entry/src/main/ets/utils/CommonUtils.ets diff --git a/src/apps/vcoder/entry/src/main/ets/utils/DevecoStart.ets b/src/apps/ohos/entry/src/main/ets/utils/DevecoStart.ets similarity index 100% rename from src/apps/vcoder/entry/src/main/ets/utils/DevecoStart.ets rename to src/apps/ohos/entry/src/main/ets/utils/DevecoStart.ets diff --git a/src/apps/vcoder/entry/src/main/ets/utils/Result.ets b/src/apps/ohos/entry/src/main/ets/utils/Result.ets similarity index 100% rename from src/apps/vcoder/entry/src/main/ets/utils/Result.ets rename to src/apps/ohos/entry/src/main/ets/utils/Result.ets diff --git a/src/apps/vcoder/entry/src/main/module.json5 b/src/apps/ohos/entry/src/main/module.json5 similarity index 100% rename from src/apps/vcoder/entry/src/main/module.json5 rename to src/apps/ohos/entry/src/main/module.json5 diff --git a/src/apps/vcoder/entry/src/main/resources/base/element/color.json b/src/apps/ohos/entry/src/main/resources/base/element/color.json similarity index 100% rename from src/apps/vcoder/entry/src/main/resources/base/element/color.json rename to src/apps/ohos/entry/src/main/resources/base/element/color.json diff --git a/src/apps/vcoder/entry/src/main/resources/base/element/float.json b/src/apps/ohos/entry/src/main/resources/base/element/float.json similarity index 100% rename from src/apps/vcoder/entry/src/main/resources/base/element/float.json rename to src/apps/ohos/entry/src/main/resources/base/element/float.json diff --git a/src/apps/vcoder/entry/src/main/resources/base/element/string.json b/src/apps/ohos/entry/src/main/resources/base/element/string.json similarity index 100% rename from src/apps/vcoder/entry/src/main/resources/base/element/string.json rename to src/apps/ohos/entry/src/main/resources/base/element/string.json diff --git a/src/apps/vcoder/entry/src/main/resources/base/media/background.png b/src/apps/ohos/entry/src/main/resources/base/media/background.png similarity index 100% rename from src/apps/vcoder/entry/src/main/resources/base/media/background.png rename to src/apps/ohos/entry/src/main/resources/base/media/background.png diff --git a/src/apps/vcoder/entry/src/main/resources/base/media/bitfun_icon.png b/src/apps/ohos/entry/src/main/resources/base/media/bitfun_icon.png similarity index 100% rename from src/apps/vcoder/entry/src/main/resources/base/media/bitfun_icon.png rename to src/apps/ohos/entry/src/main/resources/base/media/bitfun_icon.png diff --git a/src/apps/vcoder/entry/src/main/resources/base/media/foreground.png b/src/apps/ohos/entry/src/main/resources/base/media/foreground.png similarity index 100% rename from src/apps/vcoder/entry/src/main/resources/base/media/foreground.png rename to src/apps/ohos/entry/src/main/resources/base/media/foreground.png diff --git a/src/apps/vcoder/entry/src/main/resources/base/media/layered_image.json b/src/apps/ohos/entry/src/main/resources/base/media/layered_image.json similarity index 100% rename from src/apps/vcoder/entry/src/main/resources/base/media/layered_image.json rename to src/apps/ohos/entry/src/main/resources/base/media/layered_image.json diff --git a/src/apps/vcoder/entry/src/main/resources/base/media/startIcon.png b/src/apps/ohos/entry/src/main/resources/base/media/startIcon.png similarity index 100% rename from src/apps/vcoder/entry/src/main/resources/base/media/startIcon.png rename to src/apps/ohos/entry/src/main/resources/base/media/startIcon.png diff --git a/src/apps/vcoder/entry/src/main/resources/base/profile/backup_config.json b/src/apps/ohos/entry/src/main/resources/base/profile/backup_config.json similarity index 100% rename from src/apps/vcoder/entry/src/main/resources/base/profile/backup_config.json rename to src/apps/ohos/entry/src/main/resources/base/profile/backup_config.json diff --git a/src/apps/vcoder/entry/src/main/resources/base/profile/main_pages.json b/src/apps/ohos/entry/src/main/resources/base/profile/main_pages.json similarity index 100% rename from src/apps/vcoder/entry/src/main/resources/base/profile/main_pages.json rename to src/apps/ohos/entry/src/main/resources/base/profile/main_pages.json diff --git a/src/apps/vcoder/entry/src/main/resources/dark/element/color.json b/src/apps/ohos/entry/src/main/resources/dark/element/color.json similarity index 100% rename from src/apps/vcoder/entry/src/main/resources/dark/element/color.json rename to src/apps/ohos/entry/src/main/resources/dark/element/color.json diff --git a/src/apps/vcoder/entry/src/mock/mock-config.json5 b/src/apps/ohos/entry/src/mock/mock-config.json5 similarity index 100% rename from src/apps/vcoder/entry/src/mock/mock-config.json5 rename to src/apps/ohos/entry/src/mock/mock-config.json5 diff --git a/src/apps/vcoder/entry/src/ohosTest/ets/test/Ability.test.ets b/src/apps/ohos/entry/src/ohosTest/ets/test/Ability.test.ets similarity index 100% rename from src/apps/vcoder/entry/src/ohosTest/ets/test/Ability.test.ets rename to src/apps/ohos/entry/src/ohosTest/ets/test/Ability.test.ets diff --git a/src/apps/vcoder/entry/src/ohosTest/ets/test/List.test.ets b/src/apps/ohos/entry/src/ohosTest/ets/test/List.test.ets similarity index 100% rename from src/apps/vcoder/entry/src/ohosTest/ets/test/List.test.ets rename to src/apps/ohos/entry/src/ohosTest/ets/test/List.test.ets diff --git a/src/apps/vcoder/entry/src/ohosTest/module.json5 b/src/apps/ohos/entry/src/ohosTest/module.json5 similarity index 100% rename from src/apps/vcoder/entry/src/ohosTest/module.json5 rename to src/apps/ohos/entry/src/ohosTest/module.json5 diff --git a/src/apps/vcoder/entry/src/test/List.test.ets b/src/apps/ohos/entry/src/test/List.test.ets similarity index 100% rename from src/apps/vcoder/entry/src/test/List.test.ets rename to src/apps/ohos/entry/src/test/List.test.ets diff --git a/src/apps/vcoder/entry/src/test/LocalUnit.test.ets b/src/apps/ohos/entry/src/test/LocalUnit.test.ets similarity index 100% rename from src/apps/vcoder/entry/src/test/LocalUnit.test.ets rename to src/apps/ohos/entry/src/test/LocalUnit.test.ets diff --git a/src/apps/vcoder/hvigor/hvigor-config.json5 b/src/apps/ohos/hvigor/hvigor-config.json5 similarity index 100% rename from src/apps/vcoder/hvigor/hvigor-config.json5 rename to src/apps/ohos/hvigor/hvigor-config.json5 diff --git a/src/apps/vcoder/hvigorfile.ts b/src/apps/ohos/hvigorfile.ts similarity index 100% rename from src/apps/vcoder/hvigorfile.ts rename to src/apps/ohos/hvigorfile.ts diff --git a/src/apps/vcoder/oh-package-lock.json5 b/src/apps/ohos/oh-package-lock.json5 similarity index 100% rename from src/apps/vcoder/oh-package-lock.json5 rename to src/apps/ohos/oh-package-lock.json5 diff --git a/src/apps/vcoder/oh-package.json5 b/src/apps/ohos/oh-package.json5 similarity index 100% rename from src/apps/vcoder/oh-package.json5 rename to src/apps/ohos/oh-package.json5 diff --git a/src/web-ui/src/flow_chat/tool-cards/CompactToolCard.tsx b/src/web-ui/src/flow_chat/tool-cards/CompactToolCard.tsx index e1dd1d7b0..113696577 100644 --- a/src/web-ui/src/flow_chat/tool-cards/CompactToolCard.tsx +++ b/src/web-ui/src/flow_chat/tool-cards/CompactToolCard.tsx @@ -24,6 +24,9 @@ export interface CompactToolCardProps { isExpanded?: boolean; /** Card click callback */ onClick?: (e: React.MouseEvent) => void; + onMouseDown?: (e: React.MouseEvent) => void; + onMouseUp?: (e: React.MouseEvent) => void; + onMouseMove?: (e: React.MouseEvent) => void; /** Custom class name */ className?: string; /** Whether clickable */ @@ -37,18 +40,20 @@ export interface CompactToolCardProps { export const CompactToolCard: React.FC = ({ status, isExpanded = false, - onClick, + onMouseDown, + onMouseUp, + onMouseMove, className = '', clickable = false, header, expandedContent, }) => { const handleWrapperClick = (event: React.MouseEvent) => { - if (!onClick || shouldIgnoreCardToggleClick(event)) { + if (!onMouseUp || shouldIgnoreCardToggleClick(event)) { return; } - onClick(event); + onMouseUp(event); }; const loadingShimmer = @@ -67,7 +72,7 @@ export const CompactToolCard: React.FC = ({ className={`compact-tool-card-wrapper--expanded-card ${className}`.trim()} header={header} expandedContent={expandedContent} - headerExpandAffordance={clickable || Boolean(onClick)} + headerExpandAffordance={clickable || Boolean(onMouseUp)} /> ); } @@ -78,7 +83,9 @@ export const CompactToolCard: React.FC = ({ >
{header} diff --git a/src/web-ui/src/flow_chat/tool-cards/DefaultToolCard.tsx b/src/web-ui/src/flow_chat/tool-cards/DefaultToolCard.tsx index ec13a8b90..8a5023cd8 100644 --- a/src/web-ui/src/flow_chat/tool-cards/DefaultToolCard.tsx +++ b/src/web-ui/src/flow_chat/tool-cards/DefaultToolCard.tsx @@ -93,6 +93,7 @@ export const DefaultToolCard: React.FC = ({ const { t } = useTranslation('flow-chat'); const { toolCall, toolResult, status, requiresConfirmation, userConfirmed } = toolItem; const [isExpanded, setIsExpanded] = useState(false); + const [shouldExpand, setShouldExpand] = useState(true); const toolId = toolItem.id ?? toolCall?.id; const { cardRootRef, applyExpandedState } = useToolCardHeightContract({ toolId, @@ -128,14 +129,25 @@ export const DefaultToolCard: React.FC = ({ onReject?.(); }; + const handleMouseDown = useCallback(() => { + setShouldExpand(true); + }, [applyExpandedState, canExpand, isExpanded, onExpand,shouldExpand, setShouldExpand]); + + const handleMouseMove = useCallback(() => { + setShouldExpand(false); + }, [applyExpandedState, canExpand, isExpanded, onExpand,shouldExpand, setShouldExpand]); + const handleToggleExpand = useCallback(() => { if (!canExpand) return; const nextExpanded = !isExpanded; - applyExpandedState(isExpanded, nextExpanded, setIsExpanded, { - onExpand, + if (shouldExpand) { + applyExpandedState(isExpanded, nextExpanded, setIsExpanded, { + onExpand, }); - }, [applyExpandedState, canExpand, isExpanded, onExpand]); + } + setShouldExpand(true); + }, [applyExpandedState, canExpand, isExpanded, onExpand, shouldExpand, setShouldExpand]); const getStatusText = () => { if (requiresConfirmation && !userConfirmed) { @@ -213,7 +225,9 @@ export const DefaultToolCard: React.FC = ({ = ({ return t('toolCards.git.executionFailed'); }; + const [shouldExpand, setShouldExpand] = useState(true); + + const handleMouseDown = useCallback(() => { + setShouldExpand(true); + }, [hasOutput, isFailed, toggleExpanded, shouldExpand, setShouldExpand]); + + const handleMouseMove = useCallback(() => { + setShouldExpand(false); + }, [hasOutput, isFailed, toggleExpanded, shouldExpand, setShouldExpand]); + const handleCardClick = useCallback((e: React.MouseEvent) => { const target = e.target as HTMLElement; if (target.closest('.tool-card-header-actions, .git-action-buttons, .terminal-header-actions')) { return; } - if (hasOutput || isFailed) { + if ((hasOutput || isFailed) && shouldExpand) { toggleExpanded(); } - }, [hasOutput, isFailed, toggleExpanded]); + setShouldExpand(true); + }, [hasOutput, isFailed, toggleExpanded, shouldExpand, setShouldExpand]); const renderStatusIcon = () => { if (isLoading) { @@ -417,7 +428,9 @@ export const GitToolDisplay: React.FC = ({ = ({ const searchPath = getSearchPath(); const hasDetails = status === 'completed' && files.length > 0; const hasResultData = toolResult?.result !== undefined && toolResult?.result !== null; + const [shouldExpand, setShouldExpand] = useState(true); + + const handleMouseMove= useCallback(() => { + setShouldExpand(false); + }, [applyExpandedState, hasDetails, isExpanded, onExpand, shouldExpand, setShouldExpand]); + + const handleMouseDown = useCallback(() => { + setShouldExpand(true); + }, [applyExpandedState, hasDetails, isExpanded, onExpand, shouldExpand, setShouldExpand]); const handleClick = useCallback(() => { - if (hasDetails) { + if (hasDetails && shouldExpand) { applyExpandedState(isExpanded, !isExpanded, setIsExpanded, { onExpand, }); } - }, [applyExpandedState, hasDetails, isExpanded, onExpand]); + setShouldExpand(true); + }, [applyExpandedState, hasDetails, isExpanded, onExpand,shouldExpand, setShouldExpand]); const renderContent = () => { if (status === 'completed') { @@ -180,7 +190,9 @@ export const GlobSearchDisplay: React.FC = ({ = ({ const hasDetails = status === 'completed' && stats.matches > 0; const hasResultData = toolResult?.result !== undefined && toolResult?.result !== null; + const [shouldExpand, setShouldExpand] = useState(true); + + const handleMouseMove = useCallback(() => { + setShouldExpand(false); + }, [applyExpandedState, hasDetails, isExpanded, onExpand, shouldExpand, setShouldExpand]); + + const handleMouseDown = useCallback(() => { + setShouldExpand(true); + }, [applyExpandedState, hasDetails, isExpanded, onExpand, shouldExpand, setShouldExpand]); + const handleClick = useCallback(() => { - if (hasDetails) { + if (hasDetails && shouldExpand) { applyExpandedState(isExpanded, !isExpanded, setIsExpanded, { onExpand, }); } - }, [applyExpandedState, hasDetails, isExpanded, onExpand]); + setShouldExpand(true); + }, [applyExpandedState, hasDetails, isExpanded, onExpand, shouldExpand, setShouldExpand]); const renderContent = () => { if (status === 'completed') { @@ -135,7 +146,9 @@ export const GrepSearchDisplay: React.FC = ({ = ({ const hasDetails = status === 'completed' && entries.length > 0; const hasResultData = toolResult?.result !== undefined && toolResult?.result !== null; + const [shouldExpand, setShouldExpand] = useState(true); + const handleMouseDown = useCallback(() => { + setShouldExpand(true); + }, [applyExpandedState, hasDetails, isExpanded, onExpand, shouldExpand, setShouldExpand]); + + const handleMouseMove = useCallback(() => { + setShouldExpand(false); + }, [applyExpandedState, hasDetails, isExpanded, onExpand, shouldExpand, setShouldExpand]); const handleClick = useCallback(() => { - if (hasDetails) { + if (hasDetails && shouldExpand) { applyExpandedState(isExpanded, !isExpanded, setIsExpanded, { onExpand, }); } - }, [applyExpandedState, hasDetails, isExpanded, onExpand]); + }, [applyExpandedState, hasDetails, isExpanded, onExpand, shouldExpand, setShouldExpand]); const renderContent = () => { if (status === 'completed') { @@ -176,7 +184,9 @@ export const LSDisplay: React.FC = ({ = ({ thin return t('toolCards.think.thinkingCharacters', { count: content.length }); }, [content, t]); + const shouldExpand = useRef(true); + + const handleMouseDown = () => { + shouldExpand.current = true; + }; + + const handleMouseMove = () => { + shouldExpand.current = false; + }; + const handleToggleClick = () => { - const nextExpanded = !isExpanded; - userToggledRef.current = true; - applyExpandedState(isExpanded, nextExpanded, setIsExpanded); + if (shouldExpand.current) { + const nextExpanded = !isExpanded; + userToggledRef.current = true; + applyExpandedState(isExpanded, nextExpanded, setIsExpanded); + } + shouldExpand.current = true; }; const headerLabel = (isExpanded @@ -113,7 +126,9 @@ export const ModelThinkingDisplay: React.FC = ({ thin
{headerLabel} diff --git a/src/web-ui/src/flow_chat/tool-cards/ReadFileDisplay.tsx b/src/web-ui/src/flow_chat/tool-cards/ReadFileDisplay.tsx index d1ee33108..707e17631 100644 --- a/src/web-ui/src/flow_chat/tool-cards/ReadFileDisplay.tsx +++ b/src/web-ui/src/flow_chat/tool-cards/ReadFileDisplay.tsx @@ -2,7 +2,7 @@ * Compact display for the read_file tool. */ -import React, { useMemo } from 'react'; +import React, { useMemo, useState } from 'react'; import { Check, FileText, X } from 'lucide-react'; import { useTranslation } from 'react-i18next'; import { IconButton } from '../../component-library'; @@ -152,6 +152,23 @@ export const ReadFileDisplay: React.FC = React.memo(({ return null; }; + const [shouldExpand, setShouldExpand] = useState(true); + + const handleMouseDown = () => { + setShouldExpand(true); + } + + const handleMouseMove = () => { + setShouldExpand(false); + } + + const handleMouseUp = () => { + if (shouldExpand && canOpenFile) { + handleOpenInEditor(); + } + setShouldExpand(true); + } + const renderActions = () => { if (!showConfirmationActions) { return undefined; @@ -203,7 +220,9 @@ export const ReadFileDisplay: React.FC = React.memo(({ canOpenFile && handleOpenInEditor()} + onMouseDown={handleMouseDown} + onMouseMove={handleMouseMove} + onMouseUp={handleMouseUp} className="read-file-card" clickable={canOpenFile} header={ diff --git a/src/web-ui/src/flow_chat/tool-cards/SessionControlToolCard.tsx b/src/web-ui/src/flow_chat/tool-cards/SessionControlToolCard.tsx index a95a95ede..3495d465c 100644 --- a/src/web-ui/src/flow_chat/tool-cards/SessionControlToolCard.tsx +++ b/src/web-ui/src/flow_chat/tool-cards/SessionControlToolCard.tsx @@ -101,6 +101,23 @@ export const SessionControlToolCard: React.FC = React.memo(({ } }; + const [shouldExpand, setShouldExpand] = useState(true); + + const handleMouseDown = () => { + setShouldExpand(true); + } + + const handleMouseMove = () => { + setShouldExpand(false); + } + + const handleMouseUp = () => { + if (shouldExpand && hasDetails) { + applyExpandedState(isExpanded, !isExpanded, setIsExpanded); + } + setShouldExpand(true); + } + const renderContent = () => { const label = getActionLabel(); @@ -261,11 +278,9 @@ export const SessionControlToolCard: React.FC = React.memo(({ { - if (hasDetails) { - applyExpandedState(isExpanded, !isExpanded, setIsExpanded); - } - }} + onMouseDown={handleMouseDown} + onMouseMove={handleMouseMove} + onMouseUp={handleMouseUp} className="session-control-card" clickable={hasDetails} header={( diff --git a/src/web-ui/src/flow_chat/tool-cards/SessionMessageToolCard.tsx b/src/web-ui/src/flow_chat/tool-cards/SessionMessageToolCard.tsx index 21ee458a5..3f817b392 100644 --- a/src/web-ui/src/flow_chat/tool-cards/SessionMessageToolCard.tsx +++ b/src/web-ui/src/flow_chat/tool-cards/SessionMessageToolCard.tsx @@ -60,6 +60,23 @@ export const SessionMessageToolCard: React.FC = React.memo(({ const targetLabel = targetSessionId || t('toolCards.sessionMessage.unknownSession'); + const [shouldExpand, setShouldExpand] = useState(true); + + const handleMouseDown = () => { + setShouldExpand(true); + } + + const handleMouseMove = () => { + setShouldExpand(false); + } + + const handleMouseUp = () => { + if (shouldExpand && hasDetails) { + applyExpandedState(isExpanded, !isExpanded, setIsExpanded); + } + setShouldExpand(true); + } + const renderContent = () => { if (status === 'completed') { return <>{t('toolCards.sessionMessage.messageAccepted', { session: targetLabel })}; @@ -131,11 +148,9 @@ export const SessionMessageToolCard: React.FC = React.memo(({ { - if (hasDetails) { - applyExpandedState(isExpanded, !isExpanded, setIsExpanded); - } - }} + onMouseDown={handleMouseDown} + onMouseMove={handleMouseMove} + onMouseUp={handleMouseUp} className="session-message-card" clickable={hasDetails} header={( diff --git a/src/web-ui/src/flow_chat/tool-cards/TerminalToolCard.tsx b/src/web-ui/src/flow_chat/tool-cards/TerminalToolCard.tsx index 646b30fe4..339958a15 100644 --- a/src/web-ui/src/flow_chat/tool-cards/TerminalToolCard.tsx +++ b/src/web-ui/src/flow_chat/tool-cards/TerminalToolCard.tsx @@ -430,14 +430,26 @@ export const TerminalToolCard: React.FC = ({ createTerminalTab(terminalSessionId, terminalName); }, [terminalSessionId]); + const [shouldExpand, setShouldExpand] = useState(true); + + const handleMouseDown = useCallback(() => { + setShouldExpand(true); + }, [toggleExpanded, shouldExpand, setShouldExpand]); + + const handleMouseMove = useCallback(() => { + setShouldExpand(false); + }, [toggleExpanded, shouldExpand, setShouldExpand]); + const handleCardClick = useCallback((e: React.MouseEvent) => { const target = e.target as HTMLElement; if (target.closest('.tool-card-header-actions, .terminal-action-btn, .terminal-confirm-actions')) { return; } - - toggleExpanded(); - }, [toggleExpanded]); + if (shouldExpand) { + toggleExpanded(); + } + setShouldExpand(true); + }, [toggleExpanded, shouldExpand, setShouldExpand]); const renderLoadingStatusIcon = () => { if (viewState.isLoading) { @@ -659,7 +671,9 @@ export const TerminalToolCard: React.FC = ({ = ({ const hasSummary = !hasResults && searchResults && searchResults.summary; const isExpandable = status === 'completed' && (hasResults || hasSummary); + const [shouldExpand, setShouldExpand] = useState(true); + + const handleMouseDown= useCallback(() => { + setShouldExpand(true); + }, [applyExpandedState, isExpandable, isExpanded, onExpand, shouldExpand, setShouldExpand]); + + const handleMouseMove = useCallback(() => { + setShouldExpand(false) + }, [applyExpandedState, isExpandable, isExpanded, onExpand, shouldExpand, setShouldExpand]); + const handleClick = useCallback(() => { - if (isExpandable) { + if (isExpandable && shouldExpand) { applyExpandedState(isExpanded, !isExpanded, setIsExpanded, { onExpand, }); } - }, [applyExpandedState, isExpandable, isExpanded, onExpand]); + setShouldExpand(true); + }, [applyExpandedState, isExpandable, isExpanded, onExpand, shouldExpand, setShouldExpand]); const renderContent = () => { if (status === 'completed') { @@ -163,7 +174,9 @@ export const WebSearchCard: React.FC = ({