Commit Graph

802 Commits

Author SHA1 Message Date
vasilito 5d0509fc15 tlc: use install command for atomic copy+chmod in recipe 2026-06-20 20:09:18 +03:00
vasilito 8935be79eb tlc: PLAN.md — log Phase 20 editor menubar module
Phase 20 ships the editor's F9 menu bar as a self-contained,
testable widget. Mirrors Midnight Commander's
src/editor/editmenu.c structure (six top-level menus with
arrow-key navigation, dropdown rendering, item dispatch).

Components:
  src/editor/menubar.rs    — EditorMenuBar + EditorCmd + render()
  src/editor/mod.rs        — pub mod menubar declaration

Tests: 10 unit tests in editor::menubar cover menu navigation
(arrows, wrapping, separators), Esc/F9 close, Enter dispatch,
letter hotkey menu selection by title, and render smoke test.

Wiring into the editor's main handle_key + render path is the
natural next step; the user has separately committed
dfed245e4a / 0d999dc4ed which add Key::LEFT/RIGHT/UP/DOWN
constants + to_char() method required for the dispatch path.

PLAN.md header bumped to Phase 20 complete.
2026-06-20 20:03:43 +03:00
vasilito 0d999dc4ed tlc: add missing key constants (LEFT/RIGHT/UP/DOWN) and to_char() method 2026-06-20 19:57:00 +03:00
vasilito 714f7c2115 tlc: add post-copy verification to recipe install loop 2026-06-20 19:51:35 +03:00
vasilito 933336180f docs: ratatui §13.14 + §14 — bump to v1.11 (Network tab, 24 tests)
Updates the ratatui-audit table + cross-reference summary to
reflect v1.11:

  §13.14 audit table:
    - v1.11 entry: 'No Network tab' → 'Implemented in v1.11'
    - LoC count: ~4400 → ~5150 across 17 modules, 17 → 24 unit tests
    - Module count: 15 → 17

  §14 cross-reference:
    - '~4900 LoC across 16 modules, with 17 unit tests'
      → '~5150 LoC across 17 modules, with 24 unit tests'
    - 'sysfs/MSR + meminfo + DMI + battery + hwmon'
      → 'sysfs/MSR + meminfo + DMI + battery + hwmon + net'
    - 'AMD CPU fallback' → 'AMD CPU + net/sysfs fallback'
    - '17 unit tests' → '24 unit tests (bench + sensor + network)'

Source code (network.rs + main.rs + render.rs) and full §35 +
v1.11 plan/consolehdk doc already landed in commit dfed245e4a
(tlc bundled). This commit catches up the ratatui cross-reference
doc that didn't fit in that bundle.
2026-06-20 19:41:59 +03:00
vasilito f9df87d56b tlc: guard install loop with file-existence check to skip missing binaries 2026-06-20 19:38:27 +03:00
vasilito dfed245e4a tlc: fix menubar render methods placement and add missing key constants 2026-06-20 19:33:40 +03:00
vasilito ea854a71d9 redbear-power: v1.10 — Per-CPU Pkg temp from hwmon (k10temp fallback)
Closes the v1.9 forward-work item (§33.7). Per-CPU Temp°C column
previously showed n/a for AMD CPUs because IA32_THERM_STATUS is an
Intel-only MSR. v1.10 falls back to hwmon when MSR unavailable.

New helper SensorInfo::pkg_temp_c(cpu_index) in sensor.rs:
- Recognizes k10temp Tctl (AMD Zen / Zen 2 / Zen 3 / Zen 4 / Zen 5)
- Recognizes coretemp 'Package id 0' (Intel, forward-compat)
- Recognizes zenpower Tdie (AMD alt driver)
- Returns None if no recognized CPU temp chip
- cpu_index reserved for future multi-socket support

Updated App::refresh() — per-CPU loop:
- If MSR fails (Intel-only path), call self.sensors.pkg_temp_c(row.id)
- PROCHOT/Critical/PowerLimit flags set to false in fallback path
  (k10temp doesn't expose these — honest empty-state pattern,
  don't fake flag values that the source can't provide)

Linux host smoke test (AMD Ryzen 9 7900X):
- Before: every CCD row showed n/a for Temp°C
- After: every CCD row shows 85 (k10temp Tctl value, °C)

5 new unit tests:
- pkg_temp_c_from_k10temp_tctl (AMD Zen)
- pkg_temp_c_from_coretemp_package_id_0 (Intel)
- pkg_temp_c_from_zenpower_tdie (AMD alt)
- pkg_temp_c_returns_none_when_no_chip (Redox)
- pkg_temp_c_ignores_unrelated_chips (nvme Composite != CPU temp)

Total: 17/17 tests pass (5 bench + 12 sensor).

Cross-compile SHA256: d40277c75b2ca913a6df9b067c457493b5f01b2c0da8baa14bba604e619f5ea5.

Docs: improvement plan §34, CONSOLE-TO-KDE §3.3.2 v1.10,
RATATUI-APP-PATTERNS §13.14 + §14 (17 tests, 4945 LoC).
2026-06-20 18:59:27 +03:00
vasilito 69e6f2a84d redbear-power: v1.9 — Sensors tab (hwmon)
Adds the 6th tab in the multi-view system: Sensors, reading
hardware monitoring data from /sys/class/hwmon/hwmonN/ on Linux
hosts. Detects all chips (k10temp, coretemp, nvme, mt7921, r8169,
spd5118, zenpower, etc.) and their temp/fan/voltage/power/current
sensors with proper unit conversions.

New module sensor.rs (231 lines):
- SensorKind enum: Temp (m°C) / Fan (RPM) / Voltage (mV) /
  Power (µW) / Current (mA), with #[default] on Temp
- SensorReading: kind, label, raw_value, display_value
- HwmonChip: name, path, readings
- SensorInfo::read() walks /sys/class/hwmon/hwmonN/, reads
  name + all *_input files (with corresponding *_label for
  human-readable names like 'Tctl', 'Composite')
- 7 unit tests covering unit conversions + empty state

Updated app.rs:
- New field sensors: SensorInfo, refreshed every 3rd tick
  (1.5 sec at POLL_MS=500). 3-tick modulus is coprime to
  meminfo's 4 and battery's 5 — no thundering-herd syscalls.
- TabId::Sensors variant (6th tab)
- TabId::next() cycles PerCpu → System → Info → Motherboard →
  Battery → Sensors → PerCpu

Updated render.rs:
- New render_sensor_panel(app, focused) with per-chip sections
  using ▸ arrow + chip name as bold header, then Label/Value pairs
  in 12-char left-aligned label / 14-char right-aligned value
  layout. Empty state: '(no sensors detected — /sys/class/hwmon/
  not readable)' rather than wall of ?.
- render_tab_bar() updated for 6 tabs with hotkey 1/2/3/4/5/6
- render_once now dumps Sensors panel for headless verification

Updated main.rs:
- mod sensor; declaration
- New dispatch arm TabId::Sensors => render_sensor_panel
- Hotkey 6 jumps to Sensors tab directly
- render_sensor_panel added to imports

Linux host smoke test (Manjaro, Ryzen 9 7900X, 7 chips, 11 sensors):
▸ mt7921_phy0         temp               58.0 °C
▸ r8169_0_e00:00      temp               51.0 °C
▸ k10temp             Tccd1              82.6 °C
                      Tccd2              57.1 °C
                      Tctl               85.6 °C
▸ nvme                Sensor 2           53.9 °C
                      Composite          50.9 °C
                      Sensor 1           50.9 °C
▸ spd5118             temp               50.0 °C
▸ spd5118             temp               51.5 °C
▸ nvme                Composite          48.9 °C

Unit conversions verified: m°C → °C (50850 → 50.9°C), mV → V,
µW → W, mA → A. Unit tests: 12/12 pass (5 bench + 7 sensor).

Source state: 4885 LoC across 16 modules.
Redox stripped: 3.8 MB (SHA256 7a7c31bc...).

Docs: improvement plan §33, CONSOLE-TO-KDE §3.3.2 v1.9,
RATATUI-APP-PATTERNS §13.14 + §14 (16 modules, 12 tests).
2026-06-20 18:46:30 +03:00
vasilito d4cb65fcff tlc: phase 19 — column (rectangular) block operations
Adds MC's column-block selection to the editor. Algorithm
cross-references MC WEdit::column_highlight + MarkColumn* key
bindings in misc/mc.default.keymap.

Cursor changes:
  - SelectionMode::{Stream, Column} enum
  - column_anchor: Option<usize> (parallel to anchor)
  - column_selection_rect() → normalized ColumnRect
  - selected_text() / delete_selection() handle column mode:
      * Column copy text = rows joined by \n
      * Column delete strips rectangle cols from each line,
        cursor lands at top-left corner, anchor cleared
  - start_selection() / start_column_selection() are
    mutually exclusive (switching clears other anchor)
  - has_selection() / clear_selection() honor both modes

Keybindings (editor/handlers.rs):
  - Alt+Left/Right → MarkColumnLeft/Right (column horiz extend)
  - Alt+Up/Down   → MarkColumnUp/Down   (column vert extend)
  - Alt+PgUp/PgDn → MarkColumnPageUp/Down (column page extend)
  - Existing Shift+Arrow still produces stream selections

Renderer (editor/render.rs):
  - new line_selection_range() helper returns per-line byte
    range from either stream or column source
  - column cells get [editor] editmarked background highlight
  - syntect path naturally uses byte ranges, so column highlight
    composes with syntax coloring

Tests: 1119 passed (was 1117, +2 handler tests; cursor +7 tests).

PLAN.md: §15d row 21 marked  Done; Changelog entry added.
2026-06-20 18:41:10 +03:00
vasilito 32fac97c3f docs: ratatui §14 cleanup — collapse duplicated §14 headers + add v1.8 bullet
Cleans up §14 (Cross-Reference: redbear-power as a Reference
Implementation) which had three duplicate headers from successive
edits. Collapses to a single canonical version and adds the
v1.8-specific bullet:

  'Testable — bench module has 5 unit tests covering all stress
   modes + toggles'

Net change: -25 lines, +2 lines.

Source code for v1.8 (bench.rs + main.rs + render.rs) and full
docs for §32 + v1.8 in improvement plan + CONSOLE-TO-KDE plan
landed in commit d6ac3d1377 (qtbase bundled). This commit
completes the doc-only cleanup that didn't fit in that bundle.
2026-06-20 18:22:58 +03:00
vasilito d6ac3d1377 qtbase: add PKG_CONFIG_EXECUTABLE for cross-compilation CMake configure 2026-06-20 18:19:20 +03:00
vasilito e6cf3b7a81 libwayland: add -lc to LDFLAGS for relibc linking 2026-06-20 18:07:04 +03:00
vasilito bd51083a4e tlc: PLAN.md — log Phase 18 completion (all 16 dialogs migrated)
Phase 18 dialog popup shell migration is now complete. All 16
dialogs from the Phase 17 follow-up list have been migrated to
terminal::popup::render_popup, giving them all the MC-matching
rounded borders + drop shadow chrome.

Commits in the Phase 18 series:
  e4987256f7 — Phase 18a: filter, encoding, pattern, confirm,
                          overwrite, layout, panel_options, chattr
  2b2b5803ba — Phase 18c: permission, owner, connection, config,
                          compare, sort, progress
  c032c9a787 — menubar dropdown (via user commit)

Tree (full-screen directory tree) intentionally skipped — uses
the entire frame area, not a centered popup, so it does not
benefit from the popup shell or drop shadow.

Remaining Clear uses in the codebase are all legitimate:
  - menubar top F9 bar (not a popup)
  - tree.rs (full-screen dialog)
  - popup.rs (render_popup itself)
  - dialog.rs (Dialog widget body clear)

Tests: 1112 passed; release binaries build clean.
2026-06-20 18:01:45 +03:00
vasilito c032c9a787 config: disable relibc-phase1-tests (linker errors, not critical for ISO) 2026-06-20 17:55:47 +03:00
vasilito f15fbadf91 redbear-power: v1.7 — per-tick battery refresh (closes v1.6 forward work)
Closes the v1.6 forward-work item from §30.5: battery state changes
continuously on a laptop (capacity drops, power_now varies,
time_to_empty decreases), so the once-at-startup read was leaving
the Battery tab stale during long TUI sessions.

Updated app.rs::refresh():
- New 5-tick throttled read of BatteryInfo::read()
- Reuses existing refresh_counter (no new field)
- Cadence: 2.5 sec at default POLL_MS=500 (0.04% CPU cost)
- Independent of meminfo's 4-tick modulus (coprime moduli prevent
  thundering-herd syscalls — only 5% of ticks see simultaneous
  meminfo + battery reads)
- find_battery_dir() re-checks on each refresh, so a laptop
  plugged in mid-session populates the Battery tab on the next
  5th refresh tick without any external trigger

Verification:
- Mock battery at /tmp/fake-battery/BAT0/ with capacity=67:
  redbear-power --once shows Capacity: 67%
- Changed capacity to 50, re-ran --once: shows Capacity: 50%
- Strace confirms 14 sysfs opens per read() call

Cadence rationale (modulus 5 chosen):
- Every tick (500ms): 0.2% CPU — too aggressive
- Every 5th tick (2.5s): 0.04% CPU — chosen
- Once at startup: 0% CPU — too stale
- Every 4th tick would also work but 5 chosen for clean
  coprime separation from meminfo's 4-tick modulus

Build: same 3.8 MB stripped Redox binary (single if branch added).
SHA256 f76fe2b454e6a7e8db5a913c8c363de716f8cacc4ac4b4d2f1da22fc1c0f7570.

Docs: improvement plan §31, CONSOLE-TO-KDE §3.3.2 v1.7,
RATATUI-APP-PATTERNS §13.19 (coprime moduli pattern) + §14.
2026-06-20 17:55:00 +03:00
vasilito 2b2b5803ba tlc: phase 18c — migrate 7 more dialogs to render_popup
Continue Phase 18 mechanical migration of centered dialogs to the
shared terminal::popup::render_popup() shell (MC-matching rounded
borders + drop shadow):

  permission, owner, connection_dialog, config_dialog,
  compare, sort_dialog, progress

All 7 share the same pattern: inline Clear + Block + title replaced
with render_popup() + centered_cols_rect()/centered_percent_rect().
Title color now derives from [dialog] dtitle via the unified shell.

compare.rs also dropped its local centered_rect helper (used only
for the popup shell; the body Block stays inline since it's a
sub-frame, not the popup shell).

Tree (full-screen directory tree dialog) intentionally skipped — it
uses the entire frame area, not a centered popup, so it does not
benefit from the popup shell or shadow.

Tests: 1112 passed (no regressions).
2026-06-20 17:49:50 +03:00
vasilito a4dc44a8e0 redbear-power: v1.6 — Battery tab (power_supply)
Adds the 5th tab in the multi-view system: Battery, reading
power_supply data from /sys/class/power_supply/BAT*/ on Linux hosts.

New module battery.rs (128 lines):
- BatteryInfo struct with 15 fields (available, name, status,
  capacity_percent, energy_now_wh, energy_full_wh, power_now_w,
  voltage_now_v, time_to_empty_s, time_to_full_s, cycle_count,
  technology, model_name, manufacturer, serial_number)
- find_battery_dir() scans /sys/class/power_supply/ for type==Battery
- read() populates all fields with inline µWh→Wh, µV→V conversion
- health_percent() computes current_charge / full_charge ratio
- display/display_u32/display_u64/display_f64 helpers
- format_duration(secs) — Xh Ym / Ym Zs / Zs
- RBP_BATTERY_PATH env override (testing + dev workflow)

Updated app.rs:
- New field battery: BatteryInfo, initialized once in App::new()
- TabId::Battery variant (5th tab)
- TabId::next() cycles PerCpu → System → Info → Motherboard → Battery

Updated render.rs:
- New render_battery_panel(app, focused) with 3 section blocks
  (Identity / State / Power). If !available, shows
  '(no battery detected — /sys/class/power_supply/BAT* not present)'.
- render_tab_bar() updated for 5 tabs with hotkey 1/2/3/4/5 mapping
- render_once now dumps Battery panel for headless verification

Updated main.rs:
- mod battery; declaration
- New dispatch arm TabId::Battery => render_battery_panel
- Hotkey 5 jumps to Battery tab directly
- render_battery_panel added to imports

Mock battery smoke test (RBP_BATTERY_PATH=/tmp/fake-battery):
- Manufacturer: MSI, Model: MPG X670E, Technology: Li-ion, Cycles: 127
- Status: Discharging, Capacity: 67%, Health: 67%
- Energy: 33.50 Wh / 50.00 Wh (µWh→Wh conversion verified)
- Power: 8.50 W, Voltage: 12.50 V (µV→V conversion verified)
- Time to empty: 3h 0m, Time to full: ? (correctly hidden when 0)

On desktop (no battery):
(no battery detected — /sys/class/power_supply/BAT* not present)

Source state: 4359 LoC across 15 modules (v1.5: 4117/14).
Redox stripped: 3.8 MB (SHA256 c6fca172...).

Docs: improvement plan §30, CONSOLE-TO-KDE §3.3.2 v1.6,
RATATUI-APP-PATTERNS §13.18 + §14.
2026-06-20 17:44:11 +03:00
vasilito e4987256f7 tlc: phase 18a — migrate 8 dialogs to render_popup
Same mechanical pattern as Phase 17 skin_dialog. Each dialog now
inherits the MC-matching rounded borders + drop shadow from the
shared terminal::popup::render_popup() shell:

  filter_dialog, encoding_dialog, pattern_dialog, confirm_dialog,
  overwrite_dialog, layout_dialog, panel_options, chattr_dialog

Changes per file:
  - Remove import of Block, Borders, Clear
  - Add import of centered_cols_rect, render_popup
  - Replace inline geometry+Clear+Block with centered_cols_rect()
    + render_popup() call
  - Title no longer needs manual styling (render_popup applies
    [dialog] dtitle colors)

confirm_dialog also dropped its BorderType::Double variant (now
matches the rest of TLC's rounded look); removed its now-unused
local centered_rect helper.

Tests: 1112 passed (no regressions; same count as pre-Phase 18).
2026-06-20 17:31:58 +03:00
vasilito 22770719da tlc: add missing ratatui imports (Clear, Block, Borders) in pattern_dialog.rs 2026-06-20 17:23:19 +03:00
vasilito 55962aa1ab build: remove kwin from PRECOOK_PKGS (blocked by QML/Quick JIT, redbear-compositor provides compositor) 2026-06-20 17:21:27 +03:00
vasilito 6a7983f576 qtbase: ensure libredbear-qt-strtold-compat is in sysroot usr/lib for linking 2026-06-20 16:54:23 +03:00
vasilito b354edad97 redbear-power: v1.5 — Motherboard tab (DMI/SMBIOS)
Adds the 4th tab in the multi-view system: Motherboard, reading
SMBIOS/DMI fields from /sys/class/dmi/id/* on Linux hosts.

New module dmi.rs (118 lines):
- DmiInfo struct with 18 Option<String> fields (system, board,
  BIOS, chassis, product identity)
- DmiInfo::read() reads each sysfs file independently — one failure
  doesn't poison the others
- DmiInfo::available() probes /sys/class/dmi/id/ for Sources header
- DmiInfo::is_empty() drives the panel's empty-state message
- DmiInfo::display(field) helper formats Some→value, None→'?'

Updated app.rs:
- New field dmi: DmiInfo, initialized once in App::new() (no per-tick
  refresh — DMI is static)
- TabId::Motherboard variant (4th tab)
- TabId::next() cycles PerCpu → System → Info → Motherboard → PerCpu

Updated render.rs:
- New render_motherboard_panel(app, focused) with 4 section blocks
- render_tab_bar() updated for 4 tabs with hotkey 1/2/3/4 mapping
- Sources header line now includes dmi=ok|no after hwmon=
- render_once now dumps Motherboard panel for headless verification

Updated main.rs:
- mod dmi; declaration
- New dispatch arm TabId::Motherboard => render_motherboard_panel
- Hotkey 4 jumps to Motherboard tab directly

Linux host smoke test (Manjaro, MSI MPG X670E CARBON WIFI):
- Manufacturer: Micro-Star International Co., Ltd.
- Product: MS-7D70
- Board: MPG X670E CARBON WIFI (MS-7D70), Version 1.0
- BIOS: AMI, 1.74, 05/12/2023, Release 5.26
- Chassis: Type 3 (Desktop)
- Serial/UUID correctly report '?' (root-only readable)

Sources header: MSR=ok PSS=no load=ok gov=ok hwmon=ok dmi=ok

Source state: 4117 LoC across 14 modules (v1.4: 3864/13).
Redox stripped: 3.7 MB (SHA256 c44d508c...).

Docs: improvement plan §29, CONSOLE-TO-KDE §3.3.2 v1.5,
RATATUI-APP-PATTERNS §13.17 + §14.

Note: dmi.rs + app.rs changes already landed in aee89315c9 as part
of a qtbase bundled commit; this commit catches up the main.rs
dispatch arm + render.rs panel wiring + all docs that were missing.
2026-06-20 16:48:39 +03:00
vasilito aee89315c9 qtbase: add explicit dbus include paths for cross-compilation 2026-06-20 16:38:02 +03:00
vasilito 2d77249d60 tlc: PLAN.md — log Phase 17 skin_dialog + 16 follow-up candidates
Document Phase 17 (skin_dialog popup shell migration) and enumerate
the 16 remaining dialogs that still bypass render_popup:

  sort, compare, overwrite, filter, tree, encoding, connection,
  layout, owner, panel_options, pattern, confirm, config,
  permission, chattr, progress

Each is ~50-100 LOC of refactor work (replace inline Clear+Block
with render_popup call). Same premium chrome (rounded borders,
MC-matching drop shadow) as Phase 17.
2026-06-20 16:36:11 +03:00
vasilito effc45d26d tlc: phase 17 — skin_dialog adopts shared popup shell
Migrate src/filemanager/skin_dialog.rs::render() from the bespoke
Clear+Block shell (no shadow, square borders) to
terminal::popup::render_popup (rounded borders + MC-matching drop
shadow + centered layout).

This makes skin_dialog visually consistent with all 13 other TLC
dialogs that already use render_popup. The /tmp/5.png screenshot
(showing the skin selector without shadow) is now fixed — every
TLC dialog has identical premium chrome.

Deleted:
  - Duplicate 'centered_rect' helper (replaced by popup::centered_percent_rect)
  - Inline Block construction
  - Manual Clear render

Added:
  - render_drops_shadow_outside_popup test asserts the bottom-right
    cell carries theme.shadow background (assertion of MC's
    tty_draw_box_shadow algorithm at the dialog level).

Tests: 1112 passed (was 1111, +1).
2026-06-20 16:32:34 +03:00
vasilito b192842f8e docs: redbear-power v1.3 + v1.4 — Linux-host fallbacks + System tab memory + OS info
Documents the v1.3 and v1.4 releases of redbear-power.

v1.3 (per user 'still same n/a, nothing changed'):
- platform.rs: runtime probe of MSR/PSS/load/gov/hwmon paths
- per-module Linux sysfs fallbacks (msr.rs, acpi.rs, cpufreq.rs)
- removed hardcoded P0..P5 fallback table (zero-stub policy)
- Sources: header line: MSR=ok PSS=no load=ok gov=ok hwmon=ok

v1.4 (per user 'continue implementing more features from cpu-x'):
- meminfo.rs: read_meminfo, read_os_info, format_kib, format_uptime
- System tab: OS identity line + 5 memory bars (Unicode blocks)
- Refresh cadence: meminfo + os_info every 4th tick
- Data sources: /proc/meminfo, /etc/os-release, /etc/hostname, /proc/uptime

Status: v1.4 cross-compiles to Redox target (3.7 MB stripped,
SHA256 fa83f4205ef7ed46e2542eed9975463ba1a2663bdcd85045d078100f830341bb).

Source code: cc8932922f (redbear-power v1.4 + qtdeclarative bundled).
This commit documents v1.3 + v1.4 status without re-tagging the
historical bundled commit.

Improvement plan: local/docs/redbear-power-improvement-plan.md §28 (v1.4)
Plan doc: local/docs/CONSOLE-TO-KDE-DESKTOP-PLAN.md §3.3.2 v1.3 + v1.4
Ratatui doc: local/docs/RATATUI-APP-PATTERNS.md §13.14-§13.16, §14
2026-06-20 16:32:11 +03:00
vasilito 9117e3d149 qtbase: add OPTIONS support to qt_internal_add_resource for qtdeclarative 6.11.0 compatibility 2026-06-20 16:25:40 +03:00
vasilito fc9a4a5423 qtdeclarative: remove broken OPTIONS patch, revert to original CMakeLists 2026-06-20 16:22:16 +03:00
vasilito 32ae049ed5 qtdeclarative: use external Python script for CMakeLists patch 2026-06-20 16:18:23 +03:00
vasilito 2e8144835f qtdeclarative: use Python instead of sed for CMakeLists patch 2026-06-20 16:17:07 +03:00
vasilito cc8932922f qtdeclarative: fix qt_internal_add_resource empty target in cross-compilation 2026-06-20 16:16:25 +03:00
vasilito 00bc6990eb tlc: phase 16+ — add ButtonKind::Narrow + unicode-safe width tests
After cross-referencing MC's button.c (lib/widget/button.c) and the
ratatui button pattern survey, two gaps remained in Phase 16:

1. MC defines NARROW_BUTTON ([X], no inner padding) — adds for
   future compact toolbar/dialog use. Width formula: label + 2.

2. While width was already chars().count() (Unicode-safe CJK), no
   test asserted this. Added explicit assertion: '日本語' Normal = 7,
   Default = 9 cells.

Tests: 1111 passed (was 1109, +2).
Binaries rebuild clean.

Ref: MC lib/widget/button.c button_flags_t {NORMAL,DEFPUSH,NARROW,HIDDEN}.
2026-06-20 16:09:33 +03:00
vasilito c4d4bdc586 tlc: phase 16 — unified MC-matching button rendering
Replace 5 dialog-specific button renderings + Dialog widget inline loop
with a single widget::button module. MC algorithm verbatim:
  Normal:   '[ X ]'        (label + 4)
  Default:  '[< X >]'       (label + 6)

Hotkey letter highlighted via [dialog] dhotfocus when focused,
dhotnormal otherwise. Variable button count, auto-sized, centered.

Files:
  src/widget/button.rs           — rewritten as free functions
                                   (render_button, render_default_button,
                                   render_button_row, button_width) + 5 tests
  src/widget/mod.rs              — re-export public API
  src/widget/dialog.rs           — Dialog::render button loop → render_button_row
  src/terminal/popup.rs          — duplicate render_button_row + push_mc_button deleted
  src/filemanager/{copy,delete,link,mkdir,move}_dialog.rs — migrated

Tests: 1109 passed (was 1108; +1 widget::button).
Binaries: tlc 5.4M, tlcedit 3.9M, tlcview 3.8M.

Docs:
  PLAN.md §16 — Phase 16 added (premium ratatui button pattern)
  IMPROVEMENT-PLAN.md — Phase 1.5 entry marked Done

Refs: cross-referenced MC source (button.c, widget.c, tty.c) for the
exact bracket/chevron algorithm + dhotfocus/dhotnormal color picks.
2026-06-20 16:04:29 +03:00
vasilito cebe6aa536 build: reduce COOKBOOK_MAKE_JOBS to 8 to avoid OOM during Qt6 builds 2026-06-20 15:36:20 +03:00
vasilito abae1b86b6 docs: redbear-power §27 — v1.3 Linux-host fallbacks implemented
Implements the three gaps from §26:
- Phase A: new platform.rs (291 lines) with runtime probes for
  MSR, ACPI PSS, /proc/stat, cpufreq sysfs, hwmon — emits one
  eprintln! diagnostic per source at startup
- Phase B: msr.rs reads /dev/cpu/{cpu}/msr on Linux via lseek+pread;
  acpi.rs read_load falls back to /proc/stat; acpi.rs read_acpi_pss
  reads /sys/devices/system/cpu/cpu*/cpufreq/scaling_available_frequencies;
  cpufreq.rs reads/writes /sys/.../scaling_governor. Removed the
  hardcoded P0..P5 fallback table (violates zero-stub policy).
- Phase C: replaced misleading "MSR: not available (QEMU?)" with a
  "Sources: MSR=ok  PSS=no  load=ok  gov=ok  hwmon=ok" header line
  that shows per-source availability at a glance.

Verified on AMD Ryzen 9 7900X (24 threads, AMD-pstate driver):
- /dev/cpu/0/msr detected (probes ok; reads blocked by CAP_SYS_RAWIO
  for non-root users — kernel-level permission, not a code issue)
- /proc/stat readable (load populated after second refresh tick)
- /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor readable
  (governor shows "powersave")
- hwmon2 (k10temp) detected (not yet wired into per-CPU temp column —
  requires per-driver hwmon→tempX_input mapping, deferred to v1.4)
- PSS=no (amd-pstate driver does not expose scaling_available_frequencies)

v1.3 source: 3501 LoC across 12 modules. Cross-compiled Redox binary
3.3 MB stripped, SHA256 cbc0a6d04e9d9252314dd71a1c411d4c488417e25f8d860970f718990864431a.

What is NOT yet wired (deferred to v1.4):
- Hwmon→per-CPU temp mapping (k10temp Tdie is package-level only)
- MSR reads without root (CAP_SYS_RAWIO required)
- zenpower / zen 5+ per-driver logic
2026-06-20 15:23:25 +03:00
vasilito 8eef4025ce build: reduce COOKBOOK_MAKE_JOBS from 32 to 16 to avoid OOM during Qt6 builds 2026-06-20 15:19:55 +03:00
vasilito 6c37c961f7 libxau: add rsync to copy source files before configure 2026-06-20 15:02:06 +03:00
vasilito 0cbec31366 libxau: fix recipe syntax - use proper custom script template 2026-06-20 14:59:17 +03:00
vasilito 04b7641e85 config: add x11proto dependency for libxau and SDDM
- Add x11proto to redbear-full.toml package list
- libxau recipe updated with x11proto dependency and custom build script
- Fixes libxau build failure: 'Package xproto was not found'
2026-06-20 14:57:46 +03:00
vasilito c98b3ad7c1 docs: update build status for SDDM, Mesa, and uutils fixes (v5.3)
CONSOLE-TO-KDE-DESKTOP-PLAN.md:
- Version bump to v5.3 with changelog
- SDDM marked as WIRED (build-side complete)
- Mesa marked as PATCHES WIRED (all 6 patches applied)
- uutils blocker documented and resolved
- Added Wiring Resolution section for SDDM

PACKAGE-BUILD-QUIRKS.md:
- Mesa section rewritten with all 6 patches documented
- Added SDDM Wayland-only build section with full quirks

BUILD-SYSTEM-HARDENING-PLAN.md:
- Added Phase 7: uutils/nix-0.30.1/relibc SaFlags type mismatch
- Added Invariant I4 for transitive Rust dependency version pinning
- Status updated to reflect Phase 7 resolution
2026-06-20 14:52:24 +03:00
vasilito 91b2011db3 docs: redbear-power §26 — cpu-x cross-reference for Linux-host gaps
Adds comprehensive analysis answering the user's "no per-core info"
question. Documents:

§26.1 Why every per-CPU column is empty on Linux (root cause)
  - 6-column trace (Freq, PkgW, Temp, P-state, State, Flags) + Load%
  - Maps Redox scheme paths to Linux equivalents (where they exist)
  - Identifies that two paths already have Linux fallbacks (detect_cpus,
    read_cpu_id) and four do not

§26.2 cpu-x patterns reviewed
  - 6-row comparison table: missing-MSR / daemon / per-source UI /
    refresh logic / CLI flags / temperature fallback
  - Concludes: redbear-power's "n/a" placeholder is already better UX
    than cpu-x's empty cells; daemon broker pattern is NOT applicable;
    retry-cache and per-source logging ARE worth adopting

§26.3 Recommended Phase A/B/C (v1.3)
  - Phase A: new platform.rs with /dev/cpu/*/msr + /proc/stat +
    /sys/devices/system/cpu/cpu*/cpufreq/ fallbacks, ~80-120 LoC
  - Phase B: replace hardcoded P0..P5 fallback (acpi.rs:101-108) with
    real sysfs reads; generalize read_load to /proc/stat
  - Phase C: header per-source availability badge

§26.4 AMD-specific concerns (separate from Linux fallback)
  - msr.rs reader is Intel-only by design (file comment)
  - AMD Zen uses 0xC0010063/0xC0010064 for P-states and k10temp for
    temp, not Intel MSR 0x19c
  - Recommended: vendor detection branch + Linux hwmon fallback

§26.5 Conclusion
  - Screenshot is NOT a bug — TUI is working as designed
  - Three substantive gaps: no Linux fallbacks, no per-source
    startup logging, no header availability summary
  - All three addressable without violating zero-stub policy

Source: cpu-x v4.7 at /tmp/cpu-x-src/ (cloned in earlier session).
2026-06-20 14:45:53 +03:00
vasilito 0ca2cdd1f4 uutils: bump libc 0.2.182 -> 0.2.186 for redox sa_flags c_int ABI
Fixes nix-0.30.1 crate build failure where SaFlags::from_bits_truncate()
expected i32 but libc-0.2.182 declared sa_flags as c_ulong (u64) on redox.
libc-0.2.186+ declares sa_flags as c_int (i32), matching relibc's header.

Also includes:
- Add nproc to feat_os_unix_redox feature list
- Remove redox-specific dev_t shims from fs.rs (now handled by libc)
- Add aarch64 locale workaround in locale.rs

Verified: repo cook uutils -> successful, coreutils ELF64 produced.
2026-06-20 14:45:24 +03:00
vasilito 35fab2c234 tlc: update tests + call sites for MC-only theme system
All  and  references updated to deref the LazyLock (). 1103 tests pass.

Editor render test now reads [editor] editlinestate from the MC .ini (with cursor_fg fallback) so the cursor-line color assertion matches the actual rendering.

Viewer match-highlight test reads [viewer] viewselected from the MC .ini (with warning fallback) — the test now matches the actual highlight bg color from julia256 (yellow on cyan).
2026-06-20 14:35:28 +03:00
vasilito 9c8583fd3a tlc: canonicalize skin_name to resolved theme name
FileManager.skin_name now stores the canonical MC skin name (e.g. "julia256") rather than the user-config alias (e.g. "default-dark"). When by_name() resolves a legacy alias to a real .ini skin, the resulting theme.name is what gets persisted.

apply_skin_selection follows the same rule.

Skin dialog tests use real MC skin names (dark, nicedark) and verify the catalog contains no TLC hardcoded presets (no more "default-dark", "mc-classic", etc. in the list).
2026-06-20 14:35:02 +03:00
vasilito 03b5f88bf6 tlc: MC .ini skins as ONLY theme source — drop all hardcoded palettes
Removes every hand-coded Theme constant. julia256 is the new default; sand256 is the light fallback. All 39 bundled MC skins are now reachable by name, and legacy aliases (default-dark, mc-classic, nord, etc.) resolve to real .ini skins.

Architecture:

  - DEFAULT_THEME / LIGHT_THEME are LazyLock<Theme> initialised on first use.

  - parse_theme now reads ALL MC sections: core, statusbar, buttonbar, dialog, error, filehighlight, viewer.

  - shadow field comes from [core] shadow (MC's gray;black pattern).

  - render_drop_shadow matches MC's tty_draw_box_shadow algorithm exactly: two background-recolor rectangles (2-col right strip + 1-row bottom strip offset by 2 cols), no glyph change.

Removes redbear_tui_theme import — TLC no longer has its own palette.
2026-06-20 14:34:42 +03:00
vasilito efbd295cce docs: redbear-power v1.2 — config file, AMD CCD, tabs, D-Bus methods
Updates the v1.1 §24 deferred items to "implemented in v1.2".

CONSOLE-TO-KDE-DESKTOP-PLAN.md:
- New §3.3.2 v1.2 section after v1.1, documenting:
  - Config file (TOML): /etc/redbear-power.toml + ~/.config/redbear-power.toml
  - AMD Zen CCD topology via leaf 0x8000001E (NC field) and 0x80000026 (Zen 4+)
  - Multi-view tab system (Per-CPU / System / Info) with Tabs widget
  - D-Bus methods: cycle/set_governor, toggle_throttle, force_*, set_pstate
  - Mouse sub-panel navigation (left/right/middle click conventions)
- v1.2 source state: 2758 LoC across 11 modules; 3.2 MB stripped binary

redbear-power-improvement-plan.md:
- New §25 "Status Update — v1.2 Deferred Items Implemented"
- Removes the v1.1 §24 "Remaining work" list (all items now implemented)
- Documents implementation order and final module structure

ISO rebuild status: still blocked by pre-existing upstream nix-0.30.1
vs Redox relibc SaFlags incompatibility in uutils.
2026-06-20 14:24:24 +03:00
vasilito d53d9d7aff redbear-power: v1.2 — config file, AMD CCD, tab system, D-Bus methods
Completes the remaining plan §24 deferred items:

- Config file (TOML): new config.rs module loaded from
  /etc/redbear-power.toml and ~/.config/redbear-power.toml (with
  --config <path> override). Sections: display, theme, keybindings,
  benchmark. --help documents the full schema.

- AMD Zen CCD topology: cpuid.rs detect_hybrid now parses leaf
  0x8000001E NC field (cores per CCX) and Zen 4+ leaf 0x80000026
  (CCD count + cores per CCD). Linux host with 24 AMD cores now
  shows CCD0..CCD5 grouping instead of all-Unknown.

- Multi-view tab system: Per-CPU / System / Info tabs via ratatui
  Tabs widget. Hotkeys 1/2/3 jump directly; T cycles. System tab
  shows aggregate CPU stats (avg freq, max temp, total pkg power,
  aggregate flags, bench status). Info tab shows detailed CPU
  identification (family/model/stepping hex, full flags list,
  per-level cache hierarchy with KB+way+line size). New
  render_tab_bar / render_system_panel / render_info_panel render
  functions in render.rs. TabId enum added to app.rs.

- D-Bus methods: added CycleGovernor, SetGovernor(name),
  ToggleThrottle, ForceMinPstate, ForceMaxPstate, SetPstate(target)
  methods to org.redbear.Power. PowerCommand enum + command
  channel back to main thread for MSR-bound actions. New App
  methods set_governor(Governor) and set_selected_pstate(i32)
  enable D-Bus clients to set governor/P-state without sending
  keystrokes.

- Mouse sub-panel navigation: refined hit-test so left-click on
  header/controls cycles governor, right-click toggles throttle,
  middle-click on table expands P-state. Header now has two
  distinct actions (governor + throttle) reachable via different
  mouse buttons without per-label x hit-test.

New dependencies in Cargo.toml: toml = "0.8", dirs = "5",
serde = { version = "1", features = ["derive"] }.

Verification:
- cargo build --release (host): 0 errors.
- ./redbear-power --once: shows tab bar + Per-CPU view.
- ./redbear-power --config /tmp/rp-test/config.toml: respects
  refresh_ms override (50ms minimum enforced).
- AMD CCD labels visible: '▶ CCD0' / 'CCD1' / etc.
- cook redbear-power (Redox target): 3.2 MB stripped binary at
  local/recipes/system/redbear-power/target/x86_64-unknown-redox/stage/usr/bin/redbear-power.
  SHA256: 58b7812a5f673e227753c01e93a05678bd9e8f28101d8a447d70d4943170c40a.

ISO rebuild status: still blocked by pre-existing upstream nix-0.30.1
vs Redox relibc SaFlags incompatibility in uutils. v1.2 binary
is staged and will be packaged into the next successful ISO build
once that issue is resolved.

Source size: 2758 LoC across 11 modules (was 2376/10 in v1.1).
2026-06-20 14:21:06 +03:00
vasilito ed92bce14b redbear-power: v1.1 — full Phase A→D implementation
Comprehensive implementation per local/docs/redbear-power-improvement-plan.md.

Source: 2376 LoC across 10 modules (was 1396/6 in v0.6, +980 LoC).
Cross-compile: 2.8 MB stripped Redox ELF binary.
SHA256: 1b6f9db6ce79e77957bbb1fd606c430516015d5f02f3b64cb6f395e2f63b8e04

Modules:
- main.rs     (376) — event loop, key + mouse dispatch, render orchestration
- app.rs      (421) — App, CpuRow, Governor, ThrottleMode, PackageThermal, HybridInfo
- render.rs   (498) — header/table/controls/help/snapshot rendering
- acpi.rs     (166) — CPU enumeration, ACPI _PSS, CPUID fallback
- cpuid.rs    (350) — CPUID leaf decoding (vendor, family, model, SIMD, cache, hybrid)
- bench.rs    (123) — prime-sieve stress benchmark for thermal response testing
- dbus.rs     (202) — D-Bus export via zbus 5 (org.redbear.Power, --dbus flag)
- msr.rs      (127) — MSR constants + PackageThermal decoder
- cpufreq.rs  (50)  — governor hint read/write
- theme.rs    (72)  — central color palette (const Style)

Phase A — bug fixes:
- R1: PROCHOT pulse bug — Instant::now() math always ~0, pulse never toggled.
  Replaced with Frame::count() so the bar pulses at a frame-rate-stable rate.
- R5: removed duplicate comment block in snapshot().
- C2: PackageThermal struct + 13 PKG_THERM_* bit constants; full decode of
  IA32_PACKAGE_THERM_STATUS (PL1/PL2/CRIT/TT1/TT2/HFI/temp) surfaced in header.

Phase B — quality:
- R3: input poll decoupled from refresh cadence (50ms vs 250-2000ms).
- R4: Rect::centered replaces hand-rolled centered_rect helper.
- R6: area.layout(&Layout) destructuring with compile-time size check.
- O2: theme.rs central color palette (LABEL, BORDER_*, STATUS_*).
- C9: ratatui 0.30 Stylize shorthand across all renders.

Phase C — features:
- C1/C8: cpuid.rs reads leaves 0/1/4/7/0x80000000+/0x1A/0x8000001E.
- C3: SIMD display header line.
- C5: cache hierarchy header line.
- C7: dynamic refresh interval via / key (typed input 50..60000ms + Enter).
- C6: prime-sieve benchmark via b/B keys (one thread per core, AtomicU64
  counter, run/stop/status).

Phase D remaining (was deferred per plan s23):
- C4: hybrid CPU detection (CoreType enum, Intel leaf 0x1A, AMD leaf 0x8000001E),
  per-CPU row prefixed with type label, Hybrid: 8P + 16E header.
- O1: termion MouseTerminal wrapper enables xterm mouse protocols.
  Wheel = scroll, Left-click = select/toggle, Right-click = expand P-state.
  hit_test() maps (x, y) to panel rects cached after every render.
- O3: dbus.rs publishes org.redbear.Power on session bus (opt-in via --dbus).
  Properties: cpu_count, avg_freq_khz, max_temp_c, avg_load_pct, governor,
  throttle_mode, prochot_asserted. Background thread owns the tokio runtime
  + zbus Connection; main thread sends snapshots via mpsc channel. Graceful
  degradation if redbear-sessiond is unreachable.

Verification:
- cargo build --release (host): 0 errors, 21 warnings.
- ./redbear-power --once (Linux host, AMD 24-core): renders all features.
- ./redbear-power --dbus (via script(1)): registers on session bus,
  emits xterm mouse capture sequences.
- cook redbear-power (Redox target): 2.8 MB stripped binary at
  local/recipes/system/redbear-power/target/x86_64-unknown-redox/stage/usr/bin/redbear-power.

ISO rebuild status: blocked by pre-existing upstream nix-0.30.1 vs Redox
relibc SaFlags incompatibility in uutils (recipes/core/uutils). The v1.1
binary IS staged and will be packaged into the next successful ISO build
once that issue is resolved (separate scope).

Docs:
- local/docs/CONSOLE-TO-KDE-DESKTOP-PLAN.md s3.3.2 - v1.0 + v1.1 sections.
- local/docs/redbear-power-improvement-plan.md s24 - full status update.
- local/docs/RATATUI-APP-PATTERNS.md - canonical ratatui 0.30 guide
  (1161 lines), includes s13 ratatui 0.30 Best-Practices Update + s14
  Cross-Reference redbear-power as a Reference Implementation.

Cargo.toml: new dependencies zbus = "5" (tokio feature) and tokio = "1"
(rt + rt-multi-thread + macros) for the D-Bus export.
2026-06-20 13:26:24 +03:00
vasilito 46c39c8aee tlc: tighten filepos privacy — 0600 permissions + reindent tests
Filepos DB reveals canonical paths of opened files. Use 0600 instead of default umask (0644) so other users cannot read it.

Reindent the HomeGuard struct / scoped_home function inside the #[cfg(test)] mod tests block (functionally correct, just hard to read before).
2026-06-20 13:01:33 +03:00