Main file browser component with virtualized collection rendering.
Main Browser Component
The primary public API for rendering the file browser.
render_file_browser
def render_file_browser( items:list, # Current filtered/sorted FileInfo list config:FileBrowserConfig, # Browser configuration state:BrowserState, # Browser state (path, selection) listing:DirectoryListing, # Raw directory listing (for path bar) vc_config:VirtualCollectionConfig, # Virtual collection config vc_state:VirtualCollectionState, # Virtual collection state vc_ids:VirtualCollectionHtmlIds, # Virtual collection HTML IDs vc_btn_ids:VirtualCollectionButtonIds, # Virtual collection button IDs urls:VirtualCollectionUrls, # Virtual collection URL bundle render_cell:Callable, # Cell render callback navigate_url:str, # URL for directory navigation refresh_url:str, # URL for refresh path_input_url:str='', # URL for path input (optional) home_path:str='', # Home directory path hx_target:Optional=None, # Override HTMX target (default: container_id) keyboard_system:Optional=None, # Pre-built keyboard system (when None, builds internally via build_file_browser_keyboard_system) manager_label:Optional=None, # Label for the internally-built ZoneManager (ignored when keyboard_system is provided))->Any: # Complete file browser component
Render the complete file browser with virtualized collection.
When keyboard_system is provided, the caller has built the system upstream (typically init_router) and owns the underlying ZoneManager. When None, builds the system internally via build_file_browser_keyboard_system using manager_label. The internally-built path preserves pre-L7 behavior for direct render_file_browser callers that don’t need the manager handoff.
build_file_browser_keyboard_system
def build_file_browser_keyboard_system( vc_ids:VirtualCollectionHtmlIds, # Virtual collection HTML IDs vc_btn_ids:VirtualCollectionButtonIds, # Virtual collection button IDs urls:VirtualCollectionUrls, # Virtual collection URL bundle manager_label:Optional=None, # Human-readable label for the ZoneManager (used as the modal section header when rendered as a child))->KeyboardSystem: # Complete rendered KeyboardSystem (carries .manager for hierarchical hints handoff)
Build the file browser’s KeyboardSystem standalone.
Lifts the manager construction out of render_file_browser so the underlying ZoneManager is accessible via KeyboardSystem.manager — consumers wiring this system as a child in a hierarchy pass that manager to render_keyboard_hints_modal(..., child_managers=[...]) so the modal’s section header reads as manager_label instead of the technical system_id.
The composition (VC nav actions + Backspace→parent-dir extra action + apply_nav_sync on the action buttons) matches what render_file_browser used to build internally pre-L7. Callers who want the default behavior don’t need to call this directly — render_file_browser builds the system internally when its keyboard_system parameter is None.