fix(settings): name descending size sort explicitly
The library sort setting used `size` for largest-first sorting while the ascending option used `sizeAsc`. That made the pair asymmetric and left the current settings model carrying a legacy-looking key. Rename the current descending key to `sizeDesc` in the type, menu, and sort logic. Stored `size` values are normalized to `sizeDesc` on read, so existing users keep the same largest-first behavior while new writes use the explicit key. Test Plan: - deno task build - RUSTC_WRAPPER= CARGO_BUILD_RUSTC_WRAPPER= just build - git diff --check Refs: local review feedback
This commit is contained in:
@@ -213,7 +213,7 @@ export const applyFilterAndSort = (
|
||||
switch (sort) {
|
||||
case 'az':
|
||||
return [...list].sort((a, b) => a.name.localeCompare(b.name));
|
||||
case 'size':
|
||||
case 'sizeDesc':
|
||||
return [...list].sort((a, b) => b.size - a.size);
|
||||
case 'sizeAsc':
|
||||
return [...list].sort((a, b) => a.size - b.size);
|
||||
|
||||
@@ -62,7 +62,7 @@ export interface GamesListPayload {
|
||||
export type GameFilter = 'all' | 'local' | 'installed';
|
||||
|
||||
/** Library sort order. */
|
||||
export type GameSort = 'az' | 'size' | 'sizeAsc' | 'status';
|
||||
export type GameSort = 'az' | 'sizeDesc' | 'sizeAsc' | 'status';
|
||||
|
||||
/** Visual state of a card. Derived from install/download flags. */
|
||||
export type DerivedState = 'installed' | 'local' | 'none' | 'busy';
|
||||
|
||||
Reference in New Issue
Block a user