orka.tui.textual_app module

Modern Textual-native TUI application for OrKa memory monitoring. Features native Textual layout system with proper navigation.

class orka.tui.textual_app.OrKaTextualApp(data_manager)[source]

Bases: App

Modern Textual-native OrKa monitoring application.

TITLE: str | None = 'OrKa Memory Monitor'

A class variable to set the default title for the application.

To update the title while the app is running, you can set the [title][textual.app.App.title] attribute. See also [the Screen.TITLE attribute][textual.screen.Screen.TITLE].

SUB_TITLE: str | None = 'Real-time Memory System Monitoring'

A class variable to set the default sub-title for the application.

To update the sub-title while the app is running, you can set the [sub_title][textual.app.App.sub_title] attribute. See also [the Screen.SUB_TITLE attribute][textual.screen.Screen.SUB_TITLE].

BINDINGS: ClassVar[list[BindingType]] = [Binding(key='1', action='show_dashboard', description='Dashboard', show=True, key_display=None, priority=False, tooltip='', id=None, system=False), Binding(key='2', action='show_short_memory', description='Short Memory', show=True, key_display=None, priority=False, tooltip='', id=None, system=False), Binding(key='3', action='show_long_memory', description='Long Memory', show=True, key_display=None, priority=False, tooltip='', id=None, system=False), Binding(key='4', action='show_memory_logs', description='Memory Logs', show=True, key_display=None, priority=False, tooltip='', id=None, system=False), Binding(key='5', action='show_health', description='Health', show=True, key_display=None, priority=False, tooltip='', id=None, system=False), Binding(key='q', action='quit', description='Quit', show=True, key_display=None, priority=False, tooltip='', id=None, system=False), Binding(key='ctrl+p', action='command_palette', description='Palette', show=True, key_display=None, priority=False, tooltip='', id=None, system=False), Binding(key='r', action='refresh', description='Refresh', show=True, key_display=None, priority=False, tooltip='', id=None, system=False), Binding(key='f', action='toggle_fullscreen', description='Fullscreen', show=True, key_display=None, priority=False, tooltip='', id=None, system=False)]

The default key bindings.

CSS_PATH: ClassVar[CSSPathType | None] = 'textual_styles.tcss'

File paths to load CSS from.

on_mount() None[source]

Initialize the application.

refresh_current_screen() None[source]

Refresh the current screen’s data.

action_show_dashboard() None[source]

Switch to dashboard view.

action_show_short_memory() None[source]

Switch to short memory view.

action_show_long_memory() None[source]

Switch to long memory view.

action_show_memory_logs() None[source]

Switch to memory logs view.

action_show_health() None[source]

Switch to health monitoring view.

action_refresh() None[source]

Force refresh current screen.

action_toggle_fullscreen() None[source]

Toggle fullscreen mode.

on_screen_resume(event) None[source]

Handle screen resume events.

features: frozenset[FeatureFlag]
mouse_over: Widget | None
mouse_captured: Widget | None
use_command_palette: bool

A flag to say if the application should use the command palette.

If set to False any call to [action_command_palette][textual.app.App.action_command_palette] will be ignored.

theme_variables: dict[str, str]

Variables generated from the current theme.

scroll_sensitivity_x: float

Number of columns to scroll in the X direction with wheel or trackpad.

scroll_sensitivity_y: float

Number of lines to scroll in the Y direction with wheel or trackpad.

devtools: DevtoolsClient | None
theme_changed_signal: Signal[Theme]

Signal that is published when the App’s theme is changed.

Subscribers will receive the new theme object as an argument to the callback.

app_suspend_signal: Signal[App]

The signal that is published when the app is suspended.

When [App.suspend][textual.app.App.suspend] is called this signal will be [published][textual.signal.Signal.publish]; [subscribe][textual.signal.Signal.subscribe] to this signal to perform work before the suspension takes place.

app_resume_signal: Signal[App]

The signal that is published when the app is resumed after a suspend.

When the app is resumed after a [App.suspend][textual.app.App.suspend] call this signal will be [published][textual.signal.Signal.publish]; [subscribe][textual.signal.Signal.subscribe] to this signal to perform work after the app has resumed.

animation_level: AnimationLevel

Determines what type of animations the app will display.

See [textual.constants.TEXTUAL_ANIMATIONS][textual.constants.TEXTUAL_ANIMATIONS].

supports_smooth_scrolling: bool

Does the terminal support smooth scrolling?

styles: RenderStyles
message_signal: Signal[Message]

Subscribe to this signal to be notified of all messages sent to this widget.

This is a fairly low-level mechanism, and shouldn’t replace regular message handling.