Skip to content

Commit 7ffef8a

Browse files
committed
Fix "Newest Added" sort using wrong array index (24 → 23)
The client-side sort for "Newest Added" was referencing index 24 of the tire data array, but created_at lives at index 23. This caused every comparison to compare empty strings, making the sort a no-op. Bump to v1.17.1. https://claude.ai/code/session_01EgrFSRuBCK7QEEy8WMRfLh
1 parent 08f8aeb commit 7ffef8a

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to the Rivian Tire Guide plugin will be documented in this f
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
## [1.17.1] - 2026-02-20
8+
9+
### Fixed
10+
- **"Newest Added" sort broken** — The client-side "Newest Added" sort option was reading from the wrong array index (24 instead of 23), causing it to compare empty values and effectively not sort at all. Tires now correctly sort by `created_at` descending.
11+
712
## [1.17.0] - 2026-02-20
813

914
### Changed

frontend/js/modules/filters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ function applySorting(sortOption) {
374374
state.filteredRows.sort((a, b) => validateNumeric(a[8], NUMERIC_BOUNDS.weight, 0) - validateNumeric(b[8], NUMERIC_BOUNDS.weight, 0));
375375
break;
376376
case "newest":
377-
state.filteredRows.sort((a, b) => safeString(b[24]).localeCompare(safeString(a[24])));
377+
state.filteredRows.sort((a, b) => safeString(b[23]).localeCompare(safeString(a[23])));
378378
break;
379379
}
380380
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rivian-tire-guide",
3-
"version": "1.17.0",
3+
"version": "1.17.1",
44
"private": true,
55
"description": "Interactive tire guide for Rivian vehicles — WordPress plugin",
66
"scripts": {

rivian-tire-guide.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* Plugin Name: Rivian Tire Guide
44
* Description: Interactive tire guide for Rivian vehicles with filtering, comparison, and ratings.
5-
* Version: 1.17.0
5+
* Version: 1.17.1
66
* Author: RivianTrackr
77
* Text Domain: rivian-tire-guide
88
* Requires at least: 5.8
@@ -13,7 +13,7 @@
1313
exit;
1414
}
1515

16-
define( 'RTG_VERSION', '1.17.0' );
16+
define( 'RTG_VERSION', '1.17.1' );
1717
define( 'RTG_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
1818
define( 'RTG_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
1919
define( 'RTG_PLUGIN_FILE', __FILE__ );

0 commit comments

Comments
 (0)