updated 2026-11-26·4 min read
Companion Settings & Visual Search
NDJSON named-pipe sync, global hotkey and mouse chord conflict detection, filename template expansion, WinRT toast notifications, and Google Lens / Cloud Vision search.
Building a full Windows 11 settings window inside immediate-mode egui looks weirdly off next to PowerToys, and leaving a .NET 10 WinUI 3 window parked in the tray just to flip a toggle burns RAM for nothing. Having fresnel.exe spawn fresnel-settings.exe (ui/Fresnel.Settings) on demand over two unidirectional NDJSON named pipes (--d2s-pipe and --s2d-pipe) gives you real Fluent controls while letting the daemon stay near working_set_pin_mb = 24 and letting .NET exit completely on close. Config edits flush to %LOCALAPPDATA%\Fresnel\settings.json (CURRENT_SCHEMA_VERSION = 1).
Companion Settings Screens




Hotkeys, Templates, and Visual Search
Bindings and Hook Traps
One WH_KEYBOARD_LL hook alone couldn’t handle every shortcut: elevated windows silently swallow Win+Alt+V under UIPI, and taking a RwLock inside the low-level hook risks Windows silently unhooking you after its ~300 ms timeout. So global shortcuts split between a lock-free WH_KEYBOARD_LL path (PrintScreen / Win+Shift+S), GlobalHotKeyManager (global-hotkey v0.10 for Win+Alt+V), and a 30-second foreground-PID-checked suppression window while recording new bindings in Settings. crates/core/src/bindings.rs also checks for duplicate chords and OS-reserved shortcuts before registering anything.
Storage and Filename Templates
crates/core/src/template.rs expands date and counter tokens into filenames, strips invalid path characters, clamps stems to Windows directory limits, and picks collision-free PNG names without needing the old disk-spooled capture drawer.
Visual Search Post-Bing Retirement
Following Microsoft’s August 11, 2025 retirement of Bing Search APIs, crates/search implements GoogleLensClient alongside an early CloudVisionClient wrapper.
Detached Lens threads gave me plenty of headaches first: cancelling with Esc still let an in-flight upload hijack browser focus later, an early build streamed raw BGRA bytes labeled image/png, and egui::Area::new(Id::unique(...)) regenerated IDs every frame so one flyout click opened the browser three times. Even centroid ray-cast snapping teleported lasso endpoints 70.7 px across the box on near-zero vectors until alpha crossfade snapping replaced it.
- Google Lens Handoff (
GoogleLensClient): Encodes the cropped frame to PNG (AtomicBool-cancellable), POSTs multipartencoded_imagedata tohttps://lens.google.com/v3/upload, and opens theLocationredirect URL (falling back tohttps://lens.google.com/search?ep=fresnel). - Cloud Vision Stub (
CloudVisionClient): Early REST wrapper targetingWEB_DETECTION(1,000free lookups/month,$3.50per1,000paid); currently returns mock strings when unauthenticated and["Web Entity 1"]on HTTP 200 without parsing response JSON, and isn’t wired into Settings.
Settings Schema Defaults, Internal Symbols, and Toast Bitmask
- General (
crates/core/src/settings.rs):ThemePreference(System,Dark,Light),launch_at_startup = false,show_tray_icon = true,working_set_pin_mb = 24. - Capture:
SnipCompletionMode(InstantSniporShowControlBar),magnetic_snap_enabled = true(12.0 px),show_crosshair_hud = true,veil_opacity = 0.45,SelectionBorderStyle(AccentColor,MonochromeWhite,Custom). - OCR & Redact:
preserve_visual_lines = true,indent_spaces = 2,marquee_live_highlight = true;RedactToolDefault(Solid,Blur,Mosaic). - Toast Notifications:
ToastButtonMaskbitmask controlsCOPY(1 << 0),OPEN_FILE(1 << 1),OPEN_FOLDER(1 << 2), andVISUAL_SEARCH(1 << 3) buttons alongside364x180Hero toast previews managed byToastCacheIndex(5 entries / 16 MB cap). - Bindings & Templates (
crates/core/src/bindings.rs,template.rs): ValidatesHotkeyBinding,OverlayMouseBinding,PostSnipBinding, andRedactMouseBindingviadetect_hotkey_conflictsandis_os_reserved_hotkey; formatsFilenameTemplateviaLocalDateTimeParts,sanitize_component,clamp_stem_for_directory, andcreate_unique_png_file.
Return to Fresnel Overview or inspect Zero-Copy Capture & OCR Pipeline.