Skip to content

Phase 1: GUI search completion — clear button, Enter key, safe UTF-8, tests - #286

Open
mark-e-deyoung wants to merge 1 commit into
masterfrom
feat/gui-search-tabs
Open

Phase 1: GUI search completion — clear button, Enter key, safe UTF-8, tests#286
mark-e-deyoung wants to merge 1 commit into
masterfrom
feat/gui-search-tabs

Conversation

@mark-e-deyoung

Copy link
Copy Markdown
Contributor

Phase 1: Search & Refresh Polish

Completes the in-progress search feature with proper UX.

Changes

  • Clear Search button () — appears next to search edit when text is present, clears and restores tree
  • Enter key handler — pressing Enter in the search edit triggers immediate refresh
  • Placeholder text — "Search windows..." shown when empty (EM_SETCUEBANNER)
  • Safe UTF-8 conversionWideCharToMultiByte replaces unsafe iterator cast
  • Error handling — checks ok field in search response, graceful disconnect message
  • Button visibility — clear button auto-shown/hidden based on search state

Test Coverage (2 new doctest cases)

  • ViewModel search returns filtered matches — verifies FakeTransport search contract
  • ViewModel handles failed search gracefully — verifies error pathway

Build Verification

  • Zero warnings (MSVC Release, /W3 /WX)
  • All 4 GUI viewmodel tests passing (2 original + 2 new)
  • Current branch: feat/gui-search-tabs

Files Changed

  • clients/gui/src/gui_main.cpp — search UI controls, Enter key, clearSearch(), safe conversion
  • clients/gui/tests/test_viewmodel.cpp — FakeTransport search handler, 2 search tests

…version, tests

- Add ID_CLEAR_SEARCH_BTN with ✕ owner-draw button next to search edit
- Add WM_KEYDOWN handler for Enter key in search edit (immediate refresh)
- Add clearSearch() method: empties edit, restores full tree, hides clear button
- Add EM_SETCUEBANNER placeholder text: Search windows...
- Fix wide string conversion: use WideCharToMultiByte instead of iterator cast
- Fix search error handling: check ok field, graceful disconnect message
- Add 2 new doctest test cases: search returns matches, failed search handling
- Reposition daemon indicator to avoid overlap with clear button
- Build: zero warnings, all tests passing

Co-Authored-By: Claude <noreply@anthropic.com>
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.

1 participant