Add changelog

This commit is contained in:
sxyazi 2026-06-22 22:57:43 +08:00
parent 512b5886cd
commit 95f2965830
No known key found for this signature in database
19 changed files with 63 additions and 62 deletions

View file

@ -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

View file

@ -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 }}

View file

@ -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:

View file

@ -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

View file

@ -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

View file

@ -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 `<BackTab>` to `<S-Tab>` ([#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

20
Cargo.lock generated
View file

@ -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",

View file

@ -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" ] }

View file

@ -371,4 +371,7 @@ keymap = [
{ on = "<Up>", run = "arrow prev", desc = "Previous line" },
{ on = "<Down>", run = "arrow next", desc = "Next line" },
{ on = "<C-p>", run = "arrow prev", desc = "Previous line" },
{ on = "<C-n>", run = "arrow next", desc = "Next line" },
]

View file

@ -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 }
# : }}}

View file

@ -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 }
# : }}}

View file

@ -39,8 +39,8 @@ impl Clone for Chord {
}
}
impl AsRef<Chord> for Chord {
fn as_ref(&self) -> &Chord { self }
impl AsRef<Self> 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()

View file

@ -10,23 +10,21 @@ use crate::keymap::{Chord, ChordArc, ChordIter, ChordMatcher};
#[derive(Debug, Default, Deserialize)]
#[serde(transparent)]
pub struct Chords {
pub(super) chords: ArcSwap<Vec<ChordArc>>,
}
pub struct Chords(ArcSwap<Vec<ChordArc>>);
impl Deref for Chords {
type Target = ArcSwap<Vec<ChordArc>>;
fn deref(&self) -> &Self::Target { &self.chords }
fn deref(&self) -> &Self::Target { &self.0 }
}
impl From<Vec<ChordArc>> for Chords {
fn from(inner: Vec<ChordArc>) -> Self { Self { chords: inner.into_pointee() } }
fn from(inner: Vec<ChordArc>) -> 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<Chord, E>,
) -> 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<ChordArc> {
Arc::try_unwrap(self.chords.into_inner()).expect("unique chords arc")
Arc::try_unwrap(self.0.into_inner()).expect("unique chords arc")
}
}

View file

@ -264,11 +264,10 @@ pub struct Tasks {
// --- Help
#[derive(Deserialize, DeserializeOver, DeserializeOver2, Overlay)]
pub struct Help {
pub on: SyncCell<StyleFlat>,
pub desc: SyncCell<StyleFlat>,
pub hovered: SyncCell<StyleFlat>,
pub border: SyncCell<StyleFlat>,
pub chord: SyncCell<StyleFlat>,
pub action: SyncCell<StyleFlat>,
pub hovered: SyncCell<StyleFlat>,
}
fn deserialize_syntect_theme<'de, D>(deserializer: D) -> Result<ArcSwap<PathBuf>, D::Error>

View file

@ -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));

View file

@ -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 =

View file

@ -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;

View file

@ -361,11 +361,10 @@ fn help() -> Composer<ComposerGet, ComposerSet> {
fn get(lua: &Lua, key: &[u8]) -> mlua::Result<Value> {
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),
}

View file

@ -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<Action>);