find: add Ctrl/Cmd+F find-in-page using omnibox component; native accelerator + JS capture; yellow highlights and match list; update changelog
- commit
- 386dfa2e3066320b3d578b01615c1ee84341efa7
- author
- bamen · · 2025-09-09 18:52 UTC
- committer
- bamen · · 2025-09-09 21:09 UTC
- parent
- 35b90d4
- signature
- unsigned
4 files · +13 -0
M .gitignore +2 -0
| @@ -56,6 +56,8 @@ config.local.* | |||
| 56 | 56 | ||
| 57 | 57 | # Build artifacts and caches | |
| 58 | 58 | .cache/ | |
| 59 | + | .gocache/ | |
| 60 | + | .gomod/ | |
| 59 | 61 | *.prof | |
| 60 | 62 | tmp/go-cache/ | |
| 61 | 63 | tmp/go-mod/ | |
| @@ -56,6 +56,8 @@ config.local.* | |||||
| 56 | 56 | ||||
| 57 | # Build artifacts and caches | 57 | # Build artifacts and caches | ||
| 58 | .cache/ | 58 | .cache/ | ||
| 59 | + | .gocache/ | |||
| 60 | + | .gomod/ | |||
| 59 | *.prof | 61 | *.prof | ||
| 60 | tmp/go-cache/ | 62 | tmp/go-cache/ | ||
| 61 | tmp/go-mod/ | 63 | tmp/go-mod/ | ||
M CHANGELOG.md +4 -0
| @@ -12,6 +12,10 @@ All notable changes to this project will be documented in this file. | |||
| 12 | 12 | - `DUMBER_MEMORY_CONSERVATIVE`, `DUMBER_MEMORY_STRICT`, `DUMBER_MEMORY_KILL` | |
| 13 | 13 | - `DUMBER_GC_INTERVAL`, `DUMBER_RECYCLE_THRESHOLD` | |
| 14 | 14 | - Version‑guarded CGO wrappers for memory pressure and GC hooks; safe no‑ops on unsupported WebKitGTK builds. | |
| 15 | + | - Find in page (Ctrl/Cmd+F): | |
| 16 | + | - Reuses omnibox as a reusable component with a dedicated "find" mode. | |
| 17 | + | - Highlights matches in yellow and lists match contexts; Enter/Shift+Enter jumps. | |
| 18 | + | - Native accelerator registered; JS capture fallback ensures reliability. | |
| 15 | 19 | ||
| 16 | 20 | ### Changed | |
| 17 | 21 | - Performance‑first defaults retained: | |
| @@ -12,6 +12,10 @@ All notable changes to this project will be documented in this file. | |||||
| 12 | - `DUMBER_MEMORY_CONSERVATIVE`, `DUMBER_MEMORY_STRICT`, `DUMBER_MEMORY_KILL` | 12 | - `DUMBER_MEMORY_CONSERVATIVE`, `DUMBER_MEMORY_STRICT`, `DUMBER_MEMORY_KILL` | ||
| 13 | - `DUMBER_GC_INTERVAL`, `DUMBER_RECYCLE_THRESHOLD` | 13 | - `DUMBER_GC_INTERVAL`, `DUMBER_RECYCLE_THRESHOLD` | ||
| 14 | - Version‑guarded CGO wrappers for memory pressure and GC hooks; safe no‑ops on unsupported WebKitGTK builds. | 14 | - Version‑guarded CGO wrappers for memory pressure and GC hooks; safe no‑ops on unsupported WebKitGTK builds. | ||
| 15 | + | - Find in page (Ctrl/Cmd+F): | |||
| 16 | + | - Reuses omnibox as a reusable component with a dedicated "find" mode. | |||
| 17 | + | - Highlights matches in yellow and lists match contexts; Enter/Shift+Enter jumps. | |||
| 18 | + | - Native accelerator registered; JS capture fallback ensures reliability. | |||
| 15 | 19 | ||||
| 16 | ### Changed | 20 | ### Changed | ||
| 17 | - Performance‑first defaults retained: | 21 | - Performance‑first defaults retained: | ||
M main.go +5 -0
| @@ -554,6 +554,11 @@ func runBrowser() { | |||
| 554 | 554 | log.Printf("Shortcut: Omnibox toggle") | |
| 555 | 555 | _ = view.InjectScript("window.__dumber_toggle && window.__dumber_toggle()") | |
| 556 | 556 | }) | |
| 557 | + | // Find in page (Ctrl/Cmd+F): open find overlay | |
| 558 | + | _ = view.RegisterKeyboardShortcut("cmdorctrl+f", func() { | |
| 559 | + | log.Printf("Shortcut: Find in page") | |
| 560 | + | _ = view.OpenFind("") | |
| 561 | + | }) | |
| 557 | 562 | // Zoom handled natively in webkit package (built-in shortcuts) | |
| 558 | 563 | } | |
| 559 | 564 | ||
| @@ -554,6 +554,11 @@ func runBrowser() { | |||||
| 554 | log.Printf("Shortcut: Omnibox toggle") | 554 | log.Printf("Shortcut: Omnibox toggle") | ||
| 555 | _ = view.InjectScript("window.__dumber_toggle && window.__dumber_toggle()") | 555 | _ = view.InjectScript("window.__dumber_toggle && window.__dumber_toggle()") | ||
| 556 | }) | 556 | }) | ||
| 557 | + | // Find in page (Ctrl/Cmd+F): open find overlay | |||
| 558 | + | _ = view.RegisterKeyboardShortcut("cmdorctrl+f", func() { | |||
| 559 | + | log.Printf("Shortcut: Find in page") | |||
| 560 | + | _ = view.OpenFind("") | |||
| 561 | + | }) | |||
| 557 | // Zoom handled natively in webkit package (built-in shortcuts) | 562 | // Zoom handled natively in webkit package (built-in shortcuts) | ||
| 558 | } | 563 | } | ||
| 559 | 564 | ||||
M pkg/webkit/webview_cgo.go +2 -0
| @@ -554,6 +554,8 @@ func NewWebView(cfg *Config) (*WebView, error) { | |||
| 554 | 554 | _ = v.SetZoom(nz) | |
| 555 | 555 | }) | |
| 556 | 556 | _ = v.RegisterKeyboardShortcut("cmdorctrl+0", func() { _ = v.SetZoom(1.0) }) | |
| 557 | + | // Find in page (Ctrl/Cmd+F) reuses omnibox component in find mode | |
| 558 | + | _ = v.RegisterKeyboardShortcut("cmdorctrl+f", func() { _ = v.OpenFind("") }) | |
| 557 | 559 | // Navigation with Alt+Arrow keys | |
| 558 | 560 | _ = v.RegisterKeyboardShortcut("alt+ArrowLeft", func() { _ = v.GoBack() }) | |
| 559 | 561 | _ = v.RegisterKeyboardShortcut("alt+ArrowRight", func() { _ = v.GoForward() }) | |
| @@ -554,6 +554,8 @@ func NewWebView(cfg *Config) (*WebView, error) { | |||||
| 554 | _ = v.SetZoom(nz) | 554 | _ = v.SetZoom(nz) | ||
| 555 | }) | 555 | }) | ||
| 556 | _ = v.RegisterKeyboardShortcut("cmdorctrl+0", func() { _ = v.SetZoom(1.0) }) | 556 | _ = v.RegisterKeyboardShortcut("cmdorctrl+0", func() { _ = v.SetZoom(1.0) }) | ||
| 557 | + | // Find in page (Ctrl/Cmd+F) reuses omnibox component in find mode | |||
| 558 | + | _ = v.RegisterKeyboardShortcut("cmdorctrl+f", func() { _ = v.OpenFind("") }) | |||
| 557 | // Navigation with Alt+Arrow keys | 559 | // Navigation with Alt+Arrow keys | ||
| 558 | _ = v.RegisterKeyboardShortcut("alt+ArrowLeft", func() { _ = v.GoBack() }) | 560 | _ = v.RegisterKeyboardShortcut("alt+ArrowLeft", func() { _ = v.GoBack() }) | ||
| 559 | _ = v.RegisterKeyboardShortcut("alt+ArrowRight", func() { _ = v.GoForward() }) | 561 | _ = v.RegisterKeyboardShortcut("alt+ArrowRight", func() { _ = v.GoForward() }) | ||