[Bug]: WebBookmarks typeahead (Alt+O / Cmd+O) is always empty due to unbound `fetchBookmarkSuggestions`
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 75/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- electron, typescript
- Lĩnh vực
- developer-experience, frontend
Hướng nghiên cứu
Bắt đầu tại frontend/app/view/webview/webview.tsx, ở BookmarkTypeahead và WebViewModel.fetchBookmarkSuggestions; lần theo cách callback đến SuggestionControlInner và xác nhận ngữ cảnh this được xử lý như thế nào. Kiểm tra đường dẫn tệp dấu trang mà nút sử dụng có khớp với đường dẫn backend đọc hay không. Hoàn tất khi các dấu trang đã cấu hình xuất hiện trong typeahead Alt+O/Cmd+O và nút mở tệp dấu trang đã cấu hình.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Current Behavior
When pressing Alt+O (or Cmd+O on macOS) inside a web widget to open bookmarks, the bookmark typeahead modal appears with the search input, but the dropdown list below it remains completely blank, even when ~/.config/waveterm/bookmarks.json contains valid bookmarks.
Inspecting DevTools inside the web widget reveals an unhandled promise rejection:
TypeError: Cannot read properties of undefined (reading 'env') at fetchBookmarkSuggestions.
Expected Behavior
Configured bookmarks from ~/.config/waveterm/bookmarks.json should appear in the typeahead list when pressing Alt+O / Cmd+O.
Steps To Reproduce
- Add a valid bookmark to
~/.config/waveterm/bookmarks.json:
{
"bookmark@github": {
"url": "https://github.com",
"title": "GitHub"
}
}
- Open Wave Terminal and create a web block.
- Focus the web block and press Alt+O (Windows/Linux) or Cmd+O (macOS).
- The search box appears, but the list underneath is empty.
- Open DevTools for the web widget to observe the uncaught TypeError in the console.
Wave Version
v0.14.5
Platform
Windows
OS Version/Distribution
Windows 11
Architecture
x64
Anything else?
Root Cause
In frontend/app/view/webview/webview.tsx:
fetchBookmarkSuggestionsis defined as an instance method onWebViewModel:
async fetchBookmarkSuggestions(
query: string,
reqContext: SuggestionRequestContext
): Promise<FetchSuggestionsResponse> {
const result = await this.env.rpc.FetchSuggestionsCommand(TabRpcClient, {
suggestiontype: "bookmark",
query,
widgetid: reqContext.widgetid,
reqnum: reqContext.reqnum,
});
return result;
}
- In BookmarkTypeahead (around line 781), it is passed to BlockHeaderSuggestionControl without binding this:
fetchSuggestions={model.fetchBookmarkSuggestions}
When invoked inside SuggestionControlInner, this is undefined, causing this.env.rpc to throw TypeError: Cannot read properties of undefined (reading 'env').
- In SuggestionControlInner, the promise rejection has no .catch() handler, so setFetched(true) is never reached, leaving the dropdown unrendered.
Proposed Fix
- Bind the method when passing it as a callback in BookmarkTypeahead:
- fetchSuggestions={model.fetchBookmarkSuggestions}
+ fetchSuggestions={model.fetchBookmarkSuggestions.bind(model)}
- (Bonus) Line 758 hardcodes ${env.electron.getConfigDir()}/presets/bookmarks.json for the "Open bookmarks.json" button, whereas the backend reads from
${env.electron.getConfigDir()}/bookmarks.json:
- const path = `${env.electron.getConfigDir()}/presets/bookmarks.json`;
+ const path = `${env.electron.getConfigDir()}/bookmarks.json`;
- Ngôn ngữ chính
- Go
- Star
- 22.7k
- Fork
- 1.2k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của wavetermdev/waveterm
-
bug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
wavetermdev/waveterm#3587 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
pwsh: encodeEnvVarsForPowerShell rejects Windows-standard env var names like ProgramFiles(x86), breaking wsh token on every pwsh blockCó thể đã có người làm @vortsghost2025 đã nhận 63 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
wavetermdev/waveterm#3481 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
wavetermdev/waveterm#3435 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
wavetermdev/waveterm#3432 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
wavetermdev/waveterm#3431 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của wavetermdev/waveterm
Issue tương tự
-
bug category:backup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
LanternOps/breeze#11743 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
kubescape/synchronizer#208 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Azure/azure-storage-azcopy#3681 ·
Maintainer thường phản hồi trong vòng 2 ngày