build_tools.syllable_walk_tui.modules.packager.screen

Package screen for Syllable Walker TUI.

This screen provides a two-column workflow: - Left: editable metadata inputs that will be saved as JSON. - Right: packaging workflow (select run dir, include options, build ZIP).

Classes

PackageScreen

Full-screen UI for packaging selection outputs.

Module Contents

class build_tools.syllable_walk_tui.modules.packager.screen.PackageScreen(initial_run_dir=None)[source]

Bases: textual.screen.Screen

Full-screen UI for packaging selection outputs.

Users pick a run directory (_working/<timestamp>_<extractor>), choose which selection artifacts to include, and generate a ZIP archive that contains the selections plus an optional manifest.

The left column captures author-facing metadata that will be saved as a JSON file alongside the package output.

Keybindings:

Esc/q: Close the screen b: Browse for a run directory p: Build package

Initialize the package screen with optional initial run directory.

Parameters:

initial_run_dir (pathlib.Path | None) – Pre-selected run directory, if available

BINDINGS = [('escape', 'close_screen', 'Close'), ('q', 'close_screen', 'Close'), ('b', 'browse_run_dir',...

A list of key bindings.

DEFAULT_CSS = Multiline-String
Show Value
"""
    PackageScreen {
        background: $surface;
        padding: 1;
    }

    #package-main {
        layout: horizontal;
        width: 100%;
        height: 1fr;
    }

    .package-column {
        width: 1fr;
        height: 100%;
        border: solid $primary;
        padding: 1;
    }

    .panel-title {
        text-style: bold;
        color: $accent;
        margin-bottom: 1;
    }

    .section-header {
        text-style: bold;
        margin-top: 1;
    }

    .row {
        width: 100%;
        height: auto;
        margin: 0 0 1 0;
    }

    .field-label {
        width: 14;
        text-align: right;
        padding-right: 1;
        color: $text-muted;
    }

    .input-wide {
        width: 1fr;
    }

    .intended-use-group {
        margin-bottom: 1;
    }

    .intended-use-option {
        margin-left: 1;
    }

    #meta-examples {
        height: 8;
        border: solid $primary;
    }

    #meta-files {
        height: 6;
        border: solid $primary;
        color: $text-muted;
        padding: 0 1;
    }

    #selection-summary {
        padding: 0 1;
        color: $text-muted;
        border: dashed $primary;
        height: auto;
    }

    #include-row Checkbox {
        margin-right: 2;
    }

    #button-row Button {
        margin-right: 1;
    }

    #package-status {
        padding: 0 1;
        height: auto;
        border: solid $primary;
        color: $text;
    }

    .status-error {
        color: $error;
    }

    .status-success {
        color: $success;
    }
    """

Default TCSS.

run_dir: pathlib.Path | None = None
include_json = True
include_txt = True
include_meta = True
include_manifest = True
compose()[source]

Compose the package screen layout.

on_mount()[source]

Initialize inputs based on the current run directory state.

action_close_screen()[source]

Close this screen and return to the main view.

action_browse_run_dir()[source]

Keybinding action to browse for a run directory.

action_build_package()[source]

Keybinding action to build a package with the current settings.

on_close_pressed()[source]

Handle Close button press.

on_browse_pressed()[source]

Handle Browse button press.

on_run_dir_submitted(event)[source]

Handle manual run directory entry.

This updates defaults and selection summary after the user confirms input with Enter.

on_output_dir_submitted(event)[source]

Handle manual output directory entry.

on_common_name_submitted(event)[source]

Handle common name edits to keep the package name in sync.

on_common_name_changed(event)[source]

Keep package name synced as the common name is edited.

on_intended_use_changed(event)[source]

Refresh examples when intended-use selection changes.

on_package_name_submitted(event)[source]

Handle manual package name entry.

on_package_name_changed(event)[source]

Track manual package name edits to disable auto-sync.

on_checkbox_changed(event)[source]

Update include flags when checkboxes change.

on_build_package_pressed()[source]

Handle Create Package button press.