Commit Graph

1264 Commits

Author SHA1 Message Date
vasilito ffc4b3cc6e W62: Hex buttonbar + NroffMode F9 (MC CK_NroffMode)
Two MC viewer parity gaps closed:

Buttonbar: now shows different labels in Hex mode (F2=Edit,
F4=Ascii, F6=Save, F7=HxSrch, F8=Raw) matching MC's hex display.

NroffMode: F9 now toggles nroff_enabled (MC CK_NroffMode).
Previously F9 opened the menubar; the menubar moves to Shift-F9.
The buttonbar label for F9 shows 'Nroff'.

Text mode buttonbar also shows 'Nroff' for F9 instead of blank.

Tests: 1421 pass, zero warnings.
2026-07-07 15:05:30 +03:00
vasilito 5fe49527be W61: Viewer mouse support (scroll wheel + click zones)
MC has full mouse support in the viewer (MSG_MOUSE_SCROLL_UP/DOWN,
MSG_MOUSE_DOWN click zones). Add equivalent support to TLC:

- Viewer::handle_mouse(): scroll wheel up/down moves 2 lines;
  click top 5 rows → scroll up half page; click bottom 5 rows
  → scroll down half page.
- FileManager::handle_viewer_mouse(): forwards mouse events
  to the active viewer.
- app.rs routes TermEvent::Mouse to both the viewer (if open)
  and the file manager.

Tests: 1421 pass, zero warnings.
2026-07-07 14:55:38 +03:00
vasilito fc0a011591 base: bump submodule to c89af69d (P6-C isochronous transfer support) 2026-07-07 14:55:16 +03:00
Sisyphus Agent bec5262019 redbear-power: show load average in header
Add a "Load: 0.42 0.55 0.61" line to render_header, color-coded by load versus core count (green <= 50% capacity, yellow <= 100%, red overcommitted). Bump HEADER_LINES from 7 to 8. Build, 224 tests, clippy, and fmt clean.
2026-07-07 14:54:41 +03:00
vasilito eb7b88548b base: bump submodule to 0d8f3aad (P4 slice 2 — xHCI stream_id + UAS streams) 2026-07-07 14:47:13 +03:00
vasilito 11a7abcc8d W60: Goto dialog parity — percent/offset/hex options
MC's goto dialog supports Line/Percent/Decimal offset/Hex offset
modes. TLC's goto prompt previously only accepted line numbers.

Parse the goto prompt input for multi-format support:
- '50%' → goto 50% of the file (goto_percent)
- '0x400' → goto byte offset 1024 (goto_offset, hex)
- Number > line_count → treat as byte offset (goto_offset)
- Number ≤ line_count → treat as line number (goto_line)

Also updated the prompt label to 'Goto (line/50%/0x):' so the
new formats are discoverable.

Added 1 unit test verifying 50% goto lands near line 50 in a
100-line file.

Tests: 1421 pass (was 1420), zero warnings.
2026-07-07 14:47:03 +03:00
vasilito a99fb17568 W59: Hex ToggleNavigation (Tab in hex mode, MC CK_ToggleNavigation)
MC's Tab in hex mode toggles the cursor between the hex data area
and the ASCII text column (hexview_in_text). Add this feature:

- Viewer::hexview_in_text: bool field (default false)
- Tab key in Hex/HexEdit mode toggles the flag
- ViewerCmd::ToggleHexNavigation + View menu entry in F9
- execute_menubar_cmd dispatches the toggle

The hex render uses hexview_in_text to determine which column
gets the cursor highlight (hex bytes vs ASCII representation).

Tests: 1420 pass, zero warnings.
2026-07-07 14:41:11 +03:00
Sisyphus Agent 5266c3d0ce redbear-power: wire keybinding config into key dispatch
Add KeyBindings::char_for() and replace the 7 hardcoded Key::Char arms in main.rs (quit, cycle_governor, refresh_now, toggle_help, snapshot, benchmark_start, benchmark_stop). Esc remains a quit fallback. All other keys stay hardcoded. Build, 224 tests, clippy, and fmt clean.
2026-07-07 14:05:55 +03:00
vasilito c7ed62eb30 USB: P6-B real CDC ECM driver replacing 32-line stub
Cross-referenced with Linux 7.1 drivers/net/usb/cdc_ether.c (984 lines)
and include/uapi/linux/usb/cdc.h.

Replaces the 32-line scan-and-symlink stub with a 230-line real class driver:

Protocol (cdc.h:237-303):
- SET_ETHERNET_PACKET_FILTER (0x43) — promiscuous + directed + broadcast
  + multicast filter matching Linux default (cdc_ether.c:70-80)
- SET_ETHERNET_MULTICAST_FILTERS (0x40) — constants defined
- SEND_ENCAPSULATED_COMMAND (0x00), GET_ENCAPSULATED_RESPONSE (0x01)

Architecture:
- Finds CDC ECM communications interface (class=02, subclass=06)
- Data interface = ctrl_iface + 1 (Union descriptor pairing assumption)
- Bulk IN + bulk OUT endpoints from data interface
- Optional interrupt endpoint from control interface for CDC notifications
- Bidirectional I/O: bulk IN → stdout (Rx), stdin → bulk OUT (Tx)
- CDC notification handler: NETWORK_CONNECTION (link up/down),
  SPEED_CHANGE (tx/rx bitrates), generic notification logging

Pattern matches redbear-acmd and redbear-ftdi: XhciClientHandle,
path deps on local forks, common::setup_logging, cargo template.
2026-07-07 14:05:08 +03:00
vasilito ebf6e0cca4 W58: Fix F2 to toggle wrap in text mode (MC CK_WrapMode)
MC's F2 in text mode toggles word wrap (CK_WrapMode). TLC was
using F2 for growing buffer toggle instead. This changes F2 to
toggle wrap in text mode, matching MC. Growing buffer moves to
Shift-F2.

- F2 in Text mode: toggle self.wrap
- F2 in Hex/HexEdit mode: enter/exit hex edit (unchanged)
- Shift-F2 in any mode: toggle growing buffer
- Updated growing_keybinding_toggles_mode test to use Shift-F2
- Added f2_toggles_wrap_in_text_mode test

Tests: 1420 pass (was 1419), zero warnings.
2026-07-07 14:01:05 +03:00
vasilito 3fd40a6ade base: bump submodule to 69a8e406 (P1-A xhcid UsbHostController trait adapter) 2026-07-07 13:58:24 +03:00
vasilito 9a0b2c5f4a W57: Viewer ruler toggle (MC CK_Ruler / Alt-R)
Add column ruler toggle to the viewer. Press Alt-R or use the
View F9 menu to toggle a ruler row showing column positions.

- Viewer::ruler: bool field (default false)
- Alt-R key binding toggles the ruler
- ViewerCmd::ToggleRuler + View menu entry in the menubar
- execute_menubar_cmd dispatches the toggle

Added 1 unit test verifying the toggle cycle (off→on→off).

Tests: 1419 pass (was 1418), zero warnings.
2026-07-07 13:55:17 +03:00
Sisyphus Agent b331285661 redbear-power: theme system refactor
Move all palette colors into Theme fields so dark/light/high-contrast/nord/gruvbox/solarized-dark are fully usable. Convert NiceEdit and AffinityEditor to regular render_dialog methods that take a theme. Update all render_* helpers to bind let theme = &app.theme and reference theme fields. All 224 tests pass; clippy and fmt clean.
2026-07-07 13:42:46 +03:00
vasilito 2728c2e408 base: bump submodule to 71971d12 (P1-C xhcid hot-path panic reduction) 2026-07-07 13:39:12 +03:00
vasilito 04e49cfe38 W56: Viewer bookmarks, half-page scroll, SearchOppositeContinue
Systematic MC viewer parity from the comprehensive audit (CK_* gaps):

Bookmarks (MC CK_BookmarkGoto / CK_Bookmark):
- marks: [Option<u64>; 10] stores 10 position bookmarks
- marker: usize tracks which slot was last written
- m key: sets current top position in marks[marker], advances marker
- r key: jumps to marks[marker-1] (wraps from 0→9)

Half-page scroll (MC CK_HalfPageDown / CK_HalfPageUp):
- d key: move_cursor_down(last_height / 2)
- u key: move_cursor_up(last_height / 2)

SearchOppositeContinue (MC CK_SearchOppositeContinue):
- last_search_forward: bool tracks last direction
- Shift-N: if last was forward→search_prev, else→search_next
- search_next/search_prev update the flag

Added 2 unit tests: bookmarks set+jump, half-page scroll.

Tests: 1418 pass (was 1416), zero warnings.
2026-07-07 13:31:56 +03:00
vasilito 74ea610745 W55: Shift-F3 raw viewer (MC parity)
MC's Shift-F3 opens the viewer in raw mode without magic/binary
detection. Add Cmd::ViewRaw variant bound to Shift-F3, dispatch
handler, and open_viewer_raw_for_cursor() method that opens the
viewer with magic_mode=false.

This is the standard MC behaviour for viewing binary files as
raw text when magic detection incorrectly identifies them.

Tests: 1416 pass, zero warnings.
2026-07-07 13:11:30 +03:00
vasilito e28d575668 USB: add redbear-ftdi — FTDI FT232 USB-serial driver
Cross-referenced with Linux 7.1 drivers/usb/serial/ftdi_sio.c (2,876 lines).

Implements the core FTDI protocol:
- Reset (SIO_RESET_SIO + purge RX/TX buffers)
- Baud rate setting (48MHz base clock, 16-bit divisor encoding)
- Flow control (RTS/CTS, DTR/DSR)
- Modem control (DTR/RTS line state)
- Bidirectional bulk I/O: bulk IN → stdout, stdin → bulk OUT (spawned thread)

Recipe pattern matches redbear-acmd: path dep on local forks, XhciClientHandle interface,
common::setup_logging, cargo template.

Wired into redbear-mini.toml (inherited by redbear-full) with probe marker service.
2026-07-07 13:06:20 +03:00
vasilito eb5b428fa4 W54: ToggleOverwrite editor F9 command (MC CK_InsertOverwrite)
Add ToggleOverwrite EditorCmd variant, wire it into the Options
menu, and add a dispatch handler that toggles the overwrite
flag and shows [OVR]/[INS] in the status message (mirrors the
existing INS key behavior now accessible from the F9 menu).

Added 1 unit test verifying [OVR]→[INS] cycle.

Tests: 1416 pass (was 1415), zero warnings.
2026-07-07 13:05:28 +03:00
vasilito 7a9e3f3466 W53: Advanced chown — recursive checkbox in Owner dialog
Extend the Owner dialog (C-x o) with a Recursive checkbox,
matching MC's CK_ChangeOwnAdvanced. Tab cycles through UID→GID
→Recursive. Enter on the Recursive field toggles the checkbox;
Enter on UID/GID confirms (as before).

- OwnerField::Recursive variant with next/prev cycling
- OwnerDialog::recursive field (default false)
- handle_key: Enter toggles checkbox when focused on Recursive
- render: shows [✔]/[☐] Recursive with focus highlight
- Updated field_cycle_helper test for the 3-field cycle

Tests: 1415 pass, zero warnings.
2026-07-07 12:58:28 +03:00
vasilito 905a4f70f8 base fork: P7-C slice 1 — port suspend/resume 2026-07-07 12:52:56 +03:00
vasilito 69dff0c26c W52: Tests for editor MarkAll, Close, BlockSave, InsertFile
Add 4 unit tests covering the new W50 editor commands:

- mark_all_selects_entire_buffer: verify selection covers
  the full buffer (start=0, end=buffer.len())
- close_clean_buffer_reopens_empty: verify Close on an
  unmodified buffer resets to an empty buffer
- block_save_on_no_selection_shows_message: verify the
  "No selection" message when nothing is selected
- insert_file_opens_insert_file_prompt: verify the mode
  switches to InsertFile prompt

Tests: 1415 pass (was 1411), zero warnings.
2026-07-07 12:50:00 +03:00
vasilito 85a82f56d4 base fork: P7-B slice 1 — USB 3.0 link states 2026-07-07 12:49:06 +03:00
vasilito bbcd44833d W51: Appearance dialog (MC CK_OptionsAppearance)
The F9 audit found TLC had no Appearance dialog — the Skins...
dialog was the only appearance option. MC's CK_OptionsAppearance
offers five checkbox toggles plus a skin selector.

Create AppearanceDialog with 6 rows:
- Menubar (show/hide F9 menu bar)
- Keybar (show/hide F1-F10 key hint bar)
- Hint bar (show/hide status bar)
- Command prompt (show/hide command-line prompt)
- Mini status (show/hide mini-status above keybar)
- Skins... (opens the existing SkinDialog)

All five toggles write back to RuntimeConfig's show_* fields.
Enter toggles the checkbox; Esc dismisses; Skins... opens the
skin selection dialog transparently.

Added to F9 → Options menu as 'Appearance...' between
Confirmation and Skins, matching MC's menu ordering.

Added 4 unit tests: toggles default true, enter toggles off/on,
down cycles cursor, skin button opens skin outcome.

Tests: 1411 pass (was 1407), zero warnings.
2026-07-07 12:45:28 +03:00
vasilito 42feab633e base fork: P7-A slice 1 — USB 2.0 LPM detection 2026-07-07 12:40:16 +03:00
vasilito f0341aa53d W50: Editor MarkAll, InsertFile, BlockSave, Close commands
MC parity gap: the editor F9 menu was missing 4 commands that
MC has. This adds them all:

- MarkAll (CK_MarkAll): select all text via start_selection +
  set_position(0) + set_position(len)
- InsertFile (CK_InsertFile): open SaveAs-style prompt to pick
  a file to insert at the cursor (reuses PromptKind::InsertFile)
- BlockSave (CK_BlockSave): open SaveAs prompt pre-filled with
  the selected text, saves selection to a different file
- Close (CK_Close): close current buffer (prompt save if dirty)

All 4 added to the F9 File and Edit menus. Test updated for
new file menu item count (7→11).

Tests: 1407 pass, zero warnings.
2026-07-07 12:32:24 +03:00
vasilito 19829958db redbear-acmd: P6 — real CDC ACM serial class driver
Replace the 32-line symlink scanner with a real CDC ACM driver
cross-referenced with Linux 7.1 drivers/usb/class/cdc-acm.c.

  Per-device design: the daemon connects to the xhci scheme, finds
  the CDC ACM data interface (class 0x0A), configures bulk IN/OUT
  endpoints, and handles CDC control requests.

  AcmDevice struct:
    - XhciClientHandle for scheme access
    - bulk IN / bulk OUT via XhciEndpHandle
    - LineCoding state (baud rate, parity, stop bits, data bits)

  CDC control requests (per usb/cdc.h):
    - SET_LINE_CODING (0x20): baud rate, parity, data/stop bits
    - GET_LINE_CODING (0x21): read current line coding
    - SET_CONTROL_LINE_STATE (0x22): DTR/RTS flow control

  Interface detection:
    - Matches control interface (class 0x02, sub 0x02)
    - Matches data interface (class 0x0A)
    - Configures both interfaces via ConfigureEndpointsReq

  Main I/O loop:
    - Polls bulk IN every 10ms
    - Writes received data to stdout (Arduino serial monitor)

  Cargo.toml updated with xhcid, common, and libredox deps.

Cross-reference: Linux 7.1
  - drivers/usb/class/cdc-acm.c (2,186 lines)
  - include/uapi/linux/usb/cdc.h: CDC control request defines
2026-07-07 12:31:24 +03:00
vasilito d9ff6b7788 base fork: P5 slice 3 — gamepad support 2026-07-07 12:21:44 +03:00
vasilito fec44e9117 base fork: P5 slice 2 — keyboard LED sync 2026-07-07 12:16:07 +03:00
vasilito bc4df8e437 base fork: P5 slice 1 — consumer key support 2026-07-07 12:11:13 +03:00
vasilito 128832c568 base fork: P4 slice 1 — UAS transport 2026-07-07 12:05:41 +03:00
vasilito cc770de03e base fork: P3 slice 2 — interrupt-driven hub change detection 2026-07-07 12:00:52 +03:00
vasilito 7dad32bdc1 base fork: P3 — usbhubd power-on timing + USB 3 fix 2026-07-07 11:51:12 +03:00
vasilito 9a0e0d86c7 base fork: P2-C slice 3 — actual TT-buffer clear 2026-07-07 11:45:39 +03:00
vasilito 8119824512 base fork: P2-C slice 2 — TT metadata + non-recursive stall clear 2026-07-07 11:11:27 +03:00
vasilito a0b8ba1014 base fork: P2-C first active xHCI recovery slice 2026-07-07 10:57:55 +03:00
vasilito 4dc60bdc5d redbear-power: add TIME+ cumulative CPU-time column 2026-07-07 10:39:43 +03:00
vasilito 346daee089 base fork: complete P1-B and start P2-C status mapping 2026-07-07 10:32:33 +03:00
vasilito 42c807c55a redbear-power: implement --json export mode 2026-07-07 10:13:12 +03:00
vasilito 682560cf7a base fork: P2-B — full HCC2/HCS3 bit map 2026-07-07 10:09:10 +03:00
vasilito ef3f696689 W49: Search field auto-suggest from history
When opening a Find or Replace prompt, prefill the input with
the most recent search pattern from the history. The user can
still type freely to override or press Backspace to clear it.
Only applies to Find / Replace prompts (not GotoLine, etc.).

Updated the existing alt_slash test to account for the
auto-suggested prefix (it now presses Backspace 5 times to
clear 'hello' before typing 'world').

Tests: 1407 pass, zero warnings.
2026-07-07 10:05:43 +03:00
vasilito fe53efcd83 base fork: P2-A — xhcid 51-quirk table 2026-07-07 09:20:04 +03:00
vasilito 7d341b6254 W47: Verify dot-prefix completion resolves against base dir
The existing W39 Tab completion already handles relative paths
(./ and ../) by joining with the active panel's base_dir. This
adds an explicit test confirming that typing './inn' in the
cmdline with base_dir set completes to './inner' (not CWD-relative).

Tests: 1407 pass (was 1406), zero warnings.
2026-07-07 09:16:14 +03:00
vasilito 9e08f7ed05 redbear-power: PID jump, process filter matches PID, narrow process view
- Press F, type a number, Enter: jump cursor directly to that PID in the visible list.
- Press F, type text: filters by process name (existing) and now PID substring too.
- Press h in Process tab: toggle narrow view (PID/STATE/CPU%/MEM/COMM) for small terminals.
- Add process_narrow to App and SessionState; persist across sessions.
- Update help text and status messages to document the new keybindings.
- Fix unused super::* warning in process filter unit tests.
2026-07-07 08:54:59 +03:00
vasilito affb6690c5 W46: Animated cursor movement trail
When the user moves the cursor (up/down/home/end), the previous
cursor position briefly shows a thin accent-coloured bar (▏)
to the left of the row. Creates a subtle trail effect that makes
the new cursor position more obvious.

- Panel::prev_cursor: usize field set on every move
- Panel::cursor_flash: Option<Instant> tracks the flash
- Panel::cursor_flash_progress() returns Some(frac) for ~200ms
  after each move
- cursor_up / cursor_down / cursor_home / cursor_end set the
  previous position and trigger the flash
- Render path draws the bar at the previous row in accent colour

Added 1 unit test verifying prev_cursor and cursor_flash on move.

Tests: 1406 pass (was 1405), zero warnings.
2026-07-07 08:54:36 +03:00
vasilito ba05902883 W45: Marked-file total size in panel footer
Append a 'Σ <size>' indicator to the panel footer when files
are marked, using the info colour. Sums the stat.size of every
entry whose name is in the marked set (directories included).
Helps users see the combined size before bulk operations like
copy/move/delete.

Tests: 1405 pass, zero warnings.
2026-07-07 08:11:36 +03:00
vasilito 78ff5b5c4c W44: Filename fuzzy filter highlight in panel
When a filter is active, the matching prefix of each file name
is highlighted in the panel list. The renderer splits each
entry into two spans: the matching prefix and the rest, so the
user can immediately see why each entry matched the filter.

- Panel::filter_match_len(name) returns the length of the
  matching filter prefix for a name (0 when no match)
- Panel::name_matches_filter(name) convenience boolean
- Render path uses a Line with two Spans when match_len > 0

Added 1 unit test verifying filter_match_len returns the
correct prefix length for matching and non-matching names.

Tests: 1405 pass (was 1403), zero warnings.
2026-07-07 08:01:41 +03:00
vasilito e9b82a3a04 base fork: P1-C partial — 37 xhcid unwraps removed 2026-07-07 07:59:31 +03:00
vasilito faf688a2d7 base fork: P1-B — usbscsid zero panics 2026-07-07 07:45:26 +03:00
vasilito 75c3a472df W41: Test for panel focus border flash
The panel_switch_anim system already flashes the active panel
border from theme.info to theme.accent on focus change
(switch_focus). Add an explicit test that verifies the
animation reset-on-switch and the tick-by-tick advance back
to 100, guarding against future refactors breaking the
visual feedback for Tab panel switching.

Tests: 1403 pass (was 1402), zero warnings.
2026-07-07 07:36:16 +03:00
vasilito 8de0308b6e W42: Add test for Enter-to-navigate handle_key path
The panel's enter() method already navigates into directories.
The handle_key() wrapper calls enter() on Key::ENTER, and the
main dispatch's _ => arm calls handle_key. Add an explicit test
that exercises the full handle_key(ENTER) path to guard
against future refactors breaking the navigation wiring.

Tests: 1403 pass (was 1402), zero warnings.
2026-07-07 07:22:03 +03:00