fix(ui): address final Greptile follow-up
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
bd6d07d0b4
commit
ad1ef6a8c6
3 changed files with 13 additions and 2 deletions
|
|
@ -228,7 +228,11 @@ export function createBufferedTextFileWriter(filePath: string, maxBufferedBytes
|
||||||
stream.destroy();
|
stream.destroy();
|
||||||
await pendingWrite.catch(() => {});
|
await pendingWrite.catch(() => {});
|
||||||
if (existsSync(filePath)) {
|
if (existsSync(filePath)) {
|
||||||
unlinkSync(filePath);
|
try {
|
||||||
|
unlinkSync(filePath);
|
||||||
|
} catch {
|
||||||
|
// Preserve the original backup failure if temporary file cleanup also fails.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,13 @@ describe("keyboardShortcuts helpers", () => {
|
||||||
expect(hasBlockingShortcutDialog(document.createElement("div"))).toBe(false);
|
expect(hasBlockingShortcutDialog(document.createElement("div"))).toBe(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("ignores non-dialog elements that happen to be aria-modal", () => {
|
||||||
|
const root = document.createElement("div");
|
||||||
|
root.innerHTML = `<section aria-modal="true"></section>`;
|
||||||
|
|
||||||
|
expect(hasBlockingShortcutDialog(root)).toBe(false);
|
||||||
|
});
|
||||||
|
|
||||||
it("archives only the first clean y press", () => {
|
it("archives only the first clean y press", () => {
|
||||||
const button = document.createElement("button");
|
const button = document.createElement("button");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export function isKeyboardShortcutTextInputTarget(target: EventTarget | null): b
|
||||||
}
|
}
|
||||||
|
|
||||||
export function hasBlockingShortcutDialog(root: ParentNode = document): boolean {
|
export function hasBlockingShortcutDialog(root: ParentNode = document): boolean {
|
||||||
return !!root.querySelector("[role='dialog'], [aria-modal='true']");
|
return !!root.querySelector("[role='dialog'][aria-modal='true']");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isModifierOnlyKey(key: string): boolean {
|
export function isModifierOnlyKey(key: string): boolean {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue