Skip to content

Fix bookmark typeahead not rendering suggestions#3420

Open
G-Gamja wants to merge 1 commit into
wavetermdev:mainfrom
G-Gamja:fix/bookmark-typeahead-suggestions
Open

Fix bookmark typeahead not rendering suggestions#3420
G-Gamja wants to merge 1 commit into
wavetermdev:mainfrom
G-Gamja:fix/bookmark-typeahead-suggestions

Conversation

@G-Gamja

@G-Gamja G-Gamja commented Jul 8, 2026

Copy link
Copy Markdown

Summary

  • fetchBookmarkSuggestions was a plain class method passed by reference to
    BlockHeaderSuggestionControl (fetchSuggestions={model.fetchBookmarkSuggestions}).
    Calling it as a bare function lost its this binding, so this.env threw a
    TypeError inside the method. The rejection had no .catch, so fetched
    never flipped to true and neither the bookmark list nor the empty state
    ever rendered — pressing Cmd+O just showed an empty input with nothing
    below it.
  • The "Open bookmarks.json" button in the empty state pointed at
    presets/bookmarks.json, a path nothing else reads from or writes to.
    Bookmarks are actually loaded from <configDir>/bookmarks.json. Clicking
    the button created a dead file that had no effect on the app.

Fix

  • Converted fetchBookmarkSuggestions to an arrow function class field so
    this stays bound to the WebViewModel instance regardless of how it's
    invoked.
  • Fixed the "Open bookmarks.json" button to point at <configDir>/bookmarks.json.

fetchBookmarkSuggestions was a plain class method passed by
reference to BlockHeaderSuggestionControl, so calling it lost
its `this` binding and threw on `this.env`, silently rejecting
the suggestions promise with no error handling. That kept
`fetched` false forever, so neither the list nor the empty
state ever rendered.

Also fixes the "Open bookmarks.json" button, which pointed at
presets/bookmarks.json instead of the actual config path used
to load bookmarks.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

This change modifies frontend/app/view/webview/webview.tsx in two ways: it converts the WebViewModel's fetchBookmarkSuggestions from an async class method into an async arrow-function class field to ensure proper this-binding when used as a callback, and it updates the bookmarks JSON file path in openBookmarksJson from configDir/presets/bookmarks.json to configDir/bookmarks.json.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: fixing bookmark typeahead suggestion rendering.
Description check ✅ Passed The description accurately describes the code changes and the bug they address.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@G-Gamja G-Gamja changed the title Fix bookmark typeahead: unbound this and wrong edit path Fix bookmark typeahead not rendering suggestions Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants