@aiti-ai/aiti-git-review 0.2.11 → 0.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,10 @@
9
9
  * 构建:node tools/build-client.mjs (或 npm run build:client)
10
10
  */
11
11
  import { __setCtx, apiUrl } from "./host-shim";
12
+ // aiti-folder client components are inlined here (WorkspaceDropdown in the task picker) and
13
+ // carry their own host-shim copy — hand it the same ctx so their apiUrl (basePath) and i18n
14
+ // resolve against this extension's runtime instead of falling back to defaults.
15
+ import { __setCtx as setAitiFolderCtx } from "../../../aiti-folder/client/src/host-shim";
12
16
  import { seedDockDefault } from "../../../_shared/ext-float-dock";
13
17
  import { api, G, setGRCtx } from "./shared";
14
18
  import { openFromToolbar, ReviewWork, DockReviewWork, GrEyeIcon } from "./git-review-app";
@@ -18,6 +22,7 @@ export default function register(ctx: Record<string, any>) {
18
22
  seedDockDefault("aiti-git-review:workspace", "right-panel");
19
23
  // 重要:必须在任何 JSX 组件渲染前调用(host-shim 模块级持 ctx)
20
24
  __setCtx(ctx);
25
+ setAitiFolderCtx(ctx);
21
26
  setGRCtx(ctx);
22
27
 
23
28
  // 懒加载 v2 M3批②:声明式条目(无 render)
@@ -11,6 +11,7 @@ import { dedupeFetch } from "../../../_shared/dedupe-fetch";
11
11
  import { api, jsonBody, G, lastSeg, statusIcon, statusColor, overlay, pickerCard, segBtn, segOn, btnPrimary } from "./shared";
12
12
  // aiti-folder 工作区切换器(与 session-manager 同法:构建期内联复用同一组件)
13
13
  import { WorkspaceDropdown } from "../../../aiti-folder/client/src/folder-switcher";
14
+ import { isDirectoryPickerTarget } from "../../../_shared/directory-picker-dom";
14
15
  import { displayCwd } from "../../../aiti-folder/client/src/lib";
15
16
 
16
17
  /** 版本选项(分支/tag/远程) */
@@ -237,7 +238,10 @@ export function TaskPicker({ onClose, onOpenTask, presetRepo, fallbackRepo, onDo
237
238
  }, []);
238
239
  useEffect(() => {
239
240
  if (!wsOpen) return;
240
- const h = (e: MouseEvent) => { if (wsBoxRef.current && !wsBoxRef.current.contains(e.target as Node)) setWsOpen(false); };
241
+ const h = (e: MouseEvent) => {
242
+ // The picker dialog is portaled to <body>; a press inside it is not "outside" this switcher.
243
+ if (wsBoxRef.current && !wsBoxRef.current.contains(e.target as Node) && !isDirectoryPickerTarget(e.target)) setWsOpen(false);
244
+ };
241
245
  document.addEventListener("mousedown", h);
242
246
  return () => document.removeEventListener("mousedown", h);
243
247
  }, [wsOpen]);