From 95f2965830566916564040be2494e5ccb2b7fb2d Mon Sep 17 00:00:00 2001 From: sxyazi Date: Mon, 22 Jun 2026 22:57:43 +0800 Subject: [PATCH] Add changelog --- .github/workflows/cachix.yml | 2 +- .github/workflows/check.yml | 6 +++--- .github/workflows/draft.yml | 10 +++++----- .github/workflows/test.yml | 2 +- .github/workflows/validate-form.yml | 2 +- CHANGELOG.md | 4 ++++ Cargo.lock | 20 ++++++++++---------- yazi-codegen/Cargo.toml | 2 +- yazi-config/preset/keymap-default.toml | 3 +++ yazi-config/preset/theme-dark.toml | 6 +++--- yazi-config/preset/theme-light.toml | 6 +++--- yazi-config/src/keymap/chord.rs | 11 ++--------- yazi-config/src/keymap/chords.rs | 16 +++++++--------- yazi-config/src/theme/theme.rs | 7 +++---- yazi-core/src/help/help.rs | 9 +++++++-- yazi-fm/src/help/bindings.rs | 8 ++++---- yazi-fm/src/help/help.rs | 2 +- yazi-plugin/src/theme/theme.rs | 7 +++---- yazi-shared/src/event/actions.rs | 2 +- 19 files changed, 63 insertions(+), 62 deletions(-) diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index 686a1971..9a082530 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -15,7 +15,7 @@ jobs: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Install Nix uses: cachix/install-nix-action@v31 diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b9adca93..77b813ee 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -17,7 +17,7 @@ jobs: clippy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Setup Rust toolchain run: | @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v6 + uses: actions/checkout@v7 - name: Setup Rust toolchain run: | @@ -50,7 +50,7 @@ jobs: stylua: runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: JohnnyMorganz/stylua-action@v5 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/draft.yml b/.github/workflows/draft.yml index 976dd90f..ec5aa5d0 100644 --- a/.github/workflows/draft.yml +++ b/.github/workflows/draft.yml @@ -42,7 +42,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@v6 + - uses: actions/checkout@v7 - name: Install gcc if: matrix.gcc != '' @@ -81,7 +81,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@v6 + - uses: actions/checkout@v7 - uses: dtolnay/rust-toolchain@stable with: @@ -120,7 +120,7 @@ jobs: container: image: docker://ghcr.io/cross-rs/${{ matrix.target }}:edge steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: dtolnay/rust-toolchain@stable with: @@ -150,7 +150,7 @@ jobs: arch: arm64 runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 with: fetch-depth: 0 @@ -233,7 +233,7 @@ jobs: echo "Nightly changelog: https://github.com/sxyazi/yazi/blob/main/CHANGELOG.md#unreleased" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: actions/download-artifact@v8 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c00d7bca..7ea29bc1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - 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 bd8d9764..81ccc28a 100644 --- a/.github/workflows/validate-form.yml +++ b/.github/workflows/validate-form.yml @@ -12,7 +12,7 @@ jobs: permissions: issues: write steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - name: Setup Node.js uses: actions/setup-node@v6 diff --git a/CHANGELOG.md b/CHANGELOG.md index 0240dec6..1e509715 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/): - Drag and drop ([#4005]) - Bulk create ([#3793]) +- Make help menu a command palette ([#4074]) - Dynamic keymap Lua API ([#4031]) - New `ui.Input` element ([#4040]) - Image preview with Überzug++ on Niri ([#3990]) @@ -24,6 +25,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/): ### Changed - Rename `` to `` ([#3989]) +- Remove `help:filter` action since the filter input is now always available ([#4074]) +- `[help]` of `theme.toml`: supersede `on` with `chord`, supersede `run` and `desc` with `action`, remove `footer` ([#4074]) - Remove Legacy Console Mode on Windows ([#3989]) ### Deprecated @@ -1757,3 +1760,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/): [#4065]: https://github.com/sxyazi/yazi/pull/4065 [#4067]: https://github.com/sxyazi/yazi/pull/4067 [#4068]: https://github.com/sxyazi/yazi/pull/4068 +[#4074]: https://github.com/sxyazi/yazi/pull/4074 diff --git a/Cargo.lock b/Cargo.lock index b0376978..9f6ac5b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -215,9 +215,9 @@ dependencies = [ [[package]] name = "arrayvec" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +checksum = "f02882884d3e1bc524fb12c79f107f6ad0e1cfd498c536ffb494301740995dfe" [[package]] name = "as-slice" @@ -1931,9 +1931,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.32" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953f07c43838f8e6f9758cab68bf5bed85465e7587ebe0b823f1bcd81978ad3a" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" [[package]] name = "loop9" @@ -2788,9 +2788,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.45" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" dependencies = [ "proc-macro2", ] @@ -3831,9 +3831,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.49" +version = "0.3.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711a53c2d47bbd818258c498c8dbfe186a2526c631495cfe7e078567f86b8469" +checksum = "85c17d80feb7334b40c484e45ed1a5273dfd8bfda537c3be2e74a06a6686f327" dependencies = [ "deranged", "libc", @@ -3853,9 +3853,9 @@ checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" [[package]] name = "time-macros" -version = "0.2.29" +version = "0.2.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71c652a3727a9cbb9a02f707f530b618ce00d0ccd762009c8c23bd191df3c17d" +checksum = "dcef1a61bdb119096e153208ec5cbec23944ce8bca13be5c7f60c634f7403935" dependencies = [ "num-conv", "time-core", diff --git a/yazi-codegen/Cargo.toml b/yazi-codegen/Cargo.toml index 77427710..4dfcf0dc 100644 --- a/yazi-codegen/Cargo.toml +++ b/yazi-codegen/Cargo.toml @@ -18,5 +18,5 @@ proc-macro = true [dependencies] # External dependencies proc-macro2 = "1" -quote = "1.0.45" +quote = "1.0.46" syn = { version = "2.0.118", features = [ "full" ] } diff --git a/yazi-config/preset/keymap-default.toml b/yazi-config/preset/keymap-default.toml index a80c0c40..bb115ac6 100644 --- a/yazi-config/preset/keymap-default.toml +++ b/yazi-config/preset/keymap-default.toml @@ -371,4 +371,7 @@ keymap = [ { on = "", run = "arrow prev", desc = "Previous line" }, { on = "", run = "arrow next", desc = "Next line" }, + + { on = "", run = "arrow prev", desc = "Previous line" }, + { on = "", run = "arrow next", desc = "Next line" }, ] diff --git a/yazi-config/preset/theme-dark.toml b/yazi-config/preset/theme-dark.toml index 1c5c1825..90d6eca6 100644 --- a/yazi-config/preset/theme-dark.toml +++ b/yazi-config/preset/theme-dark.toml @@ -226,10 +226,10 @@ hovered = { fg = "magenta", bold = true } # : Help menu {{{ [help] -on = { fg = "cyan" } -desc = {} -hovered = { reversed = true, bold = true } border = { fg = "blue" } +chord = { fg = "cyan" } +action = {} +hovered = { reversed = true, bold = true } # : }}} diff --git a/yazi-config/preset/theme-light.toml b/yazi-config/preset/theme-light.toml index 0f7d1a51..43cf9552 100644 --- a/yazi-config/preset/theme-light.toml +++ b/yazi-config/preset/theme-light.toml @@ -226,10 +226,10 @@ hovered = { fg = "magenta", bold = true } # : Help menu {{{ [help] -on = { fg = "cyan" } -desc = {} -hovered = { reversed = true, bold = true } border = { fg = "blue" } +chord = { fg = "cyan" } +action = {} +hovered = { reversed = true, bold = true } # : }}} diff --git a/yazi-config/src/keymap/chord.rs b/yazi-config/src/keymap/chord.rs index 4e781203..ec74eb98 100644 --- a/yazi-config/src/keymap/chord.rs +++ b/yazi-config/src/keymap/chord.rs @@ -39,8 +39,8 @@ impl Clone for Chord { } } -impl AsRef for Chord { - fn as_ref(&self) -> &Chord { self } +impl AsRef for Chord { + fn as_ref(&self) -> &Self { self } } impl PartialEq for Chord { @@ -70,13 +70,6 @@ impl Chord { pub fn desc_or_run(&self) -> Cow<'_, str> { self.desc().unwrap_or_else(|| self.run().into()) } - pub fn contains(&self, s: &str) -> bool { - let s = s.to_lowercase(); - self.desc().map(|d| d.to_lowercase().contains(&s)) == Some(true) - || self.run().to_lowercase().contains(&s) - || self.on().to_lowercase().contains(&s) - } - #[inline] pub(super) fn noop(&self) -> bool { self.run.len() == 1 && self.run[0].name == "noop" && self.run[0].args.is_empty() diff --git a/yazi-config/src/keymap/chords.rs b/yazi-config/src/keymap/chords.rs index 0a98e511..1b1bdc40 100644 --- a/yazi-config/src/keymap/chords.rs +++ b/yazi-config/src/keymap/chords.rs @@ -10,23 +10,21 @@ use crate::keymap::{Chord, ChordArc, ChordIter, ChordMatcher}; #[derive(Debug, Default, Deserialize)] #[serde(transparent)] -pub struct Chords { - pub(super) chords: ArcSwap>, -} +pub struct Chords(ArcSwap>); impl Deref for Chords { type Target = ArcSwap>; - fn deref(&self) -> &Self::Target { &self.chords } + fn deref(&self) -> &Self::Target { &self.0 } } impl From> for Chords { - fn from(inner: Vec) -> Self { Self { chords: inner.into_pointee() } } + fn from(inner: Vec) -> Self { Self(inner.into_pointee()) } } impl Chords { pub fn insert(&self, index: isize, rule: ChordArc) -> Result<(), IndexAtError> { - self.chords.try_rcu(|rules| { + self.0.try_rcu(|rules| { let (before, after) = rules.split_at(rules.index_at(index)?); Ok( before @@ -42,7 +40,7 @@ impl Chords { } pub fn remove(&self, matcher: ChordMatcher) { - self.chords.rcu(|chords| { + self.0.rcu(|chords| { let mut next = Vec::clone(chords); next.retain(|arc| !matcher.matches(arc)); next @@ -54,7 +52,7 @@ impl Chords { matcher: ChordMatcher, f: impl Fn(Chord) -> Result, ) -> Result<(), E> { - self.chords.try_rcu(|rules| { + self.0.try_rcu(|rules| { let mut next = Vec::clone(rules); for arc in &mut next { if matcher.matches(arc) { @@ -68,7 +66,7 @@ impl Chords { } pub(crate) fn unwrap_unchecked(self) -> Vec { - Arc::try_unwrap(self.chords.into_inner()).expect("unique chords arc") + Arc::try_unwrap(self.0.into_inner()).expect("unique chords arc") } } diff --git a/yazi-config/src/theme/theme.rs b/yazi-config/src/theme/theme.rs index 9f1d5af6..4998eae1 100644 --- a/yazi-config/src/theme/theme.rs +++ b/yazi-config/src/theme/theme.rs @@ -264,11 +264,10 @@ pub struct Tasks { // --- Help #[derive(Deserialize, DeserializeOver, DeserializeOver2, Overlay)] pub struct Help { - pub on: SyncCell, - pub desc: SyncCell, - - pub hovered: SyncCell, pub border: SyncCell, + pub chord: SyncCell, + pub action: SyncCell, + pub hovered: SyncCell, } fn deserialize_syntect_theme<'de, D>(deserializer: D) -> Result, D::Error> diff --git a/yazi-core/src/help/help.rs b/yazi-core/src/help/help.rs index 75b81548..fd5472fb 100644 --- a/yazi-core/src/help/help.rs +++ b/yazi-core/src/help/help.rs @@ -41,9 +41,14 @@ impl Help { self.keyword.clear(); self.bindings = KEYMAP.chords(self.layer).iter().cloned().collect(); } else if self.keyword != kw { + let lowercased = kw.to_lowercase(); self.keyword = kw.to_owned(); - self.bindings = - KEYMAP.chords(self.layer).iter().filter(|&c| c.contains(kw)).cloned().collect(); + self.bindings = KEYMAP + .chords(self.layer) + .iter() + .filter(|&c| c.desc_or_run().to_lowercase().contains(&lowercased)) + .cloned() + .collect(); } render!(self.scroll(0)); diff --git a/yazi-fm/src/help/bindings.rs b/yazi-fm/src/help/bindings.rs index ca3d2c40..a234040f 100644 --- a/yazi-fm/src/help/bindings.rs +++ b/yazi-fm/src/help/bindings.rs @@ -18,14 +18,14 @@ impl Widget for Bindings<'_> { return; } - // On + // Chord let col1: Vec<_> = - bindings.iter().map(|c| ListItem::new(c.on()).style(THEME.help.on.get())).collect(); + bindings.iter().map(|c| ListItem::new(c.on()).style(THEME.help.chord.get())).collect(); - // Desc (or run) + // Action let col2: Vec<_> = bindings .iter() - .map(|c| ListItem::new(c.desc_or_run()).style(THEME.help.desc.get())) + .map(|c| ListItem::new(c.desc_or_run()).style(THEME.help.action.get())) .collect(); let chunks = diff --git a/yazi-fm/src/help/help.rs b/yazi-fm/src/help/help.rs index c06d14e1..221481a0 100644 --- a/yazi-fm/src/help/help.rs +++ b/yazi-fm/src/help/help.rs @@ -1,4 +1,4 @@ -use ratatui_core::{buffer::Buffer, layout::{self, Alignment, Constraint, Layout, Margin, Rect}, symbols::merge::MergeStrategy, widgets::Widget}; +use ratatui_core::{buffer::Buffer, layout::{Alignment, Constraint, Layout, Rect}, symbols::merge::MergeStrategy, widgets::Widget}; use ratatui_widgets::{block::{Block, Padding}, borders::BorderType}; use yazi_config::THEME; use yazi_core::Core; diff --git a/yazi-plugin/src/theme/theme.rs b/yazi-plugin/src/theme/theme.rs index 6685dbfe..8460b169 100644 --- a/yazi-plugin/src/theme/theme.rs +++ b/yazi-plugin/src/theme/theme.rs @@ -361,11 +361,10 @@ fn help() -> Composer { fn get(lua: &Lua, key: &[u8]) -> mlua::Result { let t = &THEME.help; match key { - b"on" => Style::from(&t.on).into_lua(lua), - b"desc" => Style::from(&t.desc).into_lua(lua), - - b"hovered" => Style::from(&t.hovered).into_lua(lua), b"border" => Style::from(&t.border).into_lua(lua), + b"chord" => Style::from(&t.chord).into_lua(lua), + b"action" => Style::from(&t.action).into_lua(lua), + b"hovered" => Style::from(&t.hovered).into_lua(lua), _ => Ok(Value::Nil), } diff --git a/yazi-shared/src/event/actions.rs b/yazi-shared/src/event/actions.rs index 21b869fd..70259752 100644 --- a/yazi-shared/src/event/actions.rs +++ b/yazi-shared/src/event/actions.rs @@ -4,7 +4,7 @@ use mlua::{ExternalError, FromLua, IntoLua, Lua, Value}; use serde::Deserializer; use serde_with::{DeserializeAs, DisplayFromStr, OneOrMany}; -use crate::{Layer, Source, event::Action}; +use crate::{Source, event::Action}; #[derive(Clone, Debug, Default)] pub struct Actions(pub Vec);