Skip to content

Comments

feat: add contact search to command bar#96

Open
edospadoni wants to merge 1 commit intomainfrom
feat/command-bar-contact-search
Open

feat: add contact search to command bar#96
edospadoni wants to merge 1 commit intomainfrom
feat/command-bar-contact-search

Conversation

@edospadoni
Copy link
Member

Summary

  • Transform the command bar into a Spotlight-style search bar: users can type a name (or number) to search both the phonebook and local operators, navigate with arrow keys, and call with Enter
  • Operators appear first in results with avatar and presence indicator, deduped against phonebook entries
  • Dynamic window resize via new COMMAND_BAR_RESIZE IPC event, using full setBounds rect to avoid DPI drift on Windows multi-monitor setups

Changes

src/renderer/src/pages/CommandBarPage.tsx

  • Full rewrite: phonebook search via NethVoiceAPI.Phonebook.search() with 250ms debounce and stale-request cancellation
  • Local operator filtering matching SearchNumberBox.getFoundedOperators() logic
  • Avatar component with presence dot for operator results
  • Keyboard navigation (ArrowUp/Down, Enter, Escape)
  • useMemo for operator matching and result merging (avoids recomputation on hover/selection changes)
  • RegExp created once before filter loop instead of per-operator
  • Operators/avatars cached with 30s TTL and race-condition guard
  • Proper IPC listener cleanup (removeAllListeners) on effect re-run
  • Non-mutating mapContact (returns new object via spread)

src/main/classes/controllers/CommandBarController.ts

  • New resize() method with full {x, y, width, height} rect in setBounds
  • show() uses single setBounds call with full rect
  • hide() calls window.hide() directly (no degenerate setBounds(0,0))

src/main/lib/ipcEvents.ts

  • New handler for COMMAND_BAR_RESIZE IPC event

src/shared/constants.ts

  • New COMMAND_BAR_RESIZE entry in IPC_EVENTS enum

Translations

  • Updated placeholder in EN/IT: "Search contact or dial number..."

@github-actions
Copy link

Automatic builds from https://github.com/NethServer/nethlink/actions/runs/22346346541.
Commit: 35e93d9

Name Platform Link
win-app.exe Windows (x64) Link
macos-app-x64.dmg MacOS (x64) Link
macos-app-arm64.dmg MacOS (arm64) Link
linux-app.AppImage Linux (x64) Link

Transform the command bar from a simple phone dialer into a full
contact search bar. Users can now type a name to search the phonebook
and local operators, navigate results with arrow keys, and call with
Enter.

- Search phonebook via API with 250ms debounce and stale-request
  cancellation
- Local operator matching (name + extension) displayed first, deduped
  against phonebook results
- Operator results show avatar and presence indicator
- Keyboard navigation: ArrowUp/Down to select, Enter to call, Escape
  to close
- Dynamic window resize via new COMMAND_BAR_RESIZE IPC event with full
  setBounds rect (avoids DPI issues on Windows)
- Cache operators/avatars with 30s TTL to avoid redundant API calls
- Memoize expensive computations (operator filtering, result merging)
- Fix IPC listener leak: proper cleanup on effect re-run
- Non-mutating mapContact for safer data handling
@edospadoni edospadoni force-pushed the feat/command-bar-contact-search branch from 35e93d9 to 9d6c524 Compare February 24, 2026 10:43
@github-actions
Copy link

Automatic builds from https://github.com/NethServer/nethlink/actions/runs/22347365209.
Commit: 9d6c524

Name Platform Link
win-app.exe Windows (x64) Link
macos-app-x64.dmg MacOS (x64) Link
macos-app-arm64.dmg MacOS (arm64) Link
linux-app.AppImage Linux (x64) Link

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