# NexusSearchBox

- File ID: file:igeyi7:nexussearchbox-razor
- Path: NexusReader.UI.Shared/Components/Atoms/NexusSearchBox.razor
- Role: ui-component
- Layer: frontend

## Purpose

A Blazor UI component that renders a search input, exposes parameters for placeholder/icon, tracks local search text, invokes a parent-provided search callback when Enter is pressed, and allows clearing the input.

## Key Details

Pressing Enter invokes OnSearch.InvokeAsync(SearchValue). ClearSearch sets SearchValue to empty, toggling IsActive and the 'active' CSS class. Component exposes Placeholder, IconClass, and OnSearch parameters.

## Symbols

- NexusSearchBox: A Blazor UI component that renders a search input, exposes parameters for placeholder/icon, tracks local search text, invokes a parent-provided search callback when Enter is pressed, and allows clearing the input.
- HandleKeyPress(): Handles keyboard input on the search box and triggers the OnSearch callback when Enter is pressed.
- ClearSearch(): Clears the local search input value.
- IsActive (getter): Computed property that indicates if the search input contains text; used to toggle CSS state.
- NexusSearchBox (component): Represents the search box component and its parameters/state for use in Razor UI.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Unresolved References

- call-target: self
- interaction-target: await OnSearch.InvokeAsync(SearchValue) - raises the search event to parent components.

## Coverage

- Symbols: 5
- Executable symbols: 3
- Executable symbols with control flow: 3
- Grounded edges: 5
- Unresolved references: 2
- Control-flow fragments: 3
- Unresolved jumps: 1
- Unsupported constructs: 0
- Control-flow coverage: 100%
- Required diagrams: 2
- Generated diagrams: 3

## Control Flow Fragments

- HandleKeyPress: 13 nodes, 14 edges, 1 jumps, 0 unsupported constructs
- ClearSearch: 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- IsActive (getter): 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs

## Diagrams

### NexusSearchBox Neighborhood

```mermaid
flowchart LR
    class_c49vab_nexussearchbox("NexusSearchBox")
    file_igeyi7_nexussearchbox_razor("NexusSearchBox")
    method_1p9w1qk_isactive_getter[["IsActive (getter)"]]
    method_1sx9yhe_clearsearch[["ClearSearch()"]]
    method_j1tqds_handlekeypress[["HandleKeyPress()"]]
    type_1tp07fo_nexussearchbox_component[/"NexusSearchBox (component)"/]
```

### NexusSearchBox Execution Overview

```mermaid
flowchart TD
    class_c49vab_nexussearchbox("NexusSearchBox")
    method_1p9w1qk_isactive_getter[["IsActive (getter)"]]
    method_1sx9yhe_clearsearch[["ClearSearch()"]]
    method_j1tqds_handlekeypress[["HandleKeyPress()"]]
    unresolved_unresolved_1dtlz91_interaction_target{"Unresolved: await OnSearch.InvokeAsync(SearchValue) - raises the search event to parent components."}
    unresolved_unresolved_1p0z3es_call_target{"Unresolved: OnSearch.InvokeAsync"}
    class_c49vab_nexussearchbox -->|contains| method_1p9w1qk_isactive_getter
    class_c49vab_nexussearchbox -->|contains| method_1sx9yhe_clearsearch
    class_c49vab_nexussearchbox -->|contains| method_j1tqds_handlekeypress
    class_c49vab_nexussearchbox -->|unresolved interaction| unresolved_unresolved_1dtlz91_interaction_target
    method_j1tqds_handlekeypress -->|unresolved call| unresolved_unresolved_1p0z3es_call_target
```

### HandleKeyPress() Control Flow

```mermaid
flowchart TD
    method_j1tqds_handlekeypress__call_31_OnSearch_InvokeAsync[["OnSearch.InvokeAsync"]]
    method_j1tqds_handlekeypress__action_29_guard_clause_29__condition{"e.Key == \\"Enter\\""}
    method_j1tqds_handlekeypress__action_29_guard_clause_29__false("no-op")
    method_j1tqds_handlekeypress__action_29_guard_clause_29__merge("merge")
    method_j1tqds_handlekeypress__action_29_guard_clause_29__true("invoke callback")
    method_j1tqds_handlekeypress__action_29_handlekeypress_branch_29_0__condition{"e.Key == \\"Enter\\""}
    method_j1tqds_handlekeypress__action_29_handlekeypress_branch_29_0__false("false")
    method_j1tqds_handlekeypress__action_29_handlekeypress_branch_29_0__merge("merge")
    method_j1tqds_handlekeypress__action_29_handlekeypress_branch_29_0__true("true")
    method_j1tqds_handlekeypress__action_31_handlekeypress_await_31_1__await[["Waits for async work"]]
    method_j1tqds_handlekeypress__entry(["HandleKeyPress entry"])
    method_j1tqds_handlekeypress__action_31_external_call_31__linear("Invokes parent-provided event callback")
    method_j1tqds_handlekeypress__implicit_return(["return"])
    method_j1tqds_handlekeypress__action_29_guard_clause_29__condition -->|no-op| method_j1tqds_handlekeypress__action_29_guard_clause_29__false
    method_j1tqds_handlekeypress__action_29_guard_clause_29__condition -->|invoke callback| method_j1tqds_handlekeypress__action_29_guard_clause_29__true
    method_j1tqds_handlekeypress__action_29_guard_clause_29__false -->|next| method_j1tqds_handlekeypress__action_29_guard_clause_29__merge
    method_j1tqds_handlekeypress__action_29_guard_clause_29__merge -->|next| method_j1tqds_handlekeypress__action_31_handlekeypress_await_31_1__await
    method_j1tqds_handlekeypress__action_29_guard_clause_29__true -->|next| method_j1tqds_handlekeypress__action_29_guard_clause_29__merge
    method_j1tqds_handlekeypress__action_29_handlekeypress_branch_29_0__condition -->|false| method_j1tqds_handlekeypress__action_29_handlekeypress_branch_29_0__false
    method_j1tqds_handlekeypress__action_29_handlekeypress_branch_29_0__condition -->|true| method_j1tqds_handlekeypress__action_29_handlekeypress_branch_29_0__true
    method_j1tqds_handlekeypress__action_29_handlekeypress_branch_29_0__false -->|next| method_j1tqds_handlekeypress__action_29_handlekeypress_branch_29_0__merge
    method_j1tqds_handlekeypress__action_29_handlekeypress_branch_29_0__merge -->|next| method_j1tqds_handlekeypress__action_29_guard_clause_29__condition
    method_j1tqds_handlekeypress__action_29_handlekeypress_branch_29_0__true -->|next| method_j1tqds_handlekeypress__action_29_handlekeypress_branch_29_0__merge
    method_j1tqds_handlekeypress__action_31_external_call_31__linear -->|SearchValue string passed to the parent callback| method_j1tqds_handlekeypress__call_31_OnSearch_InvokeAsync
    method_j1tqds_handlekeypress__action_31_handlekeypress_await_31_1__await -->|next| method_j1tqds_handlekeypress__action_31_external_call_31__linear
    method_j1tqds_handlekeypress__call_31_OnSearch_InvokeAsync -->|return| method_j1tqds_handlekeypress__implicit_return
    method_j1tqds_handlekeypress__entry -->|next| method_j1tqds_handlekeypress__action_29_handlekeypress_branch_29_0__condition
```

## Diagram Validation

- Status: warn
- Warning: Control-flow extraction left 1 unresolved jumps.
