diff --git a/local/recipes/tui/tlc/PLAN.md b/local/recipes/tui/tlc/PLAN.md index 0486169973..dbd87599aa 100644 --- a/local/recipes/tui/tlc/PLAN.md +++ b/local/recipes/tui/tlc/PLAN.md @@ -2,8 +2,10 @@ **Status:** Architecture chosen. Implementation in progress. Phases 0–8 substantially complete. Phases 14a, 14b, 15a, 15b (partial), 15c (partial), 15d, 14e, 16–29 substantially complete. -**Last updated:** 2026-06-21 — Phase 27/28/29 sync + §17 dialog consistency assessment (44/46 dialogs unified, 4-item P1-P4 refactor backlog). -**Date:** 2026-06-12 (initial) · 2026-06-13 (rename + comprehensive review + audit fixes) · 2026-06-19 (bug fixes, standalone binaries, syntax highlighter, parity audit reconciliation) · 2026-06-20 (Phase 16, Phase 17, Phase 18, Phase 19, Phase 20, Phase 21, Phase 22, Phase 23, Phase 24, Phase 25, Phase 26) · 2026-06-21 (Phase 27, Phase 28, Phase 29, §17 dialog audit) +Dialog unification: §17.4 P1-P4 done (commit `6c30edaf3e`); 4/47 raw `Clear` sites remaining +(all defensible). P5-P7 deferred. +**Last updated:** 2026-06-21 — §17.8 P1-P4 dialog unification complete (commit `6c30edaf3e`, 4 dialogs migrated, raw `Clear` count down to 4 defensible sites). +**Date:** 2026-06-12 (initial) · 2026-06-13 (rename + comprehensive review + audit fixes) · 2026-06-19 (bug fixes, standalone binaries, syntax highlighter, parity audit reconciliation) · 2026-06-20 (Phase 16, Phase 17, Phase 18, Phase 19, Phase 20, Phase 21, Phase 22, Phase 23, Phase 24, Phase 25, Phase 26) · 2026-06-21 (Phase 27, Phase 28, Phase 29, §17 dialog audit + §17.8 P1-P4 completion) **Branch:** `0.2.4` **Decision authority:** User selected Option A (Pure Rust TLC) on 2026-06-12. **Scope:** Reimplement ALL of Midnight Commander (MC 4.8.33) in pure Rust. @@ -1571,6 +1573,37 @@ are intentional non-chrome. The §17.4 backlog is the final 7% of dialog unifica the four priority items (P1-P4) are each small (5-40 LOC) and can be done in a single sitting. +### 17.8 P1-P4 unification complete (2026-06-21) + +All four priority items from §17.4 executed in commit `6c30edaf3e`: + +- **P1** `widget/dialog.rs::Dialog::render` now delegates shell to `render_popup`. The only + shadow regression in the unified stack is closed. Test: + `render_draws_drop_shadow_at_bottom_right_corner` asserts the shadow bg is painted. +- **P2** `filemanager/overwrite_dialog.rs` Y/N/All/Skip/Abort legend replaced with + `render_button_row` (Yes=Default, others=Normal). Test: + `render_uses_mc_bracket_button_shapes` asserts the MC bracket shapes. +- **P3** `filemanager/confirm_dialog.rs` Save/Cancel replaced with `render_button_row` + (Save=Default, Cancel=Normal). Test asserts the MC bracket shapes. +- **P4** `editor/menubar.rs:520` F9 dropdown migrated to `render_popup`, matching + `filemanager/menubar.rs` (which was migrated in `c032c9a787`). + +**Acceptance criterion (§17.6)**: `grep "frame.render_widget(Clear" src/` now returns +exactly 4 sites, all defensible: +1. `terminal/popup.rs:125` — the renderer itself +2. `filemanager/tree.rs:304` — full-screen, intentional +3. `filemanager/menubar.rs:260` — F9 top bar (intentional full-width) +4. `editor/menubar.rs:427` — F9 top bar (intentional full-width) + +`widget/dialog.rs` no longer appears in the list. Zero shadow regressions remain. + +Tests: 1184 passing, 0 failing (was 1180; +4 from P1-P4). Both release builds clean +(default + `--features sftp`). + +P5 (SaveBeforeClose Y/N/Esc legend), P6 (viewer/editor SaveBeforeClose unification), +and P7 (~15 decorative key-legend hints) are NOT migrated in this commit — see +§17.4 for rationale and deferral reasoning. + --- ## Changelog @@ -1660,8 +1693,8 @@ sitting. - **2026-06-21** — **Test count**: 1180 tests, 0 failures. - **2026-06-21** — **Binary sizes**: `tlc` 5.4 MB, `tlcedit` 3.9 MB, `tlcview` 3.8 MB. -- **2026-06-21** — **Dialog consistency assessment (PLAN §17)**: Comprehensive audit of - every dialog in tlc. Confirms Phase 16-18 brought **44/46 dialog surfaces onto the +- **2026-06-21** — **Dialog consistency assessment (PLAN §17)**: Comprehensive audit of every + dialog in tlc. Confirms Phase 16-18 brought **44/46 dialog surfaces onto the unified `render_popup` path** (33 in `filemanager/`, 5 in `editor/render.rs`, 1 in `ops/progress.rs`; the 45th `widget/dialog.rs::Dialog::render` uses raw `Clear`+`Block` and is the only shadow regression in the unified stack — see §17.4 P1). The two @@ -1673,3 +1706,15 @@ sitting. P2 overwrite_dialog Y/N/A/S/Esc migration, P3 confirm_dialog Save/Cancel migration, P4 editor menubar dropdown migration, P5 editor SaveBeforeClose legend, P6 viewer/editor SaveBeforeClose unification, P7 optional decorative hint strips. + +- **2026-06-21** — **PLAN §17.8 — P1-P4 dialog unification complete (commit `6c30edaf3e`)**: + All four priority items from §17.4 executed. P1 widget/dialog.rs now delegates shell to + render_popup (closes only shadow regression in the unified stack). P2 overwrite_dialog + Y/N/All/Skip/Abort legend migrated to render_button_row (Yes=Default, others=Normal). + P3 confirm_dialog Save/Cancel migrated to render_button_row (Save=Default, Cancel=Normal). + P4 editor/menubar.rs F9 dropdown migrated to render_popup, matching the + already-migrated filemanager/menubar.rs dropdown. Acceptance criterion from §17.6 met: + grep for raw Clear now returns exactly 4 defensible sites (popup renderer itself, + full-screen tree, two intentional full-width menu-bar top rows). widget/dialog.rs no + longer appears. 1184 tests passing (+4 from P1-P4). PLAN §17.8 added with full + per-P commit refs and acceptance-criterion audit. diff --git a/local/recipes/tui/tlc/dist/.gitignore b/local/recipes/tui/tlc/dist/.gitignore new file mode 100644 index 0000000000..1a76b545e4 --- /dev/null +++ b/local/recipes/tui/tlc/dist/.gitignore @@ -0,0 +1,7 @@ +# Built artifacts — keep source but not the binaries +*.tar.gz +*.deb +tlc-1.0.0/bin/ +tlc-1.0.0/locales/*.yml +tlc-1.0.0/config/default.toml +tlc-1.0.0/mc-skins/ diff --git a/local/recipes/tui/tlc/dist/PKGBUILD b/local/recipes/tui/tlc/dist/PKGBUILD new file mode 100644 index 0000000000..8f62abb840 --- /dev/null +++ b/local/recipes/tui/tlc/dist/PKGBUILD @@ -0,0 +1,32 @@ +# Maintainer: Red Bear OS +pkgname=tlc +pkgver=1.0.0 +pkgrel=1 +pkgdesc="Twilight Commander — pure-Rust TUI file manager" +arch=('x86_64') +url="https://gitea.redbearos.org/vasilito/redbear-os.git" +license=('MIT') +depends=() +makedepends=() +source=("https://gitea.redbearos.org/vasilito/redbear-os/releases/download/${pkgver}/tlc-${pkgver}-linux-x86_64.tar.gz") +sha256sums=('SKIP') + +package() { + cd "${srcdir}/tlc-${pkgver}" + + install -Dm755 bin/tlc "${pkgdir}/usr/bin/tlc" + install -Dm755 bin/tlcedit "${pkgdir}/usr/bin/tlcedit" + install -Dm755 bin/tlcview "${pkgdir}/usr/bin/tlcview" + + install -Dm644 man/tlc.1 "${pkgdir}/usr/share/man/man1/tlc.1" + install -Dm644 man/tlcedit.1 "${pkgdir}/usr/share/man/man1/tlcedit.1" + install -Dm644 man/tlcview.1 "${pkgdir}/usr/share/man/man1/tlcview.1" + + install -Dm644 config/default.toml \ + "${pkgdir}/etc/xdg/tlc/default.toml" + install -dm755 "${pkgdir}/usr/share/tlc/locales" + install -m644 locales/*.yml \ + -t "${pkgdir}/usr/share/tlc/locales/" + install -dm755 "${pkgdir}/usr/share/tlc/mc-skins" + cp -r mc-skins/* "${pkgdir}/usr/share/tlc/mc-skins/" +} diff --git a/local/recipes/tui/tlc/dist/build_deb.sh b/local/recipes/tui/tlc/dist/build_deb.sh new file mode 100755 index 0000000000..d3c639157c --- /dev/null +++ b/local/recipes/tui/tlc/dist/build_deb.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +# Build the .deb package from dist/tlc-1.0.0/ contents. +# Run from the dist/ directory after unpacking the tarball. +set -euo pipefail + +dist_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" +stage="$(mktemp -d)" +trap 'rm -rf "$stage"' EXIT + +src_dir="${dist_dir}/tlc-1.0.0" +pkg_root="${stage}/tlc_1.0.0-1_amd64" + +mkdir -p "${pkg_root}/usr/bin" \ + "${pkg_root}/usr/share/man/man1" \ + "${pkg_root}/etc/xdg/tlc" \ + "${pkg_root}/usr/share/tlc/locales" \ + "${pkg_root}/usr/share/tlc/mc-skins" + +cp "${src_dir}/bin/tlc" "${pkg_root}/usr/bin/tlc" +cp "${src_dir}/bin/tlcedit" "${pkg_root}/usr/bin/tlcedit" +cp "${src_dir}/bin/tlcview" "${pkg_root}/usr/bin/tlcview" +chmod 0755 "${pkg_root}/usr/bin/tlc" "${pkg_root}/usr/bin/tlcedit" "${pkg_root}/usr/bin/tlcview" + +cp "${src_dir}/man/tlc.1" "${pkg_root}/usr/share/man/man1/tlc.1" +cp "${src_dir}/man/tlcedit.1" "${pkg_root}/usr/share/man/man1/tlcedit.1" +cp "${src_dir}/man/tlcview.1" "${pkg_root}/usr/share/man/man1/tlcview.1" + +cp "${src_dir}/config/default.toml" "${pkg_root}/etc/xdg/tlc/default.toml" +cp "${src_dir}/locales/"*.yml "${pkg_root}/usr/share/tlc/locales/" +cp -r "${src_dir}/mc-skins/"* "${pkg_root}/usr/share/tlc/mc-skins/" + +# Compress man pages. +gzip -9 "${pkg_root}/usr/share/man/man1/"*.1 + +# Copy control files. +mkdir -p "${pkg_root}/DEBIAN" +cp "${dist_dir}/deb/DEBIAN/control" "${pkg_root}/DEBIAN/control" + +# Compute Installed-Size (in KB). +size=$(du -sk "${pkg_root}" | awk '{print $1}') +sed -i "s/^Installed-Size:.*/Installed-Size: ${size}/" "${pkg_root}/DEBIAN/control" +grep -q '^Installed-Size:' "${pkg_root}/DEBIAN/control" || \ + sed -i "/^Priority:/a Installed-Size: ${size}" "${pkg_root}/DEBIAN/control" + +# Build. +out="${dist_dir}/tlc_1.0.0-1_amd64.deb" +dpkg-deb --build --root-owner-group "${pkg_root}" "${out}" +echo "Built: ${out}" diff --git a/local/recipes/tui/tlc/dist/deb/DEBIAN/control b/local/recipes/tui/tlc/dist/deb/DEBIAN/control new file mode 100644 index 0000000000..a9d5582557 --- /dev/null +++ b/local/recipes/tui/tlc/dist/deb/DEBIAN/control @@ -0,0 +1,15 @@ +Package: tlc +Version: 1.0.0-1 +Section: utils +Priority: optional +Architecture: amd64 +Depends: libc6 +Maintainer: Red Bear OS +Description: Twilight Commander — pure-Rust TUI file manager + TLC is a Midnight Commander-inspired dual-panel terminal file manager + written in pure Rust. It supports local and remote (FTP/SFTP) filesystems, + archives, an internal editor, an internal viewer with hex-edit mode, and + eight bundled MC-derived skins. + . + Three binaries are installed: tlc (file manager), tlcedit (editor), + tlcview (viewer with hex-edit mode). diff --git a/local/recipes/tui/tlc/dist/tlc-1.0.0/INSTALL.sh b/local/recipes/tui/tlc/dist/tlc-1.0.0/INSTALL.sh new file mode 100755 index 0000000000..c692dd7ef4 --- /dev/null +++ b/local/recipes/tui/tlc/dist/tlc-1.0.0/INSTALL.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# TLC Linux install script — installs tlc / tlcedit / tlcview from this tarball. +# Run as root (or with sudo) to install system-wide; otherwise use --user. + +set -euo pipefail + +prefix="/usr/local" +bindir="${prefix}/bin" +mandir="${prefix}/share/man/man1" +datadir="${prefix}/share/tlc" +configdir="/etc/xdg/tlc" + +user_install=0 +if [[ "${1:-}" == "--user" ]]; then + prefix="${HOME}/.local" + bindir="${prefix}/bin" + mandir="${prefix}/share/man/man1" + datadir="${prefix}/share/tlc" + configdir="${prefix}/share/tlc" + user_install=1 +fi + +# Resolve the directory this script lives in. +script_dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)" + +mkdir -p "${bindir}" "${mandir}" "${datadir}" "${configdir}" + +install -m 0755 "${script_dir}/bin/tlc" "${bindir}/tlc" +install -m 0755 "${script_dir}/bin/tlcedit" "${bindir}/tlcedit" +install -m 0755 "${script_dir}/bin/tlcview" "${bindir}/tlcview" + +install -m 0644 "${script_dir}/man/tlc.1" "${mandir}/tlc.1" +install -m 0644 "${script_dir}/man/tlcedit.1" "${mandir}/tlcedit.1" +install -m 0644 "${script_dir}/man/tlcview.1" "${mandir}/tlcview.1" + +cp -r "${script_dir}/config/"* "${configdir}/" +cp -r "${script_dir}/locales/"* "${datadir}/locales/" +cp -r "${script_dir}/mc-skins/"* "${datadir}/mc-skins/" + +cat <>`, zero `unsafe` | +| 15g Ctrl-X chord + Compare Dirs + SymlinkRelative + dialogs | ✅ Ctrl-X prefix dispatch (9 follow-ups), Compare Dirs (C-x d size-only), SymlinkRelative (C-x s), SymlinkEdit (C-x v), ScreenList/EditHistory/FilteredView wired, editor format paragraph (Alt-P), viewer growing buffer (tail -f) | +| 15h File highlighting | ✅ Type-based coloring in panel entries (9 categories: executable, archive, audio, video, image, source, documentation, database), extension tables + permission-bit detection | +| 15i VFS archive panel integration | ✅ Browse .tar/.tar.gz/.tar.bz2/.tar.xz/.zip/.cpio archives in-place; Enter opens archive, '..' at root exits to local filesystem; VFS scheme dispatch via for_path() | +| 15j PanelInfo (C-x i) + PanelQuickView (C-x q) | ✅ Inactive panel toggles to Info mode (filesystem summary + cursor file metadata) or QuickView mode (first 30 lines of cursor file, binary detection); toggle-only (excluded from Alt-L listing cycle) | +| 15k Clippy cleanup | ✅ All 20 clippy lints fixed across 9 files; only 1 pre-existing warning remains (mc_ext.rs Include(String) never read) | +| 15l Split ratio + QuitQuiet + menubar + Compare files | ✅ SplitMore/Less (Alt-Shift-Right/Left, 5% steps, 10-90%), QuitQuiet (Shift-F10 actually quits), F9 menubar expanded with all 20+ commands, Compare files (Ctrl-d, LCS diff viewer) | + +See `PLAN.md` for the comprehensive quality assessment and remaining tasks. \ No newline at end of file diff --git a/local/recipes/tui/tlc/dist/tlc-1.0.0/man/tlc.1 b/local/recipes/tui/tlc/dist/tlc-1.0.0/man/tlc.1 new file mode 100644 index 0000000000..6e01e98dae --- /dev/null +++ b/local/recipes/tui/tlc/dist/tlc-1.0.0/man/tlc.1 @@ -0,0 +1,35 @@ +.TH TLC 1 "2026-06-21" "TLC 1.0.0" "Red Bear OS User Commands" +.SH NAME +tlc \- Twilight Commander, a pure-Rust terminal file manager +.SH SYNOPSIS +.B tlc +[\fIpath\fR] +.SH DESCRIPTION +TLC is a Midnight Commander-inspired dual-panel terminal file manager +written in pure Rust. It supports local and remote (FTP/SFTP) filesystems, +archives, an internal editor, an internal viewer with hex-edit mode, and +eight bundled MC-derived skins. +.SH OPTIONS +Currently tlc accepts an optional positional path argument to start +in a specific directory: +.IP +.B tlc /var/log +.PP +Run +.B tlc help +to print the full key binding reference. +.SH FILES +.TP +.I ~/.config/tlc/config.toml +Per-user configuration, persisted by Alt-S skin selection and panel setup. +.TP +.I ~/.config/tlc/skin/*.toml +User-defined skin files; loaded by the skin selector. +.TP +.I ~/.config/tlc/menu +User-menu definition (mc-style INI). Same syntax as MC's menu file. +.SH SEE ALSO +.BR tlcedit (1), +.BR tlcview (1) +.SH AUTHOR +Red Bear OS diff --git a/local/recipes/tui/tlc/dist/tlc-1.0.0/man/tlcedit.1 b/local/recipes/tui/tlc/dist/tlc-1.0.0/man/tlcedit.1 new file mode 100644 index 0000000000..5296bfa4b5 --- /dev/null +++ b/local/recipes/tui/tlc/dist/tlc-1.0.0/man/tlcedit.1 @@ -0,0 +1,27 @@ +.TH TLCEDIT 1 "2026-06-21" "TLC 1.0.0" "Red Bear OS User Commands" +.SH NAME +tlcedit \- TLC standalone text editor +.SH SYNOPSIS +.B tlcedit +[\fB+linenum\fR] \fIfile\fR +.SH DESCRIPTION +Standalone text editor companion to tlc. Pure Rust, MC-derived keybindings +(undo/redo, search/replace, block operations, syntax highlighting, +bookmarks, macros, user menu via F11). +.SH OPTIONS +.TP +.BR + N +Start the editor with the cursor at line +.IR N . +.TP +.I file +The file to edit. Created if it does not exist. +.SH KEY BINDINGS +See +.BR tlc (1) +help output (F1 inside the editor for the in-app reference). +.SH SEE ALSO +.BR tlc (1), +.BR tlcview (1) +.SH AUTHOR +Red Bear OS diff --git a/local/recipes/tui/tlc/dist/tlc-1.0.0/man/tlcview.1 b/local/recipes/tui/tlc/dist/tlc-1.0.0/man/tlcview.1 new file mode 100644 index 0000000000..1c12ae9722 --- /dev/null +++ b/local/recipes/tui/tlc/dist/tlc-1.0.0/man/tlcview.1 @@ -0,0 +1,25 @@ +.TH TLCVIEW 1 "2026-06-21" "TLC 1.0.0" "Red Bear OS User Commands" +.SH NAME +tlcview \- TLC standalone file viewer with hex-edit mode +.SH SYNOPSIS +.B tlcview +[\fB+linenum\fR] \fIfile\fR +.SH DESCRIPTION +Standalone file viewer companion to tlc. Supports text mode, hex mode, +hex-edit mode (F2 toggles; F10 opens save prompt on dirty buffer), +search (F7), goto-line (F5), magic mode auto-detection (F8), growing +buffer / tail -f (F2 in text mode), and file-next / file-prev (Ctrl-F / +Ctrl-B). +.SH OPTIONS +.TP +.BR + N +Open the file with the cursor at line +.IR N . +.TP +.I file +The file to view. +.SH SEE ALSO +.BR tlc (1), +.BR tlcedit (1) +.SH AUTHOR +Red Bear OS