Skip to content

Commit cf19f36

Browse files
chernistryclaude
andcommitted
revert: remove all retro demoscene TUI features
Removes CRT shader, plasma canvas, tracker view, oscilloscope, BBS boot sequence, retro themes, and their integration into app.py and dashboard.py. Reverts PRs #277, #278, #279, #281, #284, #290, #291. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent be7a76e commit cf19f36

17 files changed

Lines changed: 6 additions & 3759 deletions

src/bernstein/cli/advanced_cmd.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,6 @@ def live(interval: float, classic: bool, no_splash: bool) -> None:
7878

7979
render_startup_splash(console, config=visual_cfg, **_build_live_splash_context(seed_path, seed_cfg))
8080

81-
if not no_splash:
82-
import asyncio as _asyncio
83-
84-
from rich.console import Console as _BootConsole
85-
86-
from bernstein.tui.boot_sequence import play_boot_sequence
87-
88-
_boot_console = _BootConsole()
89-
_asyncio.run(play_boot_sequence(_boot_console, no_splash=False, project_dir=Path(".")))
90-
9181
from bernstein.cli.dashboard import BernsteinApp as DashboardApp
9282

9383
app = DashboardApp()

src/bernstein/cli/dashboard.py

Lines changed: 1 addition & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@
3939

4040
from bernstein.cli.icons import get_agent_icon, get_icons, get_status_icon
4141
from 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

4743
logger = 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()

src/bernstein/tui/app.py

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313
from textual.binding import Binding, BindingType
1414
from textual.containers import Vertical
1515

16-
from bernstein.tui.crt_shader import CRTMode, CRTShader
17-
from bernstein.tui.oscilloscope import OscilloscopeWidget
18-
from bernstein.tui.plasma import PlasmaCanvas
1916
from bernstein.tui.timeline import TaskTimeline, TimelineEntry
20-
from bernstein.tui.tracker_view import TrackerView
2117
from bernstein.tui.widgets import (
2218
ActionBar,
2319
AgentLogWidget,
@@ -129,10 +125,6 @@ class BernsteinApp(App[None]):
129125
Binding("w", "toggle_coordinator", "Coordinator", show=True),
130126
Binding("a", "toggle_approvals", "Approvals", show=True),
131127
Binding("l", "toggle_tool_observer", "Tool calls", show=True),
132-
Binding("C", "toggle_crt", "CRT", show=True),
133-
Binding("P", "toggle_plasma", "Plasma", show=True),
134-
Binding("T", "toggle_tracker", "Tracker", show=True),
135-
Binding("O", "toggle_oscilloscope", "Scope", show=True),
136128
Binding("/", "scratchpad_filter", "Filter scratchpad", show=False),
137129
Binding("escape", "close_action_bar", "Close", show=False),
138130
Binding("up", "cursor_up", "Up", show=False),
@@ -153,7 +145,6 @@ def __init__(self, poll_interval: float = _POLL_INTERVAL) -> None:
153145
self._action_bar_visible = False
154146
self._current_rows: list[TaskRow] = []
155147
self._log_offsets: dict[str, int] = {} # session_id → last-read byte offset
156-
self._crt_shader = CRTShader(CRTMode.OFF)
157148

158149
# -- layout ---------------------------------------------------------------
159150

@@ -168,9 +159,6 @@ def compose(self) -> ComposeResult:
168159
yield CoordinatorDashboard(id="coordinator-dashboard")
169160
yield ApprovalPanel(id="approval-panel")
170161
yield ToolObserverWidget(id="tool-observer")
171-
yield PlasmaCanvas(id="plasma-canvas")
172-
yield TrackerView(id="tracker-view")
173-
yield OscilloscopeWidget(id="oscilloscope")
174162
yield ActionBar(id="action-bar")
175163
yield AgentLogWidget(id="agent-log")
176164
yield ShortcutsFooter(id="shortcuts-footer")
@@ -185,9 +173,6 @@ def on_mount(self) -> None:
185173
self.query_one("#coordinator-dashboard", CoordinatorDashboard).display = False
186174
self.query_one(_APPROVAL_PANEL_SELECTOR, ApprovalPanel).display = False
187175
self.query_one("#tool-observer", ToolObserverWidget).display = False
188-
self.query_one("#plasma-canvas", PlasmaCanvas).display = False
189-
self.query_one("#tracker-view", TrackerView).display = False
190-
self.query_one("#oscilloscope", OscilloscopeWidget).display = False
191176

192177
self._load_historical_logs()
193178
self.set_interval(self._poll_interval, self.action_refresh)
@@ -269,30 +254,6 @@ def action_refresh(self) -> None:
269254
if self.query_one("#task-timeline", TaskTimeline).display:
270255
self.run_worker(self._refresh_timeline())
271256

272-
# Retro widget data flow
273-
agents_data: list[Any] = data.get("agents", [])
274-
275-
plasma = self.query_one("#plasma-canvas", PlasmaCanvas)
276-
if plasma.display:
277-
plasma.update_activity(len(agents_data))
278-
279-
tracker = self.query_one("#tracker-view", TrackerView)
280-
if tracker.display:
281-
tracker.update_agents(agents_data)
282-
283-
scope = self.query_one("#oscilloscope", OscilloscopeWidget)
284-
if scope.display:
285-
scope.update_agents(agents_data)
286-
samples: dict[str, float] = {}
287-
for a in agents_data:
288-
if isinstance(a, dict):
289-
agent = cast("dict[str, Any]", a)
290-
sid = agent.get("session_id", "")
291-
if sid:
292-
samples[str(sid)] = float(agent.get("tokens_per_sec", 0.0))
293-
if samples:
294-
scope.add_samples(samples)
295-
296257
def action_toggle_timeline(self) -> None:
297258
"""Show/hide the task execution timeline."""
298259
timeline = self.query_one("#task-timeline", TaskTimeline)
@@ -436,26 +397,6 @@ def _refresh_coordinator_dashboard(self) -> None:
436397
rows.sort(key=lambda row: {"coordinator": 0, "worker": 1}.get(classify_role(row.role), 2))
437398
self.query_one("#coordinator-dashboard", CoordinatorDashboard).refresh_data(rows)
438399

439-
def action_toggle_crt(self) -> None:
440-
"""Cycle CRT phosphor shader mode."""
441-
mode = self._crt_shader.cycle_mode()
442-
self.notify(f"CRT: {mode.value}", timeout=2)
443-
444-
def action_toggle_plasma(self) -> None:
445-
"""Show/hide the demoscene plasma canvas."""
446-
plasma = self.query_one("#plasma-canvas", PlasmaCanvas)
447-
plasma.display = not plasma.display
448-
449-
def action_toggle_tracker(self) -> None:
450-
"""Show/hide the tracker-style task monitor."""
451-
tracker = self.query_one("#tracker-view", TrackerView)
452-
tracker.display = not tracker.display
453-
454-
def action_toggle_oscilloscope(self) -> None:
455-
"""Show/hide the braille oscilloscope."""
456-
scope = self.query_one("#oscilloscope", OscilloscopeWidget)
457-
scope.display = not scope.display
458-
459400
def action_toggle_action_bar(self) -> None:
460401
"""Toggle the action bar for the selected task."""
461402
action_bar = self.query_one(ActionBar)

0 commit comments

Comments
 (0)