screens
ruff_sync.tui.screens ¶
Screens for the Ruff-Sync Terminal User Interface.
OmniboxScreen ¶
Bases: ModalScreen[str]
A modal search screen for quickly finding Ruff rules.
Source code in src/ruff_sync/tui/screens.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
CSS
class-attribute
instance-attribute
¶
CSS = "\n OmniboxScreen {\n align: center middle;\n }\n\n #omnibox-container {\n width: 60;\n height: auto;\n max-height: 20;\n background: $boost;\n border: thick $primary;\n padding: 1;\n }\n\n #omnibox-input {\n margin-bottom: 1;\n }\n\n #omnibox-results {\n height: auto;\n max-height: 12;\n border: none;\n background: $surface;\n }\n "
__init__ ¶
Initialize the search screen.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
all_rules
|
list[RuffRule]
|
The list of all rules to search through. |
required |
**kwargs
|
Any
|
Additional keyword arguments. |
{}
|
Source code in src/ruff_sync/tui/screens.py
compose ¶
Compose the search interface.
Source code in src/ruff_sync/tui/screens.py
on_mount ¶
handle_input_changed ¶
Filter rules based on search input.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
Changed
|
The input changed event. |
required |
Source code in src/ruff_sync/tui/screens.py
handle_input_submitted ¶
Handle enter key in the input.
Source code in src/ruff_sync/tui/screens.py
handle_option_selected ¶
Handle selection from the results list.
LegendScreen ¶
Bases: ModalScreen[None]
A toggleable legend explaining TUI status colors and icons.
Source code in src/ruff_sync/tui/screens.py
CSS
class-attribute
instance-attribute
¶
CSS = "\n LegendScreen {\n align: center middle;\n background: black 50%;\n }\n\n #legend-container {\n width: 50;\n height: auto;\n background: $boost;\n border: heavy $accent;\n padding: 1 2;\n }\n\n .legend-title {\n text-align: center;\n text-style: bold;\n margin-bottom: 1;\n color: $accent;\n }\n\n .legend-section {\n text-style: underline;\n margin-top: 1;\n margin-bottom: 1;\n }\n\n .legend-row {\n margin-left: 2;\n }\n\n #legend-footer {\n text-align: center;\n margin-top: 1;\n color: $text-disabled;\n }\n "
compose ¶
Compose the legend content.