build_tools.syllable_walk_tui.modules.database.screen
Database viewer screen modal component.
This module provides the DatabaseScreen modal for browsing corpus SQLite database contents with pagination and sorting.
Classes
Modal showing detailed feature breakdown for a syllable. |
|
Modal screen for viewing corpus database contents. |
Module Contents
- class build_tools.syllable_walk_tui.modules.database.screen.SyllableDetailModal(syllable_data, feature_details, *args, **kwargs)[source]
Bases:
textual.screen.ModalScreenModal showing detailed feature breakdown for a syllable.
Initialize with syllable data and feature mapping.
- BINDINGS = [('escape', 'close', 'Close'), ('enter', 'close', 'Close')]
A list of key bindings.
- DEFAULT_CSS = Multiline-String
Show Value
""" SyllableDetailModal { align: center middle; } SyllableDetailModal > Vertical { width: 50; height: auto; max-height: 80%; background: $surface; border: solid $primary; padding: 1 2; } SyllableDetailModal .detail-header { text-style: bold; color: $accent; text-align: center; margin-bottom: 1; } SyllableDetailModal .detail-freq { text-align: center; margin-bottom: 1; } SyllableDetailModal .detail-section { text-style: bold; color: $secondary; margin-top: 1; } SyllableDetailModal .detail-feature { padding-left: 2; } SyllableDetailModal .detail-help { text-align: center; color: $text-muted; margin-top: 1; } """
Default TCSS.
- syllable_data
- feature_details
- class build_tools.syllable_walk_tui.modules.database.screen.DatabaseScreen(db_path=None, patch_name='', *args, **kwargs)[source]
Bases:
textual.screen.ScreenModal screen for viewing corpus database contents.
Displays the syllables table from the corpus.db SQLite database with pagination and sorting by frequency.
- Parameters:
db_path (pathlib.Path | None) – Path to the corpus.db SQLite database
patch_name (str) – Name of the patch (A or B) for display
- Keybindings:
Esc: Close screen and return to main view j/k: Navigate rows down/up Enter: Show row details n/l/Right: Next page p/h/Left: Previous page [/]: Cycle sort column (prev/next) f: Toggle sort order (asc/desc) Home: Go to first page End: Go to last page
Initialize database screen.
- Parameters:
db_path (pathlib.Path | None) – Path to corpus.db file
patch_name (str) – Patch identifier for display (A or B)
- FEATURE_DETAILS
- SORTABLE_COLUMNS = [('syllable', 'Syllable'), ('frequency', 'Freq'), ('starts_with_vowel', 'V→'),...
- BINDINGS = [('escape', 'close_screen', 'Close'), ('j', 'cursor_down', 'Down'), ('k', 'cursor_up', 'Up'),...
A list of key bindings.
- DEFAULT_CSS = Multiline-String
Show Value
""" DatabaseScreen { background: $surface; padding: 1; } DatabaseScreen .db-header { text-style: bold; color: $accent; margin-bottom: 1; } DatabaseScreen .db-meta { color: $text-muted; margin-bottom: 1; } DatabaseScreen .db-status { dock: bottom; height: 1; background: $boost; padding: 0 1; } DatabaseScreen .db-help { dock: bottom; height: 1; color: $text-muted; padding: 0 1; } DatabaseScreen DataTable { height: 1fr; } """
Default TCSS.
- db_path = None
- patch_name = ''
- current_page = 1
- total_pages = 1
- total_rows = 0
- page_size = 50
- sort_column_index = 1
- sort_by = 'frequency'