W71: Fix all review-identified gaps

High-severity fixes:
- Replace 2× unreachable!('mkdir not spawned with progress') in
  dialog_ops.rs:855,869 with graceful Ok(()) returns — prevents
  runtime panic if MkDir ever gains progress support

Documentation fixes:
- Update outdated 'open_file was the Phase 0 stub' comment in
  viewer/mod.rs to reflect current state (standalone tlcview binary)
- Update usermenu.rs CK_EditUserMenu TODO — feature already
  implemented in dispatch_editor_cmd
- Update PLAN.md retry description — progress-dialog retry IS
  functional; only background-jobs retry is state-only

Tests: 1427 pass, zero warnings.
This commit is contained in:
2026-07-07 17:43:39 +03:00
parent 5258ebe6ff
commit b95ac973e8
4 changed files with 16 additions and 9 deletions
+4 -3
View File
@@ -299,9 +299,10 @@ Mirrors MC's `filegui.c::file_progress_real_query_replace` and the
FILE_SKIP, FILE_ABORT, FILE_IGNORE. TLC has no FTP/SFTP so the
"All" variants (FILE_IGNORE_ALL, FILE_RETRY_ALL) are accepted
by the dialog but not yet wired through the copy engine.
Retry is a stub (logs a message) because batch step resumption
would require threading the op index through copy/move/delete
batch functions — deferred to a follow-up sprint.
Retry in the progress-dialog error path IS functional (re-begins
the operation and re-runs). Retry in the background jobs dialog
(jobs.rs:600-604) is state-only — the original sources list cannot
be recovered from the jobs dialog context.
New file: `src/filemanager/error_dialog.rs`
- `ErrorDialog` with path + error message
@@ -11,8 +11,8 @@
//! it at the cursor position.
//!
//! The MC `CK_EditUserMenu` variant opens the menu file itself in
//! the editor — that path just runs `UserMenu::new().storage_path`
//! through the regular `Open` flow, so we defer it to a TODO.
//! the editor — implemented via `EditorCmd::EditUserMenu` in
//! `dispatch_editor_cmd`.
use std::path::{Path, PathBuf};
@@ -852,7 +852,12 @@ Err(e) => self.status.set_error(format!("view: {e}")),
crate::ops::OpKind::Delete => {
crate::ops::delete::delete_many(&thread_sources, &thread_handle)
}
crate::ops::OpKind::MkDir => unreachable!("mkdir not spawned with progress"),
crate::ops::OpKind::MkDir => {
// MkDir is instantaneous — it should never be
// spawned with a progress dialog. If it reaches
// this branch, treat it as a success (no work).
Ok(())
}
};
let _ = tx.send(result);
});
@@ -861,7 +866,7 @@ Err(e) => self.status.set_error(format!("view: {e}")),
crate::ops::OpKind::Copy => "Copying...".to_string(),
crate::ops::OpKind::Move => "Moving...".to_string(),
crate::ops::OpKind::Delete => "Deleting...".to_string(),
crate::ops::OpKind::MkDir => unreachable!("mkdir not spawned with progress"),
crate::ops::OpKind::MkDir => "Creating...".to_string(),
};
let mut pd = crate::ops::progress::ProgressDialog::new();
pd.title = title;
@@ -1459,10 +1459,11 @@ impl Viewer {
}
}
/// Backwards-compat shim: `open_file` was the Phase 0 stub.
/// Standalone viewer entry-point used by the `tlcview` binary.
/// Opens `file` in the viewer with optional line-number navigation.
pub fn open_file(file: &str, start_line: Option<u64>) -> Result<()> {
use crate::terminal::event::translate_key;
use crate::terminal::color::DEFAULT_THEME;
use crate::terminal::event::translate_key;
use termion::event::Event as TermEvent;
use termion::input::TermReadEventsAndRaw;