Fix: Stabilize Journal Entries query logic and UI search behavior
- Consolidated LiveQuery logic into [journal_id]/+page.svelte and removed redundancy from layout. - Added automatic load trigger on journal_id change to ensure data freshness. - Hardened Enabled/Hidden filters to correctly include NULL/undefined values in default views. - Refined search behavior to distinguish between "default view" (null) and "no results found" ([]). - Updated modal_journals_config.svelte with standardized module-level settings. - Robust ID handling in bulk retrieval to handle varying property names (id, random_id).
This commit is contained in:
@@ -21,14 +21,6 @@ const journals_local_data_struct: key_val = {
|
||||
time_format: 'time_12_short',
|
||||
time_hours: 12, // 12 or 24
|
||||
|
||||
qry__enabled: 'enabled', // all, disabled, enabled
|
||||
qry__hidden: 'not_hidden', // all, hidden, not_hidden
|
||||
qry__limit: 20,
|
||||
qry__order_by_li: {
|
||||
// 'created_on': 'desc',
|
||||
// 'updated_on': 'desc',
|
||||
},
|
||||
qry__offset: 0,
|
||||
qry__journal_id: null,
|
||||
|
||||
journal_view_history_li: [], // Appended each time the journal is loaded.
|
||||
@@ -58,6 +50,17 @@ const journals_local_data_struct: key_val = {
|
||||
edit: false,
|
||||
edit_kv: {},
|
||||
|
||||
// Query / Search Settings
|
||||
qry__search_text: '',
|
||||
qry__enabled: 'enabled', // all, disabled, enabled
|
||||
qry__hidden: 'not_hidden', // all, hidden, not_hidden
|
||||
qry__limit: 25,
|
||||
qry__offset: 0,
|
||||
qry__order_by_li: {
|
||||
// 'created_on': 'desc',
|
||||
// 'updated_on': 'desc',
|
||||
},
|
||||
|
||||
type_code_li: [
|
||||
{ code: 'diary', name: 'Diary' },
|
||||
{ code: 'log', name: 'Log' },
|
||||
@@ -72,6 +75,24 @@ const journals_local_data_struct: key_val = {
|
||||
]
|
||||
},
|
||||
entry: {
|
||||
edit: false,
|
||||
edit_kv: {},
|
||||
|
||||
// Query / Search Settings
|
||||
qry__search_text: '',
|
||||
qry__category_code: '', // For filtering
|
||||
qry__enabled: 'enabled', // all, disabled, enabled
|
||||
qry__hidden: 'not_hidden', // all, hidden, not_hidden
|
||||
qry__limit: 50,
|
||||
qry__offset: 0,
|
||||
qry__order_by_li: {
|
||||
// 'created_on': 'desc',
|
||||
// 'updated_on': 'desc',
|
||||
},
|
||||
|
||||
// This is effectively "last used journal for creating entries"
|
||||
qry__journal_id: null,
|
||||
|
||||
llm__system_prompt:
|
||||
'Summarize the following journal entry content in a concise manner, focusing on key points and insights.',
|
||||
llm__max_tokens: 512,
|
||||
@@ -81,9 +102,7 @@ const journals_local_data_struct: key_val = {
|
||||
llm__frequency_penalty: 0.0,
|
||||
llm__presence_penalty: 0.0,
|
||||
|
||||
auto_save: false,
|
||||
edit: false,
|
||||
edit_kv: {}
|
||||
auto_save: false
|
||||
}
|
||||
};
|
||||
// console.log(`AE Stores - App Journals Local Storage Data:`, journals_local_data_struct);
|
||||
|
||||
Reference in New Issue
Block a user