From cf444540443cb7f5c77f5db08c511dd76e7b82ae Mon Sep 17 00:00:00 2001
From: John <qingyi.xjh@antgroup.com>
Date: Fri, 20 Dec 2024 10:25:13 +0800
Subject: [PATCH] fix: inline chat lower level than findwidget (#4251)

---
 .../src/browser/widget/inline-chat/inline-content-widget.tsx | 4 ++--
 packages/core-browser/src/design/rule.ts                     | 5 +++++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/packages/ai-native/src/browser/widget/inline-chat/inline-content-widget.tsx b/packages/ai-native/src/browser/widget/inline-chat/inline-content-widget.tsx
index a01a07ffb5..c53a8687fd 100644
--- a/packages/ai-native/src/browser/widget/inline-chat/inline-content-widget.tsx
+++ b/packages/ai-native/src/browser/widget/inline-chat/inline-content-widget.tsx
@@ -1,7 +1,7 @@
 import React, { useCallback, useEffect, useMemo, useState } from 'react';
 
 import { Autowired, INJECTOR_TOKEN, Injectable, Injector } from '@opensumi/di';
-import { IAIInlineChatService, StackingLevelStr, useInjectable } from '@opensumi/ide-core-browser';
+import { IAIInlineChatService, StackingLevel, useInjectable } from '@opensumi/ide-core-browser';
 import { AIAction } from '@opensumi/ide-core-browser/lib/components/ai-native';
 import { InteractiveInput } from '@opensumi/ide-core-browser/lib/components/ai-native/interactive-input/index';
 import { MenuNode } from '@opensumi/ide-core-browser/lib/menu/next/base';
@@ -261,7 +261,7 @@ export class AIInlineContentWidget extends ReactInlineContentWidget {
   override getDomNode(): HTMLElement {
     const domNode = super.getDomNode();
     requestAnimationFrame(() => {
-      domNode.style.zIndex = StackingLevelStr.OverlayTop;
+      domNode.style.zIndex = (StackingLevel.FindWidget - 1).toString();
     });
     return domNode;
   }
diff --git a/packages/core-browser/src/design/rule.ts b/packages/core-browser/src/design/rule.ts
index 2f48bbcc52..d41ff3bc07 100644
--- a/packages/core-browser/src/design/rule.ts
+++ b/packages/core-browser/src/design/rule.ts
@@ -35,6 +35,11 @@ export const StackingLevel = Object.freeze({
 
   EditorFloatingContainer: 20,
 
+  /**
+   * Find 控件的 zIndex 是 25
+   */
+  FindWidget: 25,
+
   // #region 中级弹窗区域
   Popup: 100,
   // #endregion