fix(ui): retain dialog focus and copy text through the native clipboard (#2403)

Refs #2381

- Dialogs: an editor opened behind a dialog (e.g. the new file's tab behind "Add File to Git") could take keyboard focus after the dialog opened, so Enter/Escape went to the editor. Dialogs now keep focus while they are the top layer.
- Copy Reference failed with NotAllowedError: the WebView clipboard requires user activation, which native menu actions and async work (resolving the reference) outlive. Text copies now go through a native clipboard_write_text command (NSPasteboard / Win32 / GTK), and every navigator.clipboard.writeText caller uses the shared helper. The command is allowed in restricted (untrusted) projects like the other clipboard commands.
Цей коміт міститься в:
l0ng-ai authored and GitHub committed 2026-11-10 03:25:21 +08:00
1 джерело 6b4be5a15b
коміт 4392ffacf6
51 files changed
+406 -88

No files matched your search

+2 -1
Переглянути файл
@@ -4,6 +4,7 @@
* the diff viewer (`vcs.openDiff`; `diff/` shows its review threads). Long operations run
* one at a time and are shown in the tool window's banner (`useGhBusy`), cancellable.
*/
import { writeClipboardText } from "@/platform/clipboard";
import { Channel } from "@tauri-apps/api/core";
import { create } from "zustand";
import { withChain, type DiffData } from "@/features/vcs/diffInput";
@@ -178,7 +179,7 @@ export function openInBrowser(url: string): Promise<void> {
/** "Copy Pull Request URL". */
export async function copyUrl(url: string): Promise<void> {
await navigator.clipboard?.writeText(url);
await writeClipboardText(url);
}
/**