diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..bff47538 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "ci" + + - package-ecosystem: "npm" + directory: "/scripts/validate-form" + schedule: + interval: "weekly" + commit-message: + prefix: "ci" diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index 26be625d..2d1c89e3 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -12,7 +12,7 @@ jobs: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Install Nix uses: cachix/install-nix-action@v31 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 5601b3c7..56e8e14d 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -14,7 +14,7 @@ jobs: clippy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Setup Rust toolchain run: | @@ -31,7 +31,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Setup Rust toolchain run: | @@ -47,7 +47,7 @@ jobs: stylua: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: JohnnyMorganz/stylua-action@v4 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/draft.yml b/.github/workflows/draft.yml index 9703ca34..1b74fe10 100644 --- a/.github/workflows/draft.yml +++ b/.github/workflows/draft.yml @@ -39,7 +39,7 @@ jobs: CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER: riscv64-linux-gnu-gcc CARGO_TARGET_SPARC64_UNKNOWN_LINUX_GNU_LINKER: sparc64-linux-gnu-gcc steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Install gcc if: matrix.gcc != '' @@ -77,7 +77,7 @@ jobs: CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: lld-link.exe CARGO_TARGET_AARCH64_PC_WINDOWS_MSVC_LINKER: lld-link.exe steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Setup Rust toolchain run: rustup toolchain install stable --profile minimal --target ${{ matrix.target }} @@ -115,7 +115,7 @@ jobs: container: image: docker://ghcr.io/cross-rs/${{ matrix.target }}:edge steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - uses: dtolnay/rust-toolchain@stable with: @@ -145,7 +145,7 @@ jobs: arch: arm64 runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 with: fetch-depth: 0 @@ -171,7 +171,7 @@ jobs: runs-on: ubuntu-latest needs: [build-snap] steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: pattern: snap-* merge-multiple: true @@ -200,7 +200,7 @@ jobs: runs-on: ubuntu-latest needs: [build-unix, build-windows, build-musl, build-snap] steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: merge-multiple: true @@ -227,9 +227,9 @@ jobs: echo "Generated on: $(date -u +"%Y-%m-%d %H:%M") UTC" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: merge-multiple: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 434b693d..895df8ec 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -8,7 +8,7 @@ jobs: winget: runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v5 with: merge-multiple: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 801d4579..e524a55a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Setup Rust toolchain run: rustup toolchain install stable --profile minimal diff --git a/.github/workflows/validate-form.yml b/.github/workflows/validate-form.yml index 23ab68a1..b30759fa 100644 --- a/.github/workflows/validate-form.yml +++ b/.github/workflows/validate-form.yml @@ -12,10 +12,10 @@ jobs: permissions: issues: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-js: 20 @@ -25,7 +25,7 @@ jobs: npm ci - name: Validate Form - uses: actions/github-script@v7 + uses: actions/github-script@v8 with: script: | const script = require('./scripts/validate-form/main.js') diff --git a/yazi-actor/src/lives/task.rs b/yazi-actor/src/lives/task.rs index fd69946f..12b5f560 100644 --- a/yazi-actor/src/lives/task.rs +++ b/yazi-actor/src/lives/task.rs @@ -32,7 +32,6 @@ impl UserData for TaskSnap { fields.add_field_method_get("running", |_, me| Ok(me.prog.running())); fields.add_field_method_get("success", |_, me| Ok(me.prog.success())); - fields.add_field_method_get("cleaning", |_, me| Ok(me.prog.cleaning())); fields.add_field_method_get("percent", |_, me| Ok(me.prog.percent())); } } diff --git a/yazi-binding/src/url.rs b/yazi-binding/src/url.rs index 7e8182eb..6135d56d 100644 --- a/yazi-binding/src/url.rs +++ b/yazi-binding/src/url.rs @@ -1,7 +1,7 @@ use std::ops::Deref; use mlua::{AnyUserData, ExternalError, FromLua, Lua, MetaMethod, UserData, UserDataFields, UserDataMethods, UserDataRef, Value}; -use yazi_shared::{IntoOsStr, url::{UrlBufCov, UrlCow}}; +use yazi_shared::{IntoOsStr, url::UrlCow}; use crate::{Urn, cached_field, deprecate}; diff --git a/yazi-plugin/preset/components/tasks.lua b/yazi-plugin/preset/components/tasks.lua index c85d6bf3..1976b72e 100644 --- a/yazi-plugin/preset/components/tasks.lua +++ b/yazi-plugin/preset/components/tasks.lua @@ -75,7 +75,7 @@ function Tasks:progress_redraw(snap, y) local kind = snap.prog.kind if kind == "FilePaste" or kind == "FileDelete" then local percent - if snap.cleaning then + if snap.success then percent = "Cleaning…" else percent = string.format("%3d%%", math.floor(snap.percent)) diff --git a/yazi-scheduler/src/file/progress.rs b/yazi-scheduler/src/file/progress.rs index 74a51b01..4486db54 100644 --- a/yazi-scheduler/src/file/progress.rs +++ b/yazi-scheduler/src/file/progress.rs @@ -31,7 +31,7 @@ impl FileProgPaste { pub fn success(self) -> bool { self.collected && self.success_files == self.total_files } - pub fn cleaning(self) -> bool { !self.cleaned && self.success() } + pub fn cleaned(self) -> bool { self.cleaned } pub fn percent(self) -> Option { Some(if self.success() { @@ -66,7 +66,7 @@ impl FileProgLink { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { self.success() } + pub fn cleaned(self) -> bool { false } pub fn percent(self) -> Option { None } } @@ -96,7 +96,7 @@ impl FileProgHardlink { pub fn success(self) -> bool { self.collected && self.success == self.total } - pub fn cleaning(self) -> bool { self.success() } + pub fn cleaned(self) -> bool { false } pub fn percent(self) -> Option { None } } @@ -131,7 +131,7 @@ impl FileProgDelete { pub fn success(self) -> bool { self.collected && self.success_files == self.total_files } - pub fn cleaning(self) -> bool { !self.cleaned && self.success() } + pub fn cleaned(self) -> bool { self.cleaned } pub fn percent(self) -> Option { Some(if self.success() { @@ -166,7 +166,7 @@ impl FileProgTrash { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { self.success() } + pub fn cleaned(self) -> bool { false } pub fn percent(self) -> Option { None } } diff --git a/yazi-scheduler/src/plugin/progress.rs b/yazi-scheduler/src/plugin/progress.rs index e1d4b27b..b22ff85c 100644 --- a/yazi-scheduler/src/plugin/progress.rs +++ b/yazi-scheduler/src/plugin/progress.rs @@ -23,7 +23,7 @@ impl PluginProgEntry { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { self.success() } + pub fn cleaned(self) -> bool { false } pub fn percent(self) -> Option { None } } diff --git a/yazi-scheduler/src/prework/progress.rs b/yazi-scheduler/src/prework/progress.rs index a0709663..91200ff4 100644 --- a/yazi-scheduler/src/prework/progress.rs +++ b/yazi-scheduler/src/prework/progress.rs @@ -23,7 +23,7 @@ impl PreworkProgFetch { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { self.success() } + pub fn cleaned(self) -> bool { false } pub fn percent(self) -> Option { None } } @@ -50,7 +50,7 @@ impl PreworkProgLoad { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { self.success() } + pub fn cleaned(self) -> bool { false } pub fn percent(self) -> Option { None } } @@ -77,7 +77,7 @@ impl PreworkProgSize { pub fn success(self) -> bool { self.done } - pub fn cleaning(self) -> bool { self.success() } + pub fn cleaned(self) -> bool { false } pub fn percent(self) -> Option { None } } diff --git a/yazi-scheduler/src/process/progress.rs b/yazi-scheduler/src/process/progress.rs index d75938f6..e4ddc657 100644 --- a/yazi-scheduler/src/process/progress.rs +++ b/yazi-scheduler/src/process/progress.rs @@ -24,7 +24,7 @@ impl ProcessProgBlock { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { !self.cleaned && self.success() } + pub fn cleaned(self) -> bool { self.cleaned } pub fn percent(self) -> Option { None } } @@ -52,7 +52,7 @@ impl ProcessProgOrphan { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { !self.cleaned && self.success() } + pub fn cleaned(self) -> bool { self.cleaned } pub fn percent(self) -> Option { None } } @@ -80,7 +80,7 @@ impl ProcessProgBg { pub fn success(self) -> bool { self.state == Some(true) } - pub fn cleaning(self) -> bool { !self.cleaned && self.success() } + pub fn cleaned(self) -> bool { self.cleaned } pub fn percent(self) -> Option { None } } diff --git a/yazi-scheduler/src/progress.rs b/yazi-scheduler/src/progress.rs index a28101ac..d52c4eea 100644 --- a/yazi-scheduler/src/progress.rs +++ b/yazi-scheduler/src/progress.rs @@ -101,24 +101,24 @@ impl TaskProg { } } - pub fn cleaning(self) -> bool { + pub fn cleaned(self) -> bool { match self { // File - Self::FilePaste(p) => p.cleaning(), - Self::FileLink(p) => p.cleaning(), - Self::FileHardlink(p) => p.cleaning(), - Self::FileDelete(p) => p.cleaning(), - Self::FileTrash(p) => p.cleaning(), + Self::FilePaste(p) => p.cleaned(), + Self::FileLink(p) => p.cleaned(), + Self::FileHardlink(p) => p.cleaned(), + Self::FileDelete(p) => p.cleaned(), + Self::FileTrash(p) => p.cleaned(), // Plugin - Self::PluginEntry(p) => p.cleaning(), + Self::PluginEntry(p) => p.cleaned(), // Prework - Self::PreworkFetch(p) => p.cleaning(), - Self::PreworkLoad(p) => p.cleaning(), - Self::PreworkSize(p) => p.cleaning(), + Self::PreworkFetch(p) => p.cleaned(), + Self::PreworkLoad(p) => p.cleaned(), + Self::PreworkSize(p) => p.cleaned(), // Process - Self::ProcessBlock(p) => p.cleaning(), - Self::ProcessOrphan(p) => p.cleaning(), - Self::ProcessBg(p) => p.cleaning(), + Self::ProcessBlock(p) => p.cleaned(), + Self::ProcessOrphan(p) => p.cleaned(), + Self::ProcessBg(p) => p.cleaned(), } } diff --git a/yazi-scheduler/src/scheduler.rs b/yazi-scheduler/src/scheduler.rs index 790801e4..55dc0f26 100644 --- a/yazi-scheduler/src/scheduler.rs +++ b/yazi-scheduler/src/scheduler.rs @@ -390,7 +390,7 @@ impl Scheduler { let Some(task) = ongoing.get_mut(op.id) else { continue }; op.out.reduce(task); - if !task.prog.success() { + if !task.prog.success() && !task.prog.cleaned() { continue; } else if let Some(hook) = ongoing.hooks.pop(op.id) && let Some(fut) = hook.call(false)