card_stack

Card stack UI operations — navigation, viewport, mode switching, and response builders

Response Builders

Shared helpers that assemble OOB response tuples for card stack operations.

  • Slots only — early returns and exit-split-mode (just viewport section swaps)
  • Navigation response — navigation and enter-split-mode (slots + progress + focus)

Enter/Exit Split Mode Handlers

Update Viewport Handler

Handler for updating the viewport when card count changes. Does a full viewport swap (outerHTML) since the number of slots changes.

Save Width Handler

Saves the card stack width to server state for persistence across page loads.

Router Initialization

Creates the card stack router with navigation, viewport, and split mode routes.


init_card_stack_router


def init_card_stack_router(
    state_store:SQLiteWorkflowStateStore, # The workflow state store
    workflow_id:str, # The workflow identifier
    prefix:str, # Route prefix (e.g., "/workflow/seg/card_stack")
    urls:SegmentationUrls, # URL bundle (populated after routes defined)
)->Tuple: # (router, route_dict)

Initialize card stack routes for segmentation.