Commit Graph
62 Commits
Author SHA1 Message Date
Muse 8fb940582e Merge monitor-apps/task-manager into monitor-apps-all
Resolve monitor.py conflict: keep the process-manager selected-row
highlight AND the task-manager width-relative column positions
(xs[0] for the PID column instead of fixed x=6).
2026-12-05 20:59:31 +00:00
Muse 16ebfd719b Stage 2 monitor app: Task Manager clone (Processes + Performance tabs)
Python port of the Task Manager clone: TPageControl with two tabs
(tab clicks need app-level hit handling, fixed tab-width 140).
Processes tab is a live XProcessList from /proc (sortable PID /
Program / User / Mem / CPU% columns, header clicks toggle the
direction). Performance tab is XHistoryGraph (60 s CPU + memory),
XCoreGrid (per-core), XUsageBar (Memory, Disk /, Swap), XStackBar
(memory breakdown) and XNetGraph (live /proc/net/dev rates). Data
sampled every 500 ms (GLib timeout); window repaints every 2 s
(a full redraw is ~38 rows x 5 text calls plus the graphs, and
repainting every tick burned ~40% of a core); the process list
refreshes every 2 s. Python monitor widgets draw dark btop-style
panels, so the window background is dark.

Also fixes two XProcessList issues the app exposed: the columns
were fixed offsets drawn for the 360px demo widget (a wide widget
was mostly empty) -> width-relative fractions, same as the C++
widget, plus a v/^ sort marker in the header; and _read_processes
opened /proc/<pid>/status for every process on every scan (671 ms
CPU for 400 processes) -> RSS now comes from stat field 24 and
the uid lookup is cached per (pid, starttime), so a warm scan is
~75 ms (9x faster).
2026-12-05 20:55:30 +00:00
Muse da3a9d3343 Merge monitor-apps/temperature-monitor into monitor-apps-all 2026-12-05 20:53:09 +00:00
Muse 66ba965206 Temperature Monitor app: honest zero-sensor state + MonitorWidget.clear()
Single-widget monitor app (XTempHistory, 80 C threshold) reading
/sys/class/thermal + /sys/class/hwmon every 2 s. hot_dallas has no
thermal sensors, so the app shows the widget empty state (no data,
no fake readings) with a title that says so. Adds additive
MonitorWidget.clear() and an empty-state readout.
2026-12-05 20:46:45 +00:00
Muse a6b084e214 Merge monitor-apps/network-monitor into monitor-apps-all 2026-12-05 20:23:25 +00:00
Muse 512fdd5ecf Merge monitor-apps/disk-monitor into monitor-apps-all 2026-12-05 20:19:48 +00:00
Muse 7d512cf5af Merge monitor-apps/cpu-dashboard into monitor-apps-all 2026-12-05 20:18:56 +00:00
Muse 9bb8f27603 Merge monitor-apps/memory-monitor into monitor-apps-all 2026-12-05 20:17:17 +00:00
Muse 0934970206 Network Monitor app (Stage 2): live /proc/net/dev monitor - XNetGraph + 2x XSysBox + XHistoryGraph + XUsageBar 2026-12-05 20:15:48 +00:00
Muse 00ea2f43af Merge monitor-apps/process-manager into monitor-apps-all 2026-12-05 20:14:27 +00:00
Muse b197a366ec Disk Monitor app (Stage 2): live per-mount usage bars, Used/Free stack bar, read/write IO history graph
1024x768 window, 1 s refresh from /proc/mounts + os.statvfs and
/proc/diskstats. XUsageBar + XStackBar + XHistoryGraph; seeded demo
data replaced on first tick (push/set_segments start fresh own
data). Harness background is the widgets near-black panel color
(XStackBar paints no panel of its own). XSysBox deliberately unused
(no clear-history API, constructor seeds 60 demo samples).
Screenshot verified 1024x768 on :116. Tests: 363 OK.
2026-12-05 20:13:54 +00:00
Muse fc040ef4b2 Merge monitor-apps/system-overview into monitor-apps-all 2026-12-05 20:11:25 +00:00
Muse 11f7dd70e6 monitor/cpu-dashboard (Python): btop-style CPU dashboard app
XCoreGrid + XTachometer + XHistoryGraph + XLoadBadge + XUsageBar in one
1024x768 window, live /proc/stat + /proc/loadavg sampled every 500 ms
via refresh_cores()/refresh_load(). Pushing live samples starts fresh
series, so the seeded demo data is replaced on the first live sample.
2026-12-05 20:09:23 +00:00
Muse b4add9ba7b fix (Python): balance save/restore in XTachometer draw
_draw_tachometer did 4 cr.save() but only 3 cr.restore(): the save
before the tick loop was never restored, so Widget.draws restore
popped the wrong level and the widgets translate+clip leaked into
the next widget drawn on the same area (anything drawn after a
tachometer rendered blank / misplaced). All other monitor draws
are balanced.
2026-12-05 20:09:21 +00:00
Muse 9cbabb9d71 Memory monitor app (Stage 2): Python implementation + screenshot 2026-12-05 20:08:26 +00:00
Muse 05b1b0f7c1 System Overview monitor app (Stage 2): XSysBox x4 + XLoadBadge + XDonutGauge x2 + XUsageBar x3, live /proc data, 500 ms refresh 2026-12-05 20:06:11 +00:00
Muse 38f91c57eb Merge monitor-apps/service-dashboard into monitor-apps-all 2026-12-05 20:04:15 +00:00
Muse e1da839538 Process Manager monitor app (Python): MonitorWidget filter+selection, live /proc list, Terminate/Kill/Refresh 2026-12-05 20:04:03 +00:00
Muse 1c33577bb9 monitor-apps/service-dashboard: Service Dashboard app (XMonitorGrid, 12 live dallas services)
One 1024x768 window: XMonitorGrid of XMonitorButton cells for the
real services on hot_dallas -- ports 22/80/443/81/2368/5000/5009/7888,
processes dockerd/containerd, units docker.service/ssh.service.
Live poll_all() on a 2 s GLib timer; green up / red down.
Screenshot verified: 12/12 up. Tests: 363 passed.
2026-12-05 19:55:15 +00:00
Muse 03065d35bf README: widget count 547 -> 562, Monitor (15) family section
363 tests; 598-entry palette (562 widgets + 36 legacy); new
X* monitor-family bullet + layout entries; examples README
counts (209 XFrame) + monitor live-timer note.
2026-12-05 17:09:58 +00:00
Muse b361a35909 Fix XStackBar legend: drop overlapping total text
The right-aligned total overlapped the last legend item and its
byte formatting was meaningless for unitless segments. Legend now
shows only the segment chips + percentages.
2026-12-05 17:09:23 +00:00
Muse 841dddcef6 Examples + shots: XProcessList, XLoadBadge, XMonitorButton, XMonitorGrid, XSysBox
Designer-pattern examples + Xvfb :107 screenshots. The last four
feed live data (real /proc processes, load averages, sshd :22 /
unit checks); XProcessList re-shot after the wall-time CPU% fix
(busy loop now reads ~97%, not ~240%).
2026-12-05 17:08:17 +00:00
Muse 2ecc09dd4d Examples + shots: XStackBar, XVerticalBar, XTachometer, XArcGauge, XDonutGauge
Designer-pattern examples + Xvfb :107 screenshots (see Batch B
for the harness/shooter). Gauges re-shot after the _arc_stroke
fix; tachometer readout moved clear of the 0/max labels.
2026-12-05 17:07:59 +00:00
Muse 2d52b55743 Examples + shots: XHistoryGraph, XCoreGrid, XNetGraph, XTempHistory, XUsageBar
Designer-pattern examples (xgraph.py harness + live-demo GLib timer
feeding seeded/live sine data). Screenshots under Xvfb :107 via
tools/shoot_monitor.py (xdotool + import, PIL non-blank check).
2026-12-05 17:07:40 +00:00
Muse cff0c74605 Fix gauge arcs: stray diagonal line; wall-time per-process CPU%
- Cairo arc() draws a connecting line from the current point to
  the arc start, and _wtext() leaves a current point (move_to +
  show_text), so the tachometer / arc / donut gauges grew a stray
  diagonal in the track color. New _arc_stroke() helper does
  new_path() before every arc.
- Tachometer digital readout moved below the hub (was colliding
  with the 0/max tick labels).
- XProcessList CPU% is now per-core against per-process wall
  time: on this VPS /proc/stat totals advance at only ~320
  jiffies/s for 8 cores (host vCPU scheduling), so the stat
  denominator inflated a busy loop to ~240%; wall time gives
  ~97% (verified live against a busy loop).
2026-12-05 17:07:19 +00:00
Muse 54c60188f0 X* monitor family (15 widgets): MonitorWidget + palette 547 -> 562
New btop-style live monitor widgets (registry 547-561, archetype
Monitor, family X, section Misc / X): XHistoryGraph, XCoreGrid,
XNetGraph, XTempHistory, XUsageBar, XStackBar, XVerticalBar,
XTachometer, XArcGauge, XDonutGauge, XProcessList, XLoadBadge,
XMonitorButton, XMonitorGrid, XSysBox. Drawn with Cairo on a
Gtk.DrawingArea like the rest of the set; sample data is runtime
state only (demo sine data until push()/refresh()/poll() feeds
real data). Checks are stdlib only: /proc scan, systemctl
is-active, socket to localhost. 35 new tests; full suite 363 green.
2026-12-05 16:48:47 +00:00
cnmcdee 3b67cbf9de Ind* indicators: CSV/series support on all 250 kinds
Transpile the C component ind_* function for every kind into
lightgui/xframe/indicators.py (tools/transpile_indicators.py), verified
250/250 against the C++ reference dump (<=1e-9, NaN patterns included).
IndicatorWidget gains the StockWidget series API (set_series, populate,
get_series, add_point, clear, load_csv, item_count, get_lines) and draws
the computed lines (14-colour palette, NaN gaps, dots for isolated
marker points) with the demo series as fallback. Docs in
docs/indicators-data.md; tests/test_indicators_csv.py (17 tests, golden
spot values vs the C++ reference); Xvfb shots via
tools/ind_csv_shots.py.
2026-12-02 11:04:35 +00:00
cnmcdee d0f430f88c debugger: Run honours the Target field; staged-row toggle/remove/edit hit the right row
Bug 5 (was still present): Run from Stopped re-ran the stored script
and ignored the Target/Args entries. _on_run() now compares the
entries with the loaded target and starts the new target when they
differ.

Bug 8, staged-row variant (found by reviewing the live screenshot):
staged breakpoints share id 0, so a checkbox toggle / Remove / Edit on
one staged row landed on the first staged breakpoint instead — the
store row flipped but the session flag went to the wrong bp, and the
next refresh showed the wrong row unchecked. Session lookups now
match by (id, location) via _find_bp(); the UI tracks the selected
row location and the refresh re-selects by (id, location).

Tests: test_run_from_stopped_uses_new_target,
test_staged_toggle_hits_the_right_row. Full suite 28/28 under Xvfb;
Stop on a Gtk.main() debuggee verified live (0.02s, reaped).
Docstrings in debugger.py/debugger_ui.py updated (they are the
debugger docs; architecture.md already points at them).
2026-12-02 10:03:04 +00:00
cnmcdee 11493b5f22 Stock charts: CSV data loading (load_csv/set_series/clear/populate)
Every chart widget rendered only the baked-in 250-bar demo series:
no set_series existed in Python despite the docstring naming it, so
there was no way to plot real data at all. Now StockWidget holds up
to three series slots (primary + two extra for the multi-symbol
charts) via set_series (the C API), get_series, add_point, clear /
populate, item_count, and load_csv; all 37 draw paths read the
widget series through _bars(widget) instead of module DEMO_SERIES,
so derived series (Heikin-Ashi, Renko, VWAP, OBV, ...) rebuild from
the loaded data and the drawing tools inherit it as background.

load_csv reads date,open,high,low,close,volume with the stdlib csv
module: header optional (matched by name, any order, extra columns
ignored), dates YYYY-MM-DD / YYYY/MM/DD / DD-MM-YYYY / ISO datetime
/ epoch seconds (validated, not stored -- the x-axis is bar index),
ValueError naming the row on bad data. A cleared series draws a
no-data placeholder; a one-bar series draws (Price: flat change).

Tests: tests/test_stock_csv.py, 27 tests (parsing, API, headless
renders of all 24 chart kinds incl. CSV-vs-template pixel diff).
Fixture tests/data/ohlcv_30.csv (30 weekday bars). Full suite 311
tests pass; visreg 24/24 stock charts pixel-identical to template
goldens. Docs: docs/stock-charts-data.md. Screenshots:
tools/stock_csv_shots.py (Xvfb, RMSE 9-35% vs template goldens).
2026-12-02 09:55:14 +00:00
cnmcdee bfb366c083 Add visual regression harness for all 547 widgets
tools/visreg/run.sh re-renders every widget example the same way the
pythondoc sweep did (Xvfb, import -window root, crop to window size),
diffs each shot against its golden with ImageMagick RMSE (normalized,
0.5% threshold), and writes out/report.md + report.json with per-widget
PASS/FAIL and diff percentages. Goldens vendored from the pythondoc
sweep shots. Full run on a clean tree: 547/547 PASS, max diff 0.0%.
2026-12-02 09:10:45 +00:00
Muse bbc284d0bb docs(pythondoc): runnable example programs for all 547 widgets
One minimal complete program per widget, from the designer codegen
(one window, one widget, OnClick wired). Every example was run under
Xvfb and screenshotted (547/547 ok); screenshots appear on the widget
pages at pythondoc.lightgui.com.
2026-12-02 06:04:20 +00:00
Muse 4f9f1bff32 docs(pythondoc): runnable example programs for 5 pilot widgets
Minimal complete programs from the designer codegen (one window, one
widget, OnClick wired), plus examples/README.md. Screenshots taken
under Xvfb prove each runs. Full 547-widget set follows.
2026-12-02 05:54:31 +00:00
cnmcdee 90f7e403ea Task 4: ButtonRelease goes to the pressed widget in generated apps
The Python generator is GTK-based and hit-tests to one widget, so it never had the every-widget loop; its bug was that _on_button_release dispatched OnMouseUp to the widget under the release point. It now tracks _PRESSED on ButtonPress (via a new _dispatch_to helper) and dispatches OnMouseUp to _PRESSED on release, then clears it. Motion/key are not wired in the Python generator (RUNTIME_EVENTS is click-only), so there is no every-widget loop for them to fix. New test test_task4_release_goes_to_pressed_widget asserts the emitted code; full suite 282 tests pass. Verified live under Xvfb with a generated 2-button app: press Button A, release over Button B -> only A's OnMouseUp fires (log shows MOUSEUP A, never MOUSEUP B). The designer canvas does not broadcast release/motion to widgets, so it is unchanged.
2026-12-02 05:39:48 +00:00
cnmcdee 70165968b6 Task 3: TFontDialog height 340->420 (caption clipped) 2026-12-02 04:58:06 +00:00
cnmcdee a5e42fd100 Task 3: refine three placement minimums from live verification
TFontDialog height 320->340 (caption clipped), TOpenPictureDialog / TSavePictureDialog width 400->480 (filter string truncated). Same values as C.
2026-12-02 04:42:27 +00:00
cnmcdee 5a1ec47c6c Task 3: placement sizes are max(registry default, content minimum) so the outer border encloses each widget's content
27 widgets (18 dialogs, 2 calendars, 3 views, 4 choosers) get larger PaletteEntry defaults in lightgui/xframe/palette.py; canvas places at entry.default_w/default_h. New test Task3MinSizesTests asserts all 27; updated the AboutDialog size assertion in test_core.py. Full suite: 281 tests pass. Verified live under Xvfb: dialogs place at the new sizes (e.g. GtkAboutDialog 520x260). Two residual internal-layout collisions (TFindDialog Direction/Find Next, GtkFileChooserDialog Name/path) are draw-code issues, not placement size.
2026-12-02 04:31:38 +00:00
cnmcdee 5b0c6f02fd Single-placement mode + code-view sync on placement
Task 1: placing a widget now disarms placement mode — the next canvas
click places nothing until another palette widget is selected. Escape
and clicking the selected palette row again also cancel an armed
placement. Previously pending_kind persisted across placements, so
every click placed another fresh widget.

Task 2: placing a widget refreshes the Code window at once
(Lazarus-style) via a new CanvasState.on_placed hook wired to
Application.refresh_code_view(), so the generated code shows the new
widget without pressing Generate.

Tests: replaced test_pending_kind_persists_across_placements with
test_pending_kind_disarms_after_one_placement, plus
test_escape_cancels_pending_kind and
test_on_placed_fires_after_canvas_click_placement (280 tests pass).

Verified live under Xvfb (p-place-verify.sh + screenshots): place-once,
Escape-cancel, toggle-cancel, re-arm, code sync, clean app log.
2026-12-02 03:15:36 +00:00
cnmcdee 9bc3e96a93 Phase 7 docs: record final Phase 7 commit SHAs in architecture.md 2026-12-01 04:12:07 +00:00
cnmcdee 4f1e907d2a Phase 7 screenshots: fresh Xvfb captures of the current UI
- main-window.png: designer with 5 placed widgets, handles on
  GtkButton_001, Inspector geometry + properties.
- code-window.png: Code window with generated Python (Monokai,
  gutter, _ANCHORS/_HANDLERS).
- debugger-stopped.png: debugger stopped at a breakpoint
  (p7_dbg_target.py:6, breakpoint-hit), Breakpoints label above its
  list, Output label clear of the middle pane (fix A).
2026-12-01 04:11:06 +00:00
cnmcdee 751367396f Phase 7 docs: README + architecture brought up to date
README: all 7 phases complete, requirements (python3-gi,
python3-cairo, python3-gi-cairo, GTK 3.24), how to run, what works,
actual final module layout (no theme.py/preferences.py/archetypes.py
— those never existed), test command, honest known limits (Install
Libraries root prompt unverified, no logpoint UI, def-line
breakpoint fires at definition time, generated scripts need
lightgui on PYTHONPATH unless installed system-wide).

architecture.md: phase plan actually used (Phases 0-7 with commit
SHAs), final module layout, final state.
2026-12-01 04:09:24 +00:00
cnmcdee c8263b2035 Phase 7 tests: bounds-change hook + geometry refresh + debugger label placement
- CanvasState on_bounds_change: programmatic resize, set_prop width,
  set_bounds/move_to and handle drags fire it; selection changes and
  unrelated prop edits do not.
- Inspector refresh_geometry: programmatic resize updates the width/
  height spins in place (same editor widgets, no rebuild) and a spin
  edit still live-applies; no-op with nothing selected.
- DebuggerWindow: Breakpoints label is the first child of its pane
  (above the list) and sits above the tree in window coordinates;
  Output label has a 6px top margin.
2026-12-01 04:08:21 +00:00
cnmcdee 6eabe93b65 Phase 7 fix A+B: debugger labels above their panes; Inspector geometry refresh on programmatic resize
Fix A: the Breakpoints label sat below the breakpoint list, directly
above the Output label, and the two read as one cramped/overlapping
block at the bottom-left of the debugger window. It now sits above
its list (like Locals in the right pane) and the Output label has
6px top/start margins so it cannot crowd the middle pane.

Fix B: the Inspector only rebuilt on selection change, so a
programmatic resize (set_prop/resize_to/set_bounds) left the
geometry spins stale until the next selection, while canvas and
status bar already showed the new size. CanvasState now fires
on_bounds_change when the selected widget bounds move under the
same selection; the Inspector answers with refresh_geometry(),
which syncs just the four spins in place (no rebuild, no focus
loss). Handle drags fire the same hook, so drags keep working
and now track live.
2026-12-01 04:08:20 +00:00
cnmcdee 6d2dae20a1 Phase 6 fix: 14/16-segment maps + geometry verbatim from C
The draft segment code used its own segment ids (h/i centre
verticals, j/k/l/m diagonals) and drew diagonals as full-length
round-capped strokes, so I/K/M/V/W were wrong and every glyph was
swamped by a dark X blob ("HELLO" unreadable in the showcase
screenshot). This mirrors the C widgets exactly: segment_map()
strings from InstSeg14/16Display5.h, C ids (i/l centre verticals,
h/j/k/m diagonals), C draw_segment geometry (inset bars, hh/hv
verticals) and C draw_diag polygons that stop short of the centre.
Adds per-segment probe tests: every 14-seg glyph vs C map, 16-seg
M/W clean forms, 7-seg 8 vs 1.
2026-12-01 04:03:26 +00:00
cnmcdee 11c380df76 Phase 6 tests: 103-kind tables, draw smoke, anchor + short-plot guards
27 Phase 6 tests (tables: 103 kinds / 1008 props / 116 names, up-down
defaults, symbol model-only, shadowed VWAP/Arrow names; headless
Cairo smoke over all 103 kinds + with live props; ParallelChannel /
Pitchfork 0/1/2 anchors; tank level 13.78 -> 80 live-apply; short
plot <16px; ProgressBar filled-bar pixels; seeded series invariants;
generator model-only comment). Updates the two Phase 1/2 tests that
encoded the old assumptions (generic-only Stock/Inst tables;
ARCHETYPE == palette archetype for every kind).
2026-12-01 03:56:49 +00:00
cnmcdee 4333f72ed5 Phase 6: Stock (37) + Instrumentation (66) widgets -- drawing + property tables
Cairo drawings for all 103 kinds in lightgui/xframe/stock.py and
instruments.py (seeded 250-bar demo series so charts show their
colours with no series data; ddaf4bd anchor guard: ParallelChannel /
Pitchfork draw with 0-2 anchors; plot guard below 16px height).
Property tables generated by tools/gen_props_phase6.py from the C
Phase 4 tables (103 kinds, 1008 props, 116 distinct names; symbol
model-only; corrected up/down rgb(0,150,0)/rgb(200,30,30)).
Registry-name dispatch in core.lookup so kind-sharing entries
(IndVWAP/IndAnchoredVWAP kind VWAP, TArrow kind Arrow) keep their
own archetype drawings and generic-only tables.
2026-12-01 03:56:43 +00:00
cnmcdee ba3b144383 Phase 5 follow-up: step-over lands in the caller; Hits column syncs
- debugger.py step_over: pdb stops once more at the --Return--
  event inside the finishing function, so one extra `next` lands
  in the caller (GDB `next` behaviour). A --Return-- stop at a
  breakpoint line is no longer misreported as a breakpoint hit.
- debugger_ui.py: sync hit counts from pdb on every stop so the
  breakpoint pane's Hits column shows the real count.
- tests: step over the last line of a function lands in the caller
  (new test_step_over_last_line_lands_in_caller).
  Full suite: 240 tests pass.
2026-12-01 03:35:16 +00:00
cnmcdee b6702c381e Phase 5: pdb step debugger (session + UI) + Install Libraries
- lightgui/debugger.py: PdbSession driving python3 -m pdb in a
  subprocess (start/run/restart, break/enable/disable/clear,
  continue, step into/over/out, stack, locals, watches, stop).
  State machine idle/running/stopped/exited; stop kills the whole
  process group (SIGTERM then SIGKILL) so Stop can never hang on a
  GUI app; Run from Stopped/Exited restarts with the current target
  and re-applies breakpoints; no temp breakpoints (stop-on-entry
  uses pdb's natural first stop, break-on-main is persistent).
- lightgui/debugger_ui.py: debugger window mirroring the C layout
  (toolbar, Target row, status, breakpoints left, locals/watches/
  stack right, output console). Breakpoint pane 420px / 320px
  location column; in-place row updates + id-based selection
  restore; checkbox toggles apply to the session first; watch and
  locals trees have search disabled (no search popup on click).
- lightgui/install_libs.py: Install Libraries flow (package to
  system site-packages, launcher to /usr/local/bin, .desktop to
  /usr/local/share/applications); pkexec first, sudo -S fallback
  with an Enter-submits password dialog; dry-run plan shown in the
  dialog. pkexec is not installed on the server (same honest limit
  as the C/Rust fix).
- app.py: Debug menu (Start Debugging, Toggle Breakpoint, Step
  Into/Over/Out, Continue, Stop) + Tools > Install Libraries;
  debugger stop scrolls the Code window to the stopped line.
- tests: 38 new tests (debugger session incl. breakpoint hit,
  step over/into/out, locals, watches, continue to end, stop
  kills the debuggee, restart from Exited, enable/disable;
  install dry-run command construction/file list/paths).
  Full suite: 239 tests pass.
2026-12-01 03:25:40 +00:00
cnmcdee c22ff1059f Phase 4: app-level tests; fix tab-label GTK critical + Gdk version warning 2026-12-01 03:15:00 +00:00
cnmcdee 2a99acbd61 Phase 4: generator tests incl. Xvfb run of generated script 2026-12-01 03:12:14 +00:00
cnmcdee b2ea94c30d Phase 4: menus in Code window + File/View/Help wiring, dirty tracking, Generate/Build/Run 2026-12-01 03:12:14 +00:00