fix(search): make the search popups draggable (#625)

Find in Files, Replace in Files and Search Everywhere have no window title bar, so they could not be moved off the editor underneath. Dialogs can now be dragged from any element marked `data-dialog-drag`: the headers of those search popups, the title of any titled popup, and the existing window title bars and alert bodies, which now use the same mark. Controls inside a handle never start a drag.

Also waits for a review thread inlay in a test where it can mount a tick later.

Co-authored-by: a-rookie-of-C-language <[email protected]>
Цей коміт міститься в:
arookieofcтаa-rookie-of-C-language authored and GitHub committed 2026-11-01 08:13:15 +08:00
1 джерело 95e79116d1
коміт 0bf597c2fd
5 files changed
+53 -10

No files matched your search

+2 -1
Переглянути файл
@@ -216,7 +216,8 @@ describe("review threads in a pull request diff", () => {
expect(right.contains(t1)).toBe(true);
expect(t1.closest(".cm-lineInlay")!.previousElementSibling?.textContent).toBe("line three");
expect(right.querySelectorAll(".cm-reviewControl-toggle")).toHaveLength(2);
expect(inlay("T2")).not.toBeNull();
// Each thread's inlay mounts in its own effect, so T2 may land a tick after T1.
await waitFor(() => expect(inlay("T2")).not.toBeNull());
act(() => setReviewDiffSettings({ threadsView: "unresolved" }));
await waitFor(() => expect(inlay("T2")).toBeNull());
+1 -1
Переглянути файл
@@ -394,7 +394,7 @@ function SearchEverywhereDialog() {
aria-label={tx("Search Everywhere")}
className={styles.dialog}
>
<div className={styles.header}>
<div className={styles.header} data-dialog-drag="">
<div role="tablist" aria-label={tx("Search scope")} className={styles.tabs} onKeyDown={onTabKey}>
{TABS.map((t) => (
<button
+1 -1
Переглянути файл
@@ -483,7 +483,7 @@ function FindInFilesDialog() {
className={styles.dialog}
>
<div className={styles.root} onKeyDown={onKeyDown}>
<header className={styles.header}>
<header className={styles.header} data-dialog-drag="">
<span className={styles.title}>{s.replace ? tx("Replace in Files") : tx("Find in Files")}</span>
<span className={styles.status} aria-live="polite">
{state.status === "searching" || state.status === "validating" ? <Spinner size={12} /> : null}