From 429f38996a6c83f64d6a5b4e8e13af22d7a6709a Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Mon, 18 May 2026 17:50:43 -0400 Subject: [PATCH] =?UTF-8?q?refactor(idaa):=20filter=20bar=20polish=20?= =?UTF-8?q?=E2=80=94=20cycling=20sort,=20centered=20layout,=20move=20into?= =?UTF-8?q?=20form?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace three sort chips with single cycling button (Last Updated → Name A→Z → Name Z→A → repeat) - Add min-w-36 to sort button to prevent layout bounce between labels - Move My Meetings chip to filter row (first position) alongside Virtual/In-Person - Widen filter chips row from max-w-xl to max-w-2xl to match search bar - Move sort/max/actions section inside
so all rows share the same width constraint - Flatten span wrappers in bottom row — all buttons are direct flex children of justify-center container, fixing left-drift when conditional buttons are hidden - Add keyed {#each (val)} to Type chip loop Co-Authored-By: Claude Sonnet 4.6 --- .../ae_idaa_comp__event_obj_qry.svelte | 489 ++++++++---------- 1 file changed, 221 insertions(+), 268 deletions(-) diff --git a/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_qry.svelte b/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_qry.svelte index 71ba2ee3..4293d8c6 100644 --- a/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_qry.svelte +++ b/src/routes/idaa/(idaa)/recovery_meetings/ae_idaa_comp__event_obj_qry.svelte @@ -65,21 +65,22 @@ function prevent_default(fn: (event: T) => void) { }; } -function set_sort_mode(mode: string) { - $idaa_loc.recovery_meetings.qry__order_by = mode; - if (mode === 'updated_on') { - $idaa_loc.recovery_meetings.qry__order_by_li = { - priority: 'DESC', sort: 'DESC', updated_on: 'DESC', created_on: 'DESC', name: 'ASC' - }; - } else if (mode === 'name_asc') { - $idaa_loc.recovery_meetings.qry__order_by_li = { - priority: 'DESC', sort: 'DESC', name: 'ASC', updated_on: 'DESC', created_on: 'DESC' - }; - } else if (mode === 'name_desc') { - $idaa_loc.recovery_meetings.qry__order_by_li = { - priority: 'DESC', sort: 'DESC', name: 'DESC', updated_on: 'DESC', created_on: 'DESC' - }; - } +const sort_modes = [ + { mode: 'updated_on', label: 'Last Updated', icon: 'fa-clock', order_by_li: { priority: 'DESC', sort: 'DESC', updated_on: 'DESC', created_on: 'DESC', name: 'ASC' } }, + { mode: 'name_asc', label: 'Name A→Z', icon: 'fa-sort-alpha-down', order_by_li: { priority: 'DESC', sort: 'DESC', name: 'ASC', updated_on: 'DESC', created_on: 'DESC' } }, + { mode: 'name_desc', label: 'Name Z→A', icon: 'fa-sort-alpha-up-alt', order_by_li: { priority: 'DESC', sort: 'DESC', name: 'DESC', updated_on: 'DESC', created_on: 'DESC' } } +]; + +let sort_cycle_idx = $derived.by(() => { + const idx = sort_modes.findIndex(m => m.mode === $idaa_loc.recovery_meetings.qry__order_by); + return idx >= 0 ? idx : 0; +}); +let current_sort = $derived(sort_modes[sort_cycle_idx]); + +function cycle_sort() { + const next = sort_modes[(sort_cycle_idx + 1) % sort_modes.length]; + $idaa_loc.recovery_meetings.qry__order_by = next.mode; + $idaa_loc.recovery_meetings.qry__order_by_li = next.order_by_li; handle_search_trigger(); } @@ -186,9 +187,29 @@ function set_sort_mode(mode: string) { - +
+ class="border-surface-300-700 flex w-full max-w-2xl flex-row flex-wrap items-center justify-center gap-x-4 gap-y-1 border-b p-1"> + + + {#if $idaa_loc.novi_uuid} + + {/if}
@@ -225,7 +246,7 @@ function set_sort_mode(mode: string) { ['IDAA', 'IDAA', 'Open to IDAA members only'], ['Caduceus', 'Caduceus', 'Open to all healthcare workers including those who do not qualify for IDAA'], ['Family Recovery', 'Family Recovery', 'Open to spouses, parents, and children of medical professionals in recovery'] - ] as [val, label, tip]} + ] as [val, label, tip] (val)} {@const active = val === '' ? !$idaa_loc.recovery_meetings.qry__type : $idaa_loc.recovery_meetings.qry__type === val}
- -
- - +
+ +
+ Sort: + +
- -
- Sort: - {#each [ - ['updated_on', 'Last Updated', 'fa-clock'], - ['name_asc', 'Name A–Z', 'fa-sort-alpha-down'], - ['name_desc', 'Name Z–A', 'fa-sort-alpha-up-alt'] - ] as [mode, label, icon]} - {@const active = $idaa_loc.recovery_meetings.qry__order_by === mode} - - {/each} -
+ +
+ Max results: + + + {$idaa_loc.recovery_meetings.qry__limit} + + +
- -
- Max results: - - - {$idaa_loc.recovery_meetings.qry__limit} - - -
+ + {#if $ae_loc.edit_mode && $ae_loc.trusted_access && (!$idaa_loc.recovery_meetings.qry__hidden || $idaa_loc.recovery_meetings.qry__hidden == 'not_hidden')} + + {:else if $ae_loc.trusted_access && $idaa_loc.recovery_meetings.qry__hidden != 'not_hidden'} + + {/if} - + + {#if $ae_loc.edit_mode && $ae_loc.manager_access && (!$idaa_loc.recovery_meetings.qry__enabled || $idaa_loc.recovery_meetings.qry__enabled == 'enabled')} + + {:else if $ae_loc.edit_mode && $ae_loc.manager_access && $idaa_loc.recovery_meetings.qry__enabled != 'enabled'} + + {/if} - - {#if $ae_loc.edit_mode && $ae_loc.trusted_access && (!$idaa_loc.recovery_meetings.qry__hidden || $idaa_loc.recovery_meetings.qry__hidden == 'not_hidden')} - - {:else if $ae_loc.trusted_access && $idaa_loc.recovery_meetings.qry__hidden != 'not_hidden'} - - {/if} + + {#if ($ae_loc.trusted_access && $ae_loc.edit_mode) || $idaa_loc.novi_uuid} + - {:else if $ae_loc.edit_mode && $ae_loc.manager_access && $idaa_loc.recovery_meetings.qry__enabled != 'enabled'} - - {/if} - - - - {#if $idaa_loc.novi_uuid} - - {/if} - - {#if ($ae_loc.trusted_access && $ae_loc.edit_mode) || $idaa_loc.novi_uuid} - - {/if} + goto( + `/idaa/recovery_meetings/${results.event_id}` + ); + } + }) + .catch((error) => { + console.error('Error creating event:', error); + alert('Failed to create new event.'); + }); + }} + class="novi_btn btn-tertiary btn btn-sm preset-tonal-warning + preset-outlined-warning-200-800 hover:preset-filled-warning-200-800 text-xs transition" + disabled={!$ae_loc.authenticated_access}> + Create New Meeting + + {/if} - {#if $ae_loc.edit_mode && $ae_loc.trusted_access} - - {/if} - -
+ + {#if $ae_loc.edit_mode && $ae_loc.trusted_access} + + {/if} +
+