diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index 144aa8c..1663ec7 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -7,6 +7,8 @@ on: env: CARGO_INCREMENTAL: 0 CARGO_TERM_COLOR: always + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" RUSTC_WRAPPER: "sccache" RUSTFLAGS: -D warnings SCCACHE_GHA_ENABLED: "true" @@ -17,55 +19,32 @@ jobs: name: Nightly clippy (wasm32) runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - # Install caches - - name: Install sccache - uses: mozilla-actions/sccache-action@v0.0.6 - - name: Cache cargo registry and index - uses: actions/cache@v4 - with: - path: | - ~/.cargo/registry - ~/.cargo/index - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo target - uses: actions/cache@v4 + - uses: actions/checkout@v6 + - uses: mozilla-actions/sccache-action@v0.0.9 + - uses: Swatinem/rust-cache@v2 with: - path: target - key: ${{ runner.os }}-cargo-target-${{ hashFiles('**/Cargo.lock') }} - - # Install toolchain - - name: Install toolchain - uses: actions-rs/toolchain@v1 + shared-key: "deps-cache-stable" + cache-targets: "false" # IMPORTANT: Let sccache handle target artifacts + - uses: dtolnay/rust-toolchain@stable with: toolchain: nightly target: wasm32-unknown-unknown components: clippy, rustfmt - override: true # Formatting check - name: Check formatting run: cargo fmt -- --check # Clippy checks - - name: Vertigo-forms Clippy - uses: actions-rs/clippy-check@v1 + - name: Clippy (stable) + uses: giraffate/clippy-action@v1 with: - token: ${{ secrets.GITHUB_TOKEN }} - args: -p vertigo-forms --all-features --target wasm32-unknown-unknown -- -Dwarnings - name: Vertigo-forms Clippy Output - - name: Examples Clippy - uses: actions-rs/clippy-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - args: -p vertigo-forms-storybook -p vertigo-forms-example-manual-form -p vertigo-forms-example-model-form --all-features --target wasm32-unknown-unknown -- -Dwarnings - name: Storybook/Examples Clippy Output + tool_name: "Clippy (stable)" + reporter: github-pr-review + filter_mode: added + github_token: ${{ secrets.GITHUB_TOKEN }} + clippy_flags: --all --all-features --tests --locked # Unit tests - name: Unit tests - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features + run: cargo test --all --all-features --locked diff --git a/CHANGES.md b/CHANGES.md index e8f9475..38fb456 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,7 +5,8 @@ ### Fixed -* Fixed positioning of `SelectSearch`, `Popup` and `MultiDropDown` popups +* Positioning of `SelectSearch`, `Popup` and `MultiDropDown` popups +* `SelectSearch` sorting ## 0.1.3 - 2026-03-05 diff --git a/src/select_search.rs b/src/select_search.rs index 937e564..278588c 100644 --- a/src/select_search.rs +++ b/src/select_search.rs @@ -50,12 +50,14 @@ pub fn SelectSearch( let inner_filter = inner_filter.to_lowercase(); if inner_filter.len() >= params.min_chars { // Filter options - inner_options + let mut filtered = inner_options .into_iter() .filter(|(_, opt_value)| { opt_value.to_string().to_lowercase().contains(&inner_filter) }) - .collect::>() + .collect::>(); + filtered.sort_by_cached_key(|(_, opt_value)| opt_value.to_string()); + filtered } else { vec![] }