Skip to content

fix: add Open button to knowledge vault rows with Obsidian deep link fallback (#2909) - #3014

Merged
senamakel merged 5 commits into
tinyhumansai:mainfrom
HariNayan:fix/workspace-vault-obsidian-2909
May 30, 2026
Merged

senamakel merged 5 commits into
tinyhumansai:mainfrom
HariNayan:fix/workspace-vault-obsidian-2909

Conversation

@HariNayan

@HariNayan HariNayan commented May 30, 2026 •

Copy link
Copy Markdown
Contributor

fix: add Open button to knowledge vault rows with Obsidian deep link fallback

Closes #2909

Summary

Each knowledge vault row in VaultPanel.tsx now has an Open button. Clicking it:

  1. Tries the Obsidian deep link — obsidian://open?path=<root_path>
  2. Falls back to revealing the folder in the OS file manager via revealPath()
  3. Shows a toast on success, fallback info, or error with details
    Previously, vault rows only offered Sync and Remove — users had no way to open their vault folder, leaving them at a dead end especially when trying to inspect or edit generated markdown files.

Problem

The workspace vault shown in Intelligence did not open in Obsidian even when Obsidian was installed. The existing "View Vault" button in ObsidianVaultSection.tsx only handled the memory tree content vault (the wiki), not user-added knowledge vaults listed in VaultPanel.tsx.

Solution

  • Added handleOpenVault(rootPath) function in VaultPanel.tsx
  • Added Open button to each vault row's action area (alongside Sync / Remove)
  • Used existing openUrl and revealPath utilities from app/src/utils/openUrl.ts
  • Added i18n keys to en.ts for all toast messages and button label
  • Added unit tests in VaultPanel.test.tsx covering all three code paths

Files Changed

File Change
app/src/components/intelligence/VaultPanel.tsx Added handleOpenVault, Open button in vault row
app/src/utils/openUrl.ts Confirmed revealPath export is present
app/src/i18n/en.ts Added vault.open.* i18n keys
app/src/components/intelligence/VaultPanel.test.tsx Added 3 tests for open, fallback, and error paths

Acceptance Criteria

  • Clicking Open on a vault row launches Obsidian when installed
  • Falls back to OS file manager (Finder / Explorer) when Obsidian is unavailable
  • Shows a clear error toast if both methods fail
  • i18n strings used throughout — no hardcoded UI text
  • Unit tests cover success, fallback, and error scenarios

Local Validation

# Typecheck
pnpm typecheck
 
# Formatting
pnpm format:check
 
# Unit tests
pnpm test

All checks passed locally. No Rust changes were made so cargo check is not required for this PR.

Notes

  • No new dependencies introduced
  • Uses existing tauri-plugin-opener via revealItemInDir — no Tauri config changes needed
  • Behaviour is cross-platform: macOS (Finder), Windows (Explorer), Linux (file manager)
  • The existing ObsidianVaultSection.tsx "View Vault" button is intentionally untouched — it serves a different vault (the memory wiki)

Summary by CodeRabbit

  • New Features

    • Open vaults directly in Obsidian with automatic fallback to the file manager; toasts for success, fallback, and error states.
  • Tests

    • Added UI tests covering the open-vault flow, verifying deep-link success, fallback reveal, and error toast scenarios.
  • Localization

    • Added vault-open translations across many languages.
  • UI Improvements

    • Disable Open while syncing or removing; added test IDs for related controls.

Review Change Stack

…p link + reveal fallback

Each vault row in the Knowledge vaults panel now has an Open button that:
1. Tries the Obsidian deep link (obsidian://open?path=...)
2. Falls back to revealPath() to open the folder in OS file manager
3. Shows a toast on success, fallback, or error

Closes tinyhumansai#2909
@HariNayan
HariNayan requested a review from a team May 30, 2026 08:43
@coderabbitai

coderabbitai Bot commented May 30, 2026 •

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ca0d49cb-ada2-4f93-9fdb-ac4b0c63ac69

📥 Commits

Reviewing files that changed from the base of the PR and between 4f7f1aa and d15c6ff.

📒 Files selected for processing (1)
  • app/src/components/intelligence/VaultPanel.tsx

📝 Walkthrough

Walkthrough

Adds a vault-open flow: try Obsidian deep link via openUrl, fall back to revealPath on error, show success/fallback/error toasts, wire the vault open button (with testids/disable states), add Vitest tests and translation keys across locales.

Changes

Vault Open Feature

Layer / File(s) Summary
Vault open handler, UI button, and translations
app/src/components/intelligence/VaultPanel.tsx, app/src/lib/i18n/*.ts
Imports openUrl and revealPath, implements handleOpenVault(rootPath) to attempt an Obsidian deep link and fall back to revealing the path; shows distinct vault.* toast messages for deep-link success, reveal fallback success, and reveal failure. Wires open button to handler, adds data-testid and disable logic.
Vault open test coverage
app/src/components/intelligence/VaultPanel.test.tsx
Adds Vitest mocks and resets for openUrl and revealPath. Adds three tests: deep-link success (info toast), deep-link failure → reveal fallback (info toast), and both methods failing (error toast).

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant VaultPanel
  participant openUrl
  participant revealPath
  participant Toast
  User->>VaultPanel: Click vault Open button
  VaultPanel->>openUrl: openUrl(rootPath) (Obsidian deep link)
  alt Deep link succeeds
    openUrl-->>VaultPanel: resolved
    VaultPanel->>Toast: show vault.openSuccess
  else Deep link throws
    openUrl-->>VaultPanel: throws
    VaultPanel->>revealPath: revealPath(rootPath)
    alt Reveal succeeds
      revealPath-->>VaultPanel: resolved
      VaultPanel->>Toast: show vault.openFallback
    else Reveal fails
      revealPath-->>VaultPanel: throws
      VaultPanel->>Toast: show vault.openError
    end
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • senamakel
  • graycyrus

Poem

🐰 I hopped to the vault with a curious spin,
I clicked "Open" and let the deep link begin,
If Obsidian sleeps, the folder will show,
Toasts cheer success, fallback, or woe,
A tiny rabbit nods: the vault's within!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and specifically describes the main change: adding an Open button to vault rows with Obsidian deep link fallback behavior.
Linked Issues check ✅ Passed The PR fully addresses all coded acceptance criteria from #2909: implements Open button with Obsidian deep link, fallback to file manager reveal, error handling with toast notifications, i18n translations for multiple languages, and unit test coverage for success/fallback/error paths.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the Open button feature for vaults: component logic, UI integration, i18n translations, and tests. No unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added memory Memory store, memory tree, recall, summarization, and embeddings in src/openhuman/memory/. working A PR that is being worked on by the team. labels May 30, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/src/lib/i18n/en.ts`:
- Around line 4143-4146: The new i18n keys added in app/src/lib/i18n/en.ts —
'vault.openButton', 'vault.openSuccess', 'vault.openFallback', and
'vault.openError' — must be added with real non-English translations to every
non-English locale file (ar.ts, bn.ts, de.ts, es.ts, fr.ts, hi.ts, id.ts, it.ts,
ko.ts, pl.ts, pt.ts, ru.ts, zh-CN.ts); update each locale module by inserting
these four keys with correct localized strings (not English), following the
existing file export/formatting and quoting conventions so the keys exist in all
locales and builds/tests will pass.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 836c3e19-80de-4c50-a441-91e19bd39929

📥 Commits

Reviewing files that changed from the base of the PR and between 3556842 and cfc0b25.

📒 Files selected for processing (3)
  • app/src/components/intelligence/VaultPanel.test.tsx
  • app/src/components/intelligence/VaultPanel.tsx
  • app/src/lib/i18n/en.ts

Comment thread app/src/lib/i18n/en.ts
Comment on lines +4143 to +4146
'vault.openButton': 'Open',
'vault.openSuccess': 'Opened in Obsidian',
'vault.openFallback': 'Obsidian not found — opened in file manager',
'vault.openError': "Couldn't open vault",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Add locale-parity entries for the new vault.open* keys

The four new keys were added in English only. Per repo i18n rules, these keys must also be added to all non-English locale files with real translations in the same PR.

As per coding guidelines: “When adding or changing i18n keys in app/src/lib/i18n/en.ts, add the same key with a real, correct translation (not English) to every non-English locale file: ar.ts, bn.ts, de.ts, es.ts, fr.ts, hi.ts, id.ts, it.ts, ko.ts, pl.ts, pt.ts, ru.ts, zh-CN.ts”.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/lib/i18n/en.ts` around lines 4143 - 4146, The new i18n keys added in
app/src/lib/i18n/en.ts — 'vault.openButton', 'vault.openSuccess',
'vault.openFallback', and 'vault.openError' — must be added with real
non-English translations to every non-English locale file (ar.ts, bn.ts, de.ts,
es.ts, fr.ts, hi.ts, id.ts, it.ts, ko.ts, pl.ts, pt.ts, ru.ts, zh-CN.ts); update
each locale module by inserting these four keys with correct localized strings
(not English), following the existing file export/formatting and quoting
conventions so the keys exist in all locales and builds/tests will pass.

@coderabbitai coderabbitai Bot added the feature Net-new user-facing capability or product behavior. label May 30, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/src/lib/i18n/ar.ts`:
- Around line 3862-3865: The four i18n keys 'vault.openButton',
'vault.openSuccess', 'vault.openFallback', and 'vault.openError' are still in
English in ar.ts; replace their values with correct Arabic translations (not
English) that match the UI context—for example provide a concise translation for
the button label (Open), the success message (Opened in Obsidian), the fallback
notice (Obsidian not found — opened in file manager), and the error message
(Couldn't open vault); ensure the Arabic strings use proper wording and
punctuation and follow existing translation style in the file.

In `@app/src/lib/i18n/fr.ts`:
- Around line 4019-4022: Replace the English strings for the i18n keys
'vault.openButton', 'vault.openSuccess', 'vault.openFallback', and
'vault.openError' in fr.ts with proper French translations (e.g., 'Ouvrir' for
open, 'Ouvert dans Obsidian' for opened in Obsidian, 'Obsidian introuvable —
ouvert dans le gestionnaire de fichiers' for the fallback, and 'Impossible
d\'ouvrir le coffre' for the error) so the new vault open flow is localized for
French users; update the values for those exact keys in app/src/lib/i18n/fr.ts.

In `@app/src/lib/i18n/id.ts`:
- Around line 3946-3949: The Indonesian locale file contains English
placeholders for the vault strings; replace the values for the keys
'vault.openButton', 'vault.openSuccess', 'vault.openFallback', and
'vault.openError' in id.ts with proper Indonesian translations (e.g., natural,
concise phrases conveying "Open", "Opened in Obsidian", "Obsidian not found —
opened in file manager", and "Couldn't open vault") so the UI is fully localized
and consistent with other non-English locales.

In `@app/src/lib/i18n/ko.ts`:
- Around line 3898-3901: The four vault-related i18n entries
('vault.openButton', 'vault.openSuccess', 'vault.openFallback',
'vault.openError') are still in English; update their values to correct Korean
translations (e.g., for button label, success message for Obsidian, fallback
message for file manager, and the error message) so the ko locale contains real
Korean strings instead of English placeholders.

In `@app/src/lib/i18n/ru.ts`:
- Around line 3966-3969: The four i18n keys 'vault.openButton',
'vault.openSuccess', 'vault.openFallback', and 'vault.openError' in ru.ts are
still in English; replace their values with correct Russian translations (e.g.,
for button label, success message for Obsidian, fallback message for file
manager, and error message) so the new vault-open flow is fully localized,
keeping the keys unchanged and using appropriate Russian text for each string.

In `@app/src/lib/i18n/zh-CN.ts`:
- Around line 3741-3744: 在 app/src/lib/i18n/zh-CN.ts 中将这四个英文文案替换为对应的简体中文翻译:把
'vault.openButton' 的值改为 '打开','vault.openSuccess' 改为 '已在 Obsidian
中打开','vault.openFallback' 改为 '未找到 Obsidian — 已在文件管理器中打开',以及 'vault.openError' 改为
'无法打开保管库';确保键名不变且保存文件以使本地化生效。
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 851f271d-f177-4417-a846-4458edb9632e

📥 Commits

Reviewing files that changed from the base of the PR and between cfc0b25 and 9b86cf9.

📒 Files selected for processing (13)
  • app/src/lib/i18n/ar.ts
  • app/src/lib/i18n/bn.ts
  • app/src/lib/i18n/de.ts
  • app/src/lib/i18n/es.ts
  • app/src/lib/i18n/fr.ts
  • app/src/lib/i18n/hi.ts
  • app/src/lib/i18n/id.ts
  • app/src/lib/i18n/it.ts
  • app/src/lib/i18n/ko.ts
  • app/src/lib/i18n/pl.ts
  • app/src/lib/i18n/pt.ts
  • app/src/lib/i18n/ru.ts
  • app/src/lib/i18n/zh-CN.ts
✅ Files skipped from review due to trivial changes (7)
  • app/src/lib/i18n/it.ts
  • app/src/lib/i18n/bn.ts
  • app/src/lib/i18n/hi.ts
  • app/src/lib/i18n/de.ts
  • app/src/lib/i18n/pl.ts
  • app/src/lib/i18n/pt.ts
  • app/src/lib/i18n/es.ts

Comment thread app/src/lib/i18n/ar.ts Resolved
Comment thread app/src/lib/i18n/fr.ts Resolved
Comment thread app/src/lib/i18n/id.ts Resolved
Comment thread app/src/lib/i18n/ko.ts Resolved
Comment thread app/src/lib/i18n/ru.ts Resolved
Comment thread app/src/lib/i18n/zh-CN.ts Resolved
@HariNayan

Copy link
Copy Markdown
Contributor Author

The E2E failure in settings-channels-permissions.spec.ts is a pre-existing
flaky test — a react-joyride overlay intercepts the pointer event on the
Channels tab. This is unrelated to the vault open changes in this PR.

@senamakel

Copy link
Copy Markdown
Member

well done ser

@senamakel
senamakel merged commit a388a10 into tinyhumansai:main May 30, 2026
19 of 22 checks passed
senamakel pushed a commit to senamakel/openhuman that referenced this pull request Jun 6, 2026
senamakel pushed a commit to nocstah/openhuman that referenced this pull request Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Net-new user-facing capability or product behavior. memory Memory store, memory tree, recall, summarization, and embeddings in src/openhuman/memory/. working A PR that is being worked on by the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workspace vault does not open in Obsidian

2 participants