Move More>> toggle to edit-only, show source count instead of names in list
The row view now shows "N sources active" instead of listing every attached source's name, and the "More »" spillover checkbox only appears in the edit panel — it's no longer duplicated inline on every row.
This commit is contained in:
@@ -23,10 +23,6 @@
|
|||||||
}
|
}
|
||||||
let editForm = $state(emptyEditForm());
|
let editForm = $state(emptyEditForm());
|
||||||
|
|
||||||
function sourceNames(ids: string[]) {
|
|
||||||
return ids.map((id) => sources.find((s) => s.id === id)?.name).filter(Boolean).join(', ') || 'No sources assigned';
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleAdd() {
|
async function handleAdd() {
|
||||||
if (!newEvent.name) return;
|
if (!newEvent.name) return;
|
||||||
const created = await addEvent({
|
const created = await addEvent({
|
||||||
@@ -48,13 +44,6 @@
|
|||||||
events = events.map((e) => (e.id === event.id ? updated : e));
|
events = events.map((e) => (e.id === event.id ? updated : e));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Same "More »" collapse as Category.isSpillover (see MergeTab.svelte) — an item
|
|
||||||
// marked here loses its own top-nav tab and shows up on /more instead.
|
|
||||||
async function toggleSpillover(event: AdminTrackedEvent) {
|
|
||||||
const updated = await updateEvent(event.id, { isSpillover: !event.isSpillover });
|
|
||||||
events = events.map((e) => (e.id === event.id ? updated : e));
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleDelete(id: string) {
|
async function handleDelete(id: string) {
|
||||||
await deleteEvent(id);
|
await deleteEvent(id);
|
||||||
events = events.filter((e) => e.id !== id);
|
events = events.filter((e) => e.id !== id);
|
||||||
@@ -203,7 +192,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="name">{event.name}</div>
|
<div class="name">{event.name}</div>
|
||||||
<div class="sub">
|
<div class="sub">
|
||||||
{sourceNames(event.sourceIds)}
|
{event.sourceIds.length} source{event.sourceIds.length === 1 ? '' : 's'} active
|
||||||
{#if event.keywords.length > 0}
|
{#if event.keywords.length > 0}
|
||||||
· matching {event.keywords.map((k) => `"${k}"`).join(', ')}
|
· matching {event.keywords.map((k) => `"${k}"`).join(', ')}
|
||||||
{/if}
|
{/if}
|
||||||
@@ -211,10 +200,6 @@
|
|||||||
{event.recapIntervalHours === null ? 'no recaps' : `recap every ${event.recapIntervalHours}h`}
|
{event.recapIntervalHours === null ? 'no recaps' : `recap every ${event.recapIntervalHours}h`}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<label class="spillover-toggle">
|
|
||||||
<input type="checkbox" checked={event.isSpillover} onchange={() => toggleSpillover(event)} />
|
|
||||||
More
|
|
||||||
</label>
|
|
||||||
<span class="badge" class:active={event.active} onclick={() => toggleActive(event)} role="button" tabindex="0">
|
<span class="badge" class:active={event.active} onclick={() => toggleActive(event)} role="button" tabindex="0">
|
||||||
{event.active ? 'Active' : 'Paused'}
|
{event.active ? 'Active' : 'Paused'}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user