3939
4040from bernstein .cli .icons import get_agent_icon , get_icons , get_status_icon
4141from bernstein .cli .visual_theme import PALETTE , budget_color , model_color , role_color , sample_gradient , status_color
42- from bernstein .tui .crt_shader import CRTMode , CRTShader
43- from bernstein .tui .oscilloscope import OscilloscopeWidget
44- from bernstein .tui .plasma import PlasmaCanvas
45- from bernstein .tui .tracker_view import TrackerView
4642
4743logger = logging .getLogger (__name__ )
4844
@@ -1371,23 +1367,6 @@ class BernsteinApp(App[None]):
13711367 overflow-y: auto;
13721368 border-right: heavy $border;
13731369 }
1374-
1375- #retro-bar {
1376- height: auto;
1377- max-height: 20;
1378- }
1379-
1380- #plasma-canvas {
1381- height: 12;
1382- }
1383-
1384- #tracker-view {
1385- height: 16;
1386- }
1387-
1388- #oscilloscope {
1389- height: 16;
1390- }
13911370 """
13921371
13931372 #: Resize debounce delay in seconds (TUI-001).
@@ -1406,10 +1385,6 @@ class BernsteinApp(App[None]):
14061385 Binding ("d" , "compare_task" , "Diff" ),
14071386 Binding ("v" , "compare_task" , "Diff" , show = False ),
14081387 Binding ("i" , "inspect_task" , "Open" , show = False ),
1409- Binding ("C" , "toggle_crt" , "CRT" ),
1410- Binding ("P" , "toggle_plasma" , "Plasma" ),
1411- Binding ("T" , "toggle_tracker" , "Tracker" ),
1412- Binding ("O" , "toggle_scope" , "Scope" ),
14131388 ]
14141389
14151390 def __init__ (self , ** kw : Any ) -> None :
@@ -1428,7 +1403,6 @@ def __init__(self, **kw: Any) -> None:
14281403 self ._last_activity : list [str ] = []
14291404 self ._compare_mark : str | None = None # first task ID for compare
14301405 self ._resize_timer : object | None = None # debounce timer handle (TUI-001)
1431- self ._crt_shader = CRTShader (CRTMode .OFF )
14321406
14331407 def compose (self ) -> ComposeResult :
14341408 yield DashboardHeader (id = "header-bar" )
@@ -1442,10 +1416,6 @@ def compose(self) -> ComposeResult:
14421416 with Vertical (id = "activity-bar" ):
14431417 yield Static ("ACTIVITY" , classes = "col-header" )
14441418 yield RichLog (id = "activity-log" , wrap = True , markup = True , auto_scroll = True )
1445- with Vertical (id = "retro-bar" ):
1446- yield PlasmaCanvas (id = "plasma-canvas" )
1447- yield TrackerView (id = "tracker-view" )
1448- yield OscilloscopeWidget (id = "oscilloscope" )
14491419 with Horizontal (id = "expert-row" ):
14501420 yield ExpertCostPanel (id = "expert-cost" )
14511421 yield ExpertBanditPanel (id = "expert-bandit" )
@@ -1507,9 +1477,6 @@ def on_mount(self) -> None:
15071477 except Exception as exc :
15081478 logger .warning ("Failed to read evolve.json: %s" , exc )
15091479
1510- # Retro-demoscene widgets hidden by default (toggled via keybindings)
1511- self .query_one ("#retro-bar" ).display = False
1512-
15131480 # Write startup messages to activity log
15141481 log = self .query_one ("#activity-log" , RichLog )
15151482 log .write (_format_activity_line ("system" , "Bernstein starting..." ))
@@ -1562,7 +1529,6 @@ def _check_agents_file(self) -> None:
15621529 costs : dict [str , Any ] = {}
15631530 self ._update_agents (agents , costs )
15641531 self ._update_activity (agents )
1565- self ._update_retro_widgets (agents )
15661532 except Exception :
15671533 pass
15681534
@@ -1678,7 +1644,6 @@ def _apply_data(self, data: dict[str, Any]) -> None:
16781644 }
16791645 self ._update_stats (data .get ("status" ), tasks , data .get ("agents" , []), costs , monitoring )
16801646 self ._update_activity (data .get ("agents" , []))
1681- self ._update_retro_widgets (data .get ("agents" , []))
16821647
16831648 # -- Agents --
16841649
@@ -1786,7 +1751,7 @@ def _get_boot_log(self) -> str:
17861751 # Truncate module prefix for readability.
17871752 if ": " in msg :
17881753 msg = msg .split (": " , 1 )[1 ]
1789- msg = msg [:80 ]. replace ( "[" , r"\[" )
1754+ msg = msg [:80 ]
17901755 # Color by level.
17911756 if level == "ERROR" :
17921757 lines .append (f"[red]{ time_part } [/] [bold red]ERR[/] { msg } " )
@@ -2258,66 +2223,6 @@ def action_toggle_expert(self) -> None:
22582223 else :
22592224 self .notify ("Novice mode [e] to toggle on" , severity = "information" , timeout = 3 )
22602225
2261- def action_toggle_crt (self ) -> None :
2262- """Cycle CRT phosphor shader mode."""
2263- mode = self ._crt_shader .cycle_mode ()
2264- self .notify (f"CRT: { mode .value } " , timeout = 2 )
2265-
2266- def action_toggle_plasma (self ) -> None :
2267- """Show/hide the demoscene plasma canvas."""
2268- retro = self .query_one ("#retro-bar" )
2269- plasma = self .query_one ("#plasma-canvas" , PlasmaCanvas )
2270- plasma .display = not plasma .display
2271- # Show retro bar if any retro widget is visible
2272- retro .display = (
2273- plasma .display
2274- or self .query_one ("#tracker-view" , TrackerView ).display
2275- or self .query_one ("#oscilloscope" , OscilloscopeWidget ).display
2276- )
2277-
2278- def action_toggle_tracker (self ) -> None :
2279- """Show/hide the tracker-style task monitor."""
2280- retro = self .query_one ("#retro-bar" )
2281- tracker = self .query_one ("#tracker-view" , TrackerView )
2282- tracker .display = not tracker .display
2283- retro .display = (
2284- self .query_one ("#plasma-canvas" , PlasmaCanvas ).display
2285- or tracker .display
2286- or self .query_one ("#oscilloscope" , OscilloscopeWidget ).display
2287- )
2288-
2289- def action_toggle_scope (self ) -> None :
2290- """Show/hide the braille oscilloscope."""
2291- retro = self .query_one ("#retro-bar" )
2292- scope = self .query_one ("#oscilloscope" , OscilloscopeWidget )
2293- scope .display = not scope .display
2294- retro .display = (
2295- self .query_one ("#plasma-canvas" , PlasmaCanvas ).display
2296- or self .query_one ("#tracker-view" , TrackerView ).display
2297- or scope .display
2298- )
2299-
2300- def _update_retro_widgets (self , agents : list [dict [str , Any ]]) -> None :
2301- """Feed agent data to retro-demoscene widgets."""
2302- plasma = self .query_one ("#plasma-canvas" , PlasmaCanvas )
2303- if plasma .display :
2304- plasma .update_activity (len (agents ))
2305-
2306- tracker = self .query_one ("#tracker-view" , TrackerView )
2307- if tracker .display :
2308- tracker .update_agents (agents )
2309-
2310- scope = self .query_one ("#oscilloscope" , OscilloscopeWidget )
2311- if scope .display :
2312- scope .update_agents (agents )
2313- samples : dict [str , float ] = {}
2314- for a in agents :
2315- sid = a .get ("session_id" , a .get ("id" , "" ))
2316- if sid :
2317- samples [sid ] = a .get ("tokens_per_sec" , 0.0 )
2318- if samples :
2319- scope .add_samples (samples )
2320-
23212226 def action_stop_bernstein (self ) -> None :
23222227 """Backward-compatible stop -- delegates to drain."""
23232228 self .action_graceful_quit ()
0 commit comments