refactor(sort): introduce build_tmp_sort utility; apply to event_presentation and journals
Creates src/lib/ae_core/core__idb_sort.ts with build_tmp_sort() — a shared
helper for computing tmp_sort_1/2/3 fields stored in Dexie. Fixes two bugs
present in all generic _process_generic_props implementations:
- priority encoded as 0/1 ASC (true sorted last); now inverted: true→'0'
- sort stored as unpadded string ("10" < "2"); now 8-char zero-padded
Applied to:
- ae_events__event_presentation: replaces inline specific_processor code
- ae_journals__journal + ae_journals__journal_entry: replaces manual formulas;
journal liveQueries (.reverse().sortBy()) updated to plain .sortBy() since
the inverted encoding handles direction without needing Dexie's .reverse()
Other modules (sessions, presenters, locations, posts, core) left unchanged
until their sort behavior is reviewed separately.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -59,7 +59,6 @@ let lq__journal_obj_li = $derived(
|
||||
return await db_journals.journal
|
||||
.where('person_id')
|
||||
.equals($ae_loc.person_id)
|
||||
.reverse()
|
||||
.sortBy('tmp_sort_3');
|
||||
})
|
||||
);
|
||||
|
||||
@@ -105,7 +105,6 @@ let lq__journal_obj_li = $derived(
|
||||
let results = await db_journals.journal
|
||||
.where('person_id')
|
||||
.equals($ae_loc.person_id)
|
||||
.reverse()
|
||||
.sortBy('tmp_sort_2');
|
||||
|
||||
// Check if results are different than the current session version stored under $journals_slct
|
||||
|
||||
Reference in New Issue
Block a user