Commit Graph

775 Commits

Author SHA1 Message Date
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
vasilito 7d5b4088a6 tlc: fix F5/F6/F8 to MC parity — no-op on no selection
Reverts F5/F6/F8 from operating on current line (TLC extension) to MC behavior: do nothing when no selection is active. MC's eval_marks returns false when mark1==mark2, so F5/F6/F8 in MC are no-ops without a selection.

Removes the now-dead copy_line/cut_line/delete_line_no_sel helpers and their tests. Replaces with MC-parity no-op tests.

Extracts current_line_range() helper from select_current_line and duplicate_line_or_selection (also covers unindent_selection pattern). Removes ~50 lines of duplicated line-range computation.
2026-06-20 13:01:14 +03:00
vasilito e2d4da441f tlc: line-level ops — F5/F6/F8 on no-selection + select-line + duplicate
F5 (Copy), F6 (Move/Cut), F8 (Delete) now operate on the current line when no selection is active, matching MC semantics.

New bindings:

  Alt-Shift-L — select current line (incl. trailing newline)

  Ctrl-Shift-D — duplicate current line or selected block

New methods on Editor: select_current_line, copy_line, cut_line, delete_line_no_sel, duplicate_line_or_selection. 6 new tests cover both with-selection and without-selection paths.
2026-06-20 12:30:25 +03:00
vasilito f9ffe1947a tlc: update parity assessment — P4a+P4b complete (~93%)
Adds P4a (Ctrl-Insert, Shift-Delete, Ctrl-N, Shift-Tab) and P4b (filepos) rows. Updates the binding table to mark them as completed. Bumps total parity estimate from ~90% to ~93%.
2026-06-20 11:19:00 +03:00
vasilito d97e5b0f1a tlc: more editor bindings — Ctrl-Insert, Shift-Delete, Ctrl-N, Shift-Tab
Ctrl-Insert — Copy selection (MC Store, parity with F5).

Shift-Delete — Cut selection (MC Cut, parity with F6).

Ctrl-N — EditNew: clear buffer after save prompt if dirty.

Shift-Tab — Unindent selection by one tab width (MC parity).

Editor::unindent_selection() handles tab/space removal. Tests cover each binding's positive and negative paths.
2026-06-20 11:18:46 +03:00
vasilito d6aaf4e8af tlc: cursor position save/restore (filepos)
Adds per-file cursor position persistence (MC ~/.mc/filepos parity).

Storage: ~/.config/tlc/filepos as a tab-separated canonical-path database. Wired into editor/viewer open+close in both standalone binaries and the in-TLC file manager. CursorPos struct, save/load functions, restore_cursor_position() and save_cursor_position() methods on Editor and Viewer.

buttonbar.rs: add module-level doc to satisfy missing_docs lint.
2026-06-20 11:18:28 +03:00
vasilito 98b3ade744 tlc: update parity assessment — P3.5 complete (~90%)
Adds P3.5 row (start_line + buttonbar) and bumps total parity estimate from ~85% to ~90%.
2026-06-20 10:27:03 +03:00
vasilito 92ff00b6cc tlc: CLI +N argument for tlcedit/tlcview (MC parity)
Both binaries support MC-style +N positional: 'tlcedit +42 file.txt' opens at line 42. tlcview gains line support for the first time. main.rs updated for new open_file(file, start_line) signature.
2026-06-20 10:26:45 +03:00
vasilito 4e4863e122 tlc: FM→editor/viewer handoff with line numbers
FindOutcome::View/Edit now carry Option<u64> line number from FindHit. FileManager gains open_editor_at_line() and open_viewer_at_line() that jump to the target line after opening.
2026-06-20 10:26:28 +03:00
vasilito ca7f22ae34 tlc: start_line plumbing + buttonbar in editor/viewer
Editor gains goto_line(), viewer gains jump_to_line() + open_file(start_line). Both editor and viewer now render the F-key buttonbar at the bottom (1Help 2Save... / 1Help 2Wrap...).
2026-06-20 10:26:04 +03:00
vasilito a351544731 tlc: add shared buttonbar widget — F-key bar renderer
Shared render_buttonbar() function used by both editor and viewer to draw the MC-style function-key bar at the bottom of the screen.
2026-06-20 10:25:43 +03:00
vasilito 3d80ed0a40 tlc: MC parity P1+P2+P3 — 40+ keybindings, viewer parity, feature gaps (1094 tests) 2026-06-20 09:16:38 +03:00
vasilito c55fb91e8f tlc: tlcedit/tlcview full MC parity — E1-E5 (21 features, +2525 lines)
E1 — Wire broken features:
- Auto-indent on Enter (insert_newline_with_indent)
- Shift-Arrow selection bindings (6 keys)
- Ctrl-Home/Ctrl-End document navigation
- Nroff rendering in viewer (man page bold/underline)
- Viewer search (/) and goto-line (g) prompts
- Macro recording/playback (Ctrl-R/Ctrl-P)
- Search history dedup fix + n/N navigation

E2 — Editor visual premium:
- Vertical scrollbar (direct buffer manipulation)
- Accent-bar gutter (brand red stripe)
- Relative line numbers (Ctrl-L toggle)
- Cursor shape modes (Block/Bar/Underline)
- Completion popup with accent highlight

E3 — Functional parity:
- Word-wrap toggle (Alt-W)
- Viewer syntax highlighting (syntect integration)
- OSC 52 clipboard (SSH clipboard sharing)
- Save As prompt (Shift-F2)

E4 — Advanced features:
- Code folding (folding.rs, Ctrl-F1 toggle, gutter markers)
- Tags jump (tags.rs, Ctrl-]/Ctrl-T, TagTable parser)
- Replace per-match state infrastructure

E5 — Premium transitions:
- Dialog slide-in animation ( FileManager dialog_anim)
- Large-file loading indicator (spinner for >1MiB)
- Smooth scroll interpolation (PageUp/PageDown, 25%/tick)

New modules: cursor_shape.rs, folding.rs, tags.rs, clipboard_osc52.rs
Tests: 1093 passed (up from 1062)
2026-06-20 02:13:17 +03:00
vasilito b4a0d68f66 tlc: status bar clock + dialog scrollbars on help/jobs/find
Status bar now shows wall clock (HH:MM UTC) and spinner character
right-aligned. Native ratatui scrollbars added to Help, Jobs, and Find
dialogs when content overflows visible area.
2026-06-20 00:07:30 +03:00
vasilito 135439d763 tlc: editor visual polish — current-line highlight, bracket match, modified gutter mark
Current-line highlight (bg lightened by 12 per channel on cursor line),
bracket-match tracking (forward/backward search for ()[]{}<> pairs),
modified-line gutter mark (▌ in warning color when buffer is dirty).
bracket_flash field + find_matching_forward/backward methods on Editor.
2026-06-20 00:07:26 +03:00
vasilito 445edc39db tlc: panel visual polish — rounded borders, scrollbars, alt rows, 3D buttons
Rounded panel borders (BorderType::Rounded), native ratatui scrollbars
on file lists, alternating row colors (even rows lightened), file-size
inline bar in panel footer (█ proportional to largest file), 3D button
effect (▔ top + ▁ bottom rows when focused), and panel switch border
flash (cyan info color for 4 frames on Tab).
2026-06-20 00:07:05 +03:00
vasilito d79dc12af3 tlc: add animation tick loop, popup shadows, and FileManager animation state
100ms poll timeout with frame counter driving spinner/toast ticks.
Popup rendering gains drop shadows (▓), backdrop dim (Modifier::DIM),
and rounded borders. FileManager struct gets spinner, toasts,
frame_count, panel_switch_anim fields plus sync_animations() method.
2026-06-19 23:58:50 +03:00
vasilito 3164d82227 tlc: add spinner + toast widgets and visual Theme methods
Phase 1 animation foundation: braille spinner widget (10 frames),
toast notifications with slide-in animation (25% per frame), and 6 new
derived Theme methods (shadow, current_line_bg, alt_row_bg,
button_highlight, button_shadow, spinner_fg) for all subsequent visual
polish phases. 1041 tests pass.
2026-06-19 23:58:28 +03:00
vasilito d25a19b0cd Fix terminal resize hang: poll stdin with 200ms timeout
Blocking events.next() caused the app to hang indefinitely when the
terminal was resized without any key press — no data arrived on stdin
to wake the blocking read.

Fix: use rustix::event::poll() with 200ms timeout on stdin fd. On
timeout, check terminal size and redraw if changed. On data available,
read events as before.

Added rustix 'stdio' feature for rustix::stdio::stdin() BorrowedFd.
2026-06-19 21:03:58 +03:00
vasilito 48d2b41924 Add subshell.rs tests (9 tests for ShellManager, shell_path, run_command)
Covers: ShellManager::new() empty state, shell_path() env var
resolution and fallback, run_command success/failure/nonzero-exit/
filesystem-write/multiline, pty_login_helper_path resolution.
1031 tests total (was 1022).
2026-06-19 20:38:33 +03:00
vasilito 3d4fe13001 Split editor module: mod.rs 2646→434 non-test lines
Extract impl Editor blocks into submodules following the filemanager
split pattern:
- handlers.rs (551 lines): all key handling methods
- render.rs (571 lines): render method + rendering helpers
- bracket.rs (84 lines): bracket matching free functions

mod.rs retains: struct definition, basic impl, open_file, all tests.
Pure code-move refactoring — no logic changes.
1022 tests pass, 0 new warnings.
2026-06-19 20:35:47 +03:00
vasilito 477b7efc33 Wire 4 orphaned dialogs: chattr (C-x e), filter (Alt-f), encoding (Alt-e), connection (Alt-n)
4 dialog modules existed with full implementations and tests but were
completely unreachable — no Cmd variants, no DialogState variants, no
dispatch arms, no keymap bindings. This commit wires them in:

- ChattrDialog: C-x e — file attribute viewer for cursor file
- FilterDialog: Alt-f — persistent panel glob filter
- EncodingDialog: Alt-e — display encoding selector
- ConnectionDialog: Alt-n — network connection (FTP/SFTP/Shell)

All 4 now have: Cmd variants, DialogState variants, dispatch arms,
handle_dialog_key arms, render routing, apply_finished_dialog no-ops.
1022 tests pass, 0 new warnings.
2026-06-19 20:10:26 +03:00
vasilito 272f098884 tlc: cleanup — remove dead code, debug logging, fix import placement
- Remove two dead pub fn render free functions (render.rs + mod.rs)
- Remove debug_raw_event/should_log_raw_event (always-on /tmp logging)
- Move use std::sync::Arc to top of dispatch.rs
- Fix unused imports from dead code removal
2026-06-19 19:57:36 +03:00
vasilito 4edc3ddd5b tlc: revert to blocking-read event loop — fix terminal resize on Redox
The poll-based event loop (rustix::event::poll with 200ms timeout) broke
terminal size detection on Redox. When tui.size() returned (0,0) via
unwrap_or_default() after a failed dup(1,"winsize"), the size-change
check would clear the screen and render nothing.

Ratatui's draw() already calls autoresize() on every frame, which queries
backend.size() and resizes buffers automatically. The manual size check
and poll-based wake-up were redundant and harmful.

Reverted to the original blocking-read approach that worked on Redox:
  stdin.lock().events_and_raw().next()  →  process key  →  render()
Resize is detected on the next keypress via ratatui's built-in autoresize.
2026-06-19 19:06:02 +03:00
vasilito 612732dc39 tlc: clean up unused imports from module split + resize fix
- dispatch.rs: remove 8 unused module imports, 4 unused dialog type imports
- mod.rs: remove unused LinkKind import
- app.rs: remove unused AsFd import and stdin_fd variable
- Clippy back to 2 pre-existing warnings only (mc_ext + compare)
2026-06-19 18:06:31 +03:00
vasilito ac12f9e398 tlc: fix terminal resize detection with poll-based event loop
MC uses SIGWINCH→self-pipe→select(stdin+pipe) for resize detection.
In safe Rust (#![deny(unsafe_code)]), the equivalent is polling stdin
with a 200ms timeout via rustix::event::poll. This wakes the main loop
every 200ms even without key input, allowing terminal size check and
full redraw on resize. Same result as MC's signal-driven approach
without requiring unsafe signal handlers.

Previously the event loop blocked indefinitely on events.next() —
terminal resize was only detected on the next keypress.
2026-06-19 17:49:56 +03:00
vasilito 940e5f55c5 tlc: split filemanager/mod.rs into submodules + comment out mc in configs
- Split filemanager/mod.rs into dispatch.rs, render.rs, dialog_ops.rs,
  format_utils.rs (3567→~1200 lines in mod.rs)
- Comment out mc in redbear-mini.toml and redbear-full.toml per user request
- Enable tlc in redbear-full.toml (was temporarily disabled)
- 1022 tests pass, zero behavior changes
2026-06-19 17:30:28 +03:00
vasilito 035304f15b tlc: implement actual TUI event loops for tlcedit and tlcview
Both open_file() functions were stubs that opened the file but never
launched the terminal interface. tlcedit/tlcview would silently exit
without displaying anything.

- editor::open_file(): create Tui, render editor, run key event loop,
  handle Save/Close/SaveThenClose/DiscardThenClose results
- viewer::open_file(): create Tui, render viewer, run key event loop,
  exit when handle_key returns true
2026-06-19 13:00:22 +03:00