# source_browser


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Grouping Selector

## Source Browser Item Model

------------------------------------------------------------------------

<a
href="https://github.com/cj-mills/cjm-transcript-source-select/blob/main/cjm_transcript_source_select/components/source_browser.py#L98"
target="_blank" style="float:right; font-size:smaller">source</a>

### SourceBrowserItem

``` python

def SourceBrowserItem(
    item_type:str, group_key:str='', group_display:str='', group_count:int=0, grouping_mode:str='',
    record:Optional=None, is_selected:bool=False
)->None:

```

*Item in the source browser virtual collection (header or record).*

------------------------------------------------------------------------

<a
href="https://github.com/cj-mills/cjm-transcript-source-select/blob/main/cjm_transcript_source_select/components/source_browser.py#L111"
target="_blank" style="float:right; font-size:smaller">source</a>

### build_source_items

``` python

def build_source_items(
    transcriptions:List, # Available transcription records
    selected_sources:List, # Currently selected sources
    grouping_mode:str='media_path', # Grouping mode: "media_path" or "batch_id"
)->List: # Flat list with interleaved headers and records

```

*Build the items list for the source browser virtual collection.*

------------------------------------------------------------------------

<a
href="https://github.com/cj-mills/cjm-transcript-source-select/blob/main/cjm_transcript_source_select/components/source_browser.py#L147"
target="_blank" style="float:right; font-size:smaller">source</a>

### is_source_item_skippable

``` python

def is_source_item_skippable(
    item:SourceBrowserItem, # Item to check
)->bool: # True if item is a group header (cursor should skip)

```

*Predicate for virtual collection is_skippable parameter.*

## Virtual Collection Column Definitions & Cell Renderer

------------------------------------------------------------------------

<a
href="https://github.com/cj-mills/cjm-transcript-source-select/blob/main/cjm_transcript_source_select/components/source_browser.py#L283"
target="_blank" style="float:right; font-size:smaller">source</a>

### render_source_empty

``` python

def render_source_empty(
    
)->Any: # Empty state component

```

*Render empty state when no transcription sources are available.*

------------------------------------------------------------------------

<a
href="https://github.com/cj-mills/cjm-transcript-source-select/blob/main/cjm_transcript_source_select/components/source_browser.py#L270"
target="_blank" style="float:right; font-size:smaller">source</a>

### create_source_cell_renderer

``` python

def create_source_cell_renderer(
    toggle_url:str='', # URL for toggling source selection
    select_all_url:str='', # URL for selecting all in a group
)->Callable: # render_cell(item: SourceBrowserItem, ctx: CellRenderContext) -> Any

```

*Create a render_cell callback for the source browser virtual
collection.*

## Source Browser (Virtual Collection)
