Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(chat): exempt fixed menu anchors from render containment

david7f658ce2cf48
diff --git a/apps/desktop/src/renderer/components/chat/ChatAudioCard.tsx b/apps/desktop/src/renderer/components/chat/ChatAudioCard.tsx
index acbcf254ae..dbf1d9f9ef 100644
--- a/apps/desktop/src/renderer/components/chat/ChatAudioCard.tsx
+++ b/apps/desktop/src/renderer/components/chat/ChatAudioCard.tsx
@@ -380,6 +380,7 @@ export function ChatAudioCard({ track, sessionId }: ChatAudioCardProps) {
<DropdownMenuTrigger asChild>
<span
aria-hidden
+ data-fixed-menu-anchor
style={{
position: 'fixed',
left: menuPos?.x ?? 0,
diff --git a/apps/desktop/src/renderer/components/chat/ChatImageView.tsx b/apps/desktop/src/renderer/components/chat/ChatImageView.tsx
index b09d283de3..e39862e2b8 100644
--- a/apps/desktop/src/renderer/components/chat/ChatImageView.tsx
+++ b/apps/desktop/src/renderer/components/chat/ChatImageView.tsx
@@ -233,6 +233,7 @@ export function ChatImageView({
<DropdownMenuTrigger asChild>
<span
aria-hidden
+ data-fixed-menu-anchor
style={{
position: 'fixed',
left: menuPos?.x ?? 0,
diff --git a/apps/desktop/src/renderer/components/chat/ChatSoundEffectCard.tsx b/apps/desktop/src/renderer/components/chat/ChatSoundEffectCard.tsx
index aac1f502c6..9479f04740 100644
--- a/apps/desktop/src/renderer/components/chat/ChatSoundEffectCard.tsx
+++ b/apps/desktop/src/renderer/components/chat/ChatSoundEffectCard.tsx
@@ -243,6 +243,7 @@ export function ChatSoundEffectCard({ track, sessionId }: ChatSoundEffectCardPro
<DropdownMenuTrigger asChild>
<span
aria-hidden
+ data-fixed-menu-anchor
style={{
position: 'fixed',
left: menuPos?.x ?? 0,
diff --git a/apps/desktop/src/renderer/components/chat/ChatVideoView.tsx b/apps/desktop/src/renderer/components/chat/ChatVideoView.tsx
index 033e7bd1c3..c3ae31b7b5 100644
--- a/apps/desktop/src/renderer/components/chat/ChatVideoView.tsx
+++ b/apps/desktop/src/renderer/components/chat/ChatVideoView.tsx
@@ -155,6 +155,7 @@ export function ChatVideoView({ src, filename, variant, sessionId }: ChatVideoVi
<DropdownMenuTrigger asChild>
<span
aria-hidden
+ data-fixed-menu-anchor
style={{
position: 'fixed',
left: menuPos?.x ?? 0,
diff --git a/apps/desktop/src/renderer/components/chat/GhostToolCard.tsx b/apps/desktop/src/renderer/components/chat/GhostToolCard.tsx
index ce820c72e9..785b21808f 100644
--- a/apps/desktop/src/renderer/components/chat/GhostToolCard.tsx
+++ b/apps/desktop/src/renderer/components/chat/GhostToolCard.tsx
@@ -807,6 +807,7 @@ function GhostCardCanvas({
<DropdownMenuTrigger asChild>
<span
aria-hidden
+ data-fixed-menu-anchor
style={{
position: 'fixed',
left: imgMenu.x,
@@ -836,6 +837,7 @@ function GhostCardCanvas({
<DropdownMenuTrigger asChild>
<span
aria-hidden
+ data-fixed-menu-anchor
style={{
position: 'fixed',
left: audioMenu.x,
diff --git a/apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsx b/apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsx
index 6fb5667680..5078afb326 100644
--- a/apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsx
+++ b/apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsx
@@ -878,6 +878,7 @@ function LightboxImage({
<DropdownMenuTrigger asChild>
<span
aria-hidden
+ data-fixed-menu-anchor
style={{
position: 'fixed',
left: menuPos?.x ?? 0,
diff --git a/apps/desktop/src/renderer/components/chat/UserMessage.tsx b/apps/desktop/src/renderer/components/chat/UserMessage.tsx
index 76dad242ad..1400ef1db0 100644
--- a/apps/desktop/src/renderer/components/chat/UserMessage.tsx
+++ b/apps/desktop/src/renderer/components/chat/UserMessage.tsx
@@ -287,6 +287,7 @@ function UserAttachmentChip({
<DropdownMenuTrigger asChild>
<span
aria-hidden
+ data-fixed-menu-anchor
style={{
position: 'fixed',
left: saveMenuPos?.x ?? 0,
diff --git a/apps/desktop/src/renderer/components/chat/useFileChipContextMenu.tsx b/apps/desktop/src/renderer/components/chat/useFileChipContextMenu.tsx
index 88eeca34bd..a6ce0a8a66 100644
--- a/apps/desktop/src/renderer/components/chat/useFileChipContextMenu.tsx
+++ b/apps/desktop/src/renderer/components/chat/useFileChipContextMenu.tsx
@@ -287,6 +287,7 @@ export function useFileChipContextMenu({
<DropdownMenuTrigger asChild>
<span
aria-hidden
+ data-fixed-menu-anchor
style={{
position: 'fixed',
left: menuPos?.x ?? 0,
diff --git a/apps/desktop/src/renderer/components/chat/useOpenWithMenu.tsx b/apps/desktop/src/renderer/components/chat/useOpenWithMenu.tsx
index b61819f7ae..8335a30f22 100644
--- a/apps/desktop/src/renderer/components/chat/useOpenWithMenu.tsx
+++ b/apps/desktop/src/renderer/components/chat/useOpenWithMenu.tsx
@@ -147,6 +147,7 @@ export function useOpenWithMenu({ sessionId }: { sessionId?: string }): UseOpenW
<DropdownMenuTrigger asChild>
<span
aria-hidden
+ data-fixed-menu-anchor
style={{
position: 'fixed',
left: state?.x ?? 0,
diff --git a/apps/desktop/src/renderer/styles/globals.css b/apps/desktop/src/renderer/styles/globals.css
index 078dcdbef1..5e70d14722 100644
--- a/apps/desktop/src/renderer/styles/globals.css
+++ b/apps/desktop/src/renderer/styles/globals.css
@@ -1161,6 +1161,15 @@ body.resizing-pane [data-ghost-webview] {
contain-intrinsic-size: auto 240px;
}
+/* Fixed-position menu triggers must keep the viewport as their containing
+ block. Their menu content is portaled to body, but Radix still measures the
+ zero-size trigger inside the render item. Opt only those items out of the
+ containment boundary; plain text items keep the render-skip optimization. */
+.msg-stream-items > *:has([data-fixed-menu-anchor]) {
+ content-visibility: visible;
+ contain-intrinsic-size: none;
+}
+
/* 意识卡片 running 扫光(卡槽③):主机盖在意识画布上的斜向光带。
transform-only(规则 7 compositor-only);仅 running 挂载,settle 即卸,
历史卡永远静止(净化器已剥意识自带动画,动感统一由主机供给)。 */