build_tools.syllable_walk_tui.modules.packager.screen ===================================================== .. py:module:: build_tools.syllable_walk_tui.modules.packager.screen .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: build_tools.syllable_walk_tui.modules.packager.screen.PackageScreen Module Contents --------------- .. py:class:: PackageScreen(initial_run_dir = None) Bases: :py:obj:`textual.screen.Screen` Full-screen UI for packaging selection outputs. Users pick a run directory (``_working/_``), 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. :param initial_run_dir: Pre-selected run directory, if available .. py:attribute:: BINDINGS :value: [('escape', 'close_screen', 'Close'), ('q', 'close_screen', 'Close'), ('b', 'browse_run_dir',... A list of key bindings. .. py:attribute:: DEFAULT_CSS :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ 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; } """ .. raw:: html
Default TCSS. .. py:attribute:: run_dir :type: pathlib.Path | None :value: None .. py:attribute:: include_json :value: True .. py:attribute:: include_txt :value: True .. py:attribute:: include_meta :value: True .. py:attribute:: include_manifest :value: True .. py:method:: compose() Compose the package screen layout. .. py:method:: on_mount() Initialize inputs based on the current run directory state. .. py:method:: action_close_screen() Close this screen and return to the main view. .. py:method:: action_browse_run_dir() Keybinding action to browse for a run directory. .. py:method:: action_build_package() Keybinding action to build a package with the current settings. .. py:method:: on_close_pressed() Handle Close button press. .. py:method:: on_browse_pressed() Handle Browse button press. .. py:method:: on_run_dir_submitted(event) Handle manual run directory entry. This updates defaults and selection summary after the user confirms input with Enter. .. py:method:: on_output_dir_submitted(event) Handle manual output directory entry. .. py:method:: on_common_name_submitted(event) Handle common name edits to keep the package name in sync. .. py:method:: on_common_name_changed(event) Keep package name synced as the common name is edited. .. py:method:: on_intended_use_changed(event) Refresh examples when intended-use selection changes. .. py:method:: on_package_name_submitted(event) Handle manual package name entry. .. py:method:: on_package_name_changed(event) Track manual package name edits to disable auto-sync. .. py:method:: on_checkbox_changed(event) Update include flags when checkboxes change. .. py:method:: on_build_package_pressed() Handle Create Package button press.