Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(obsidian): handle missing vault path in ObsidianVaultSection

Steven Enamakelb3168192f838
diff --git a/app/src/components/intelligence/ObsidianVaultSection.tsx b/app/src/components/intelligence/ObsidianVaultSection.tsx
index 17411e4acb..011ef56d8f 100644
--- a/app/src/components/intelligence/ObsidianVaultSection.tsx
+++ b/app/src/components/intelligence/ObsidianVaultSection.tsx
@@ -64,35 +64,11 @@ export function ObsidianVaultSection({ contentRootAbs, onToast }: ObsidianVaultS
// #4278: set to the core host OS when the vault lives on a different-OS core
// host, so local actions (Reveal / Open in Obsidian) are disabled + explained.
const [crossHostOs, setCrossHostOs] = useState<string | null>(null);
- const containerRef = useRef<HTMLDivElement>(null);
-
- const closePanel = useCallback(() => setExpanded(false), []);
-
- // The guidance panel is a floating popover, so it needs explicit dismissal:
- // click outside the section or press Escape to close it. (Clicking the View
- // Vault button itself stays inside `containerRef`, so it re-runs the check
- // rather than dismissing — matching the panel's "click View Vault again" copy.)
- useLayoutEffect(() => {
- if (!expanded) return;
- const onPointerDown = (e: MouseEvent) => {
- if (containerRef.current && !containerRef.current.contains(e.target as Node)) {
- console.debug('[ui-flow][obsidian-vault] dismiss: outside click');
- setExpanded(false);
- }
- };
- const onKeyDown = (e: KeyboardEvent) => {
- if (e.key === 'Escape') {
- console.debug('[ui-flow][obsidian-vault] dismiss: escape');
- setExpanded(false);
- }
- };
- document.addEventListener('mousedown', onPointerDown);
- document.addEventListener('keydown', onKeyDown);
- return () => {
- document.removeEventListener('mousedown', onPointerDown);
- document.removeEventListener('keydown', onKeyDown);
- };
- }, [expanded]);
+ // Anchors the popover to the View Vault button. The outside-click guard
+ // (onPointerDownOutside below) uses this to recognize a re-click on the
+ // trigger as "inside" rather than "outside" — see the PopoverAnchor comment
+ // near the render for why a plain PopoverTrigger doesn't work here.
+ const anchorRef = useRef<HTMLButtonElement>(null);
/**
* Build + fire the `obsidian://` deep link.
diff --git a/app/src/pages/Feedback.test.tsx b/app/src/pages/Feedback.test.tsx
index 14b08b3c6a..b430236e4f 100644
--- a/app/src/pages/Feedback.test.tsx
+++ b/app/src/pages/Feedback.test.tsx
@@ -123,7 +123,10 @@ describe('<Feedback /> keeps the board in sync after local mutations', () => {
) {
await user.click(screen.getByLabelText(triggerLabel));
const listbox = await screen.findByRole('listbox');
- await user.click(within(listbox).getByRole('button', { name: optionName }));
+ // FeedbackFilterSelect now renders Radix `Select`, whose items carry
+ // role="option" (not "button" — that was the hand-rolled listbox this
+ // component used before adopting the shared primitive).
+ await user.click(within(listbox).getByRole('option', { name: optionName }));
}
async function submitFeature(user: ReturnType<typeof userEvent.setup>, title: string) {