Compare commits

...
1 Commits
Author SHA1 Message Date
6b532ad0b8 fix(frontend): address CodeRabbit follow-ups from #3276 and #3303 (#3311)
Co-authored-by: FandacqkaCorp <275647464+FandacqkaCorp@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-31 08:16:35 -05:00
4 changed files with 40 additions and 0 deletions

No files matched your search

@@ -63,4 +63,13 @@ describe("ContextMenu in advanced search", () => {
expect(toggle(false)).toBe(true);
expect(toggle(true)).toBe(false);
});
it("hides Share when nothing is selected, since the results listing has no folder to share", () => {
const share = (isAdvancedSearch, selectedCount) =>
computed.showShareAction.call({ showLimitedOptions: false, isAdvancedSearch, selectedCount, showShare: true });
expect(share(true, 0)).toBe(false);
expect(share(true, 1)).toBe(true);
expect(share(true, 2)).toBe(false);
expect(share(false, 0)).toBe(true);
});
});
+2
View File
@@ -423,6 +423,8 @@ export default {
},
showShareAction() {
if (this.showLimitedOptions) return false;
// Advanced search results have no folder of their own to share, only the selected results do.
if (this.isAdvancedSearch && this.selectedCount === 0) return false;
return this.selectedCount <= 1 && this.showShare;
},
showSendToApp() {
@@ -0,0 +1,21 @@
import { afterEach, describe, expect, it, vi } from "vitest";
import { createApp, h } from "vue";
vi.mock("@/store", () => ({ state: { sources: {} }, mutations: { showPrompt: vi.fn() } }));
vi.mock("@/store/eventBus", () => ({ eventBus: { on: vi.fn(), off: vi.fn() } }));
import PathPickerButton from "./PathPickerButton.vue";
describe("PathPickerButton keyboard access", () => {
let app;
afterEach(() => app?.unmount());
it("can be focused and is exposed as a button, so its Enter and Space handlers can run", () => {
const el = document.createElement("div");
app = createApp({ render: () => h(PathPickerButton, { path: "/", source: "" }) });
app.config.globalProperties.$t = (key) => key;
app.mount(el);
const picker = el.querySelector(".unified-path-picker");
expect(picker.getAttribute("tabindex")).toBe("0");
expect(picker.getAttribute("role")).toBe("button");
});
});
@@ -1,6 +1,8 @@
<template>
<div
:aria-label="resolvedAriaLabel"
tabindex="0"
role="button"
class="searchContext clickable button unified-path-picker"
@click="openPicker"
@keydown.enter.prevent="openPicker"
@@ -170,4 +172,10 @@ export default {
overflow-wrap: break-word;
box-sizing: border-box;
}
/* .button removes the outline, so keyboard focus needs its own indicator. */
.unified-path-picker:focus-visible {
outline: 2px solid var(--primaryColor);
outline-offset: 2px;
}
</style>