Resolve monitor.py conflicts (4 hunks): temp history keeps the
honest-empty 'no data' state with the new scaled fonts + dynamic Y
margin; tachometer takes the new radial-inset numerals + the missing
cr.restore() after the tick loop (4 saves / 4 restores); process list
keeps fractional columns + ASCII sort markers + selection highlight
at the audit's 13px / 23px sizing.
Rocker I ON / O OFF (UP / DOWN double) 16 px bold, illuminated
lamp window scaled with ON/OFF inside; toggle/slide state 16 px
bold, slide knob bigger with grip; rotary numerals 16 px bold +
POS n / N readout inside the plate; push-button face label white
on the coloured face 18 px bold with title at the foot; E-STOP
white on red 18 px bold on the mushroom; breaker ON 16 px bold;
bezel GAUGE 14-16 px; panel/control headers taller with 18-20 px
bold titles, grid labels 14 px bold. Drive-bys found while
shooting: _color now falls back to the per-kind PropDef default
(LedBlue/PanelLampBlue rendered red); Rotary plate arc joined a
stray chord from the last numeral (cr.new_path before arc).
LED block scales with the widget; label 12-15% of LED diameter
bold with leads ending above it; panel-lamp disc shrunk so the
16-18 px bold label clears below it; RGB swatches 24 px with 14 px
R/G/B labels; Beacon bar lowered, dome clear of it, FLASH rate in
white on the bar, BEACON 16 px bold below; StackLight title 16 px
bold plus R/A/G segment letters 24 px bold, white on lit / light
grey on unlit; LampTestButton text 16 px bold. Default word labels
via _label() (C constructor defaults, G2).
Seg14/16 + LedDigits fill widget (dark face so dim segments read
faint, diagonals thinned); DigitalReadout off-segments slightly
more visible; dial numerals 7-8% of diameter bold just inside the
tick ring with titles inside below top numerals; NeedleVu numerals
4% of width bold, red in red zone, VU below arc centre; tank scale
16 / alarms 14 bold / % 18 bold with clearance; horizontal tank
capsule ends inside widget with alarm labels above; sight-glass
tube widened; KeySwitch NO KEY light-on-dark with position
numerals, slot at the current position; Nameplate engraving fit to
45% of plate width. Scaled-font helpers _cap_size/_fs/_fit_size
(cap-height convention, as C inst_cap_font).
Same radial-extent inset as C/Rust: the glyph box farthest corner
in the radial direction stays inside the tick ring (inner end r-16)
with 4 px clearance, so a wide 4-digit label never crosses the dial
rim. Verified by re-shoot; full suite still 363 tests OK.
- Graphs (History/Net/Temp): dynamic left margin from the widest Y
label (fixes Y labels overflowing the plot), legend on top, 5 Y
labels, humanised units in NetGraph, TempHistory threshold label
above the line ("80 C limit"), top/bottom Y labels hang clear of
the title and the strip below the plot. History gains -60s/now.
- XTachometer: numerals 7.5% of dial diameter bold just inside the
tick ring, RPM bold centred in-dial below the top numerals (its
baseline hangs below the top numeral so it cannot collide with
the 3200/4800 numerals on small dials), readout "value (peak N)"
enlarged below the hub, redline numerals in red.
- All 14 audit widgets: font sizes derived from widget dimensions
per the proportions audit (titles 16px bold, hero values 24-48px
bold, body/legend 13-16px, min 11px); CoreGrid keeps 4x2; UsageBar
labels outside the bar on a dark panel; StackBar title+total
header (adaptive: omitted at 48px where it would push the legend
out) with centred block; VerticalBar value inside the bar, peak
label with shrink-to-fit; ArcGauge centre 40-48px + endpoints;
DonutGauge centre 36-44px, ring 8-10% of diameter, duplicate
title dropped, centre label is the value name; ProcessList 13px
rows, bold header with sort indicator, "N procs"; LoadBadge
centred two-line block with scaled values; MonitorButton scaled
label/dot/status + detail line; MonitorGrid ceil(sqrt(n)) columns,
name+status+detail design with wrapped detail; SysBox hero
28-32px + max + bar %.
- New _fpx() clamp helper; XStackBar gains the "unit" prop
(props_monitor.py) for its "total <sum> <unit>" header.
- Demos: button/grid labels "SSH :22" -> "sshd :22", tach label
"Engine" -> "RPM", stackbar demo 320x48 -> 320x120 (title+bar+
legend cannot fit in 48px), verticalbar demo 60 -> 160 wide
(the "peak 82" label cannot fit in a 60px widget).
- Deviations from the audit spec: UsageBar label capped at 40px
(the literal 0.45x rule gives 209px in a 464px-tall bar); SysBox
hero uses 10% of height clamped 20-32px (spec 6-7% conflicts
with the audited-correct PY value of 10.3%); PY LoadBadge gets
no 1/5/15 sub-labels (the audit calls the PY layout correct;
the sub-labels were directed at Rust).
Full suite: 363 tests OK (44 skipped). All 15 demos shot + verified.
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).
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).
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.
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.
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.
_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.
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.
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.
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%).
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.
- 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).
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.
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.
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).
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).
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%.
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.