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());
|
||||
|
||||
function sourceNames(ids: string[]) {
|
||||
return ids.map((id) => sources.find((s) => s.id === id)?.name).filter(Boolean).join(', ') || 'No sources assigned';
|
||||
}
|
||||
|
||||
async function handleAdd() {
|
||||
if (!newEvent.name) return;
|
||||
const created = await addEvent({
|
||||
@@ -48,13 +44,6 @@
|
||||
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) {
|
||||
await deleteEvent(id);
|
||||
events = events.filter((e) => e.id !== id);
|
||||
@@ -203,7 +192,7 @@
|
||||
<div>
|
||||
<div class="name">{event.name}</div>
|
||||
<div class="sub">
|
||||
{sourceNames(event.sourceIds)}
|
||||
{event.sourceIds.length} source{event.sourceIds.length === 1 ? '' : 's'} active
|
||||
{#if event.keywords.length > 0}
|
||||
· matching {event.keywords.map((k) => `"${k}"`).join(', ')}
|
||||
{/if}
|
||||
@@ -211,10 +200,6 @@
|
||||
{event.recapIntervalHours === null ? 'no recaps' : `recap every ${event.recapIntervalHours}h`}
|
||||
</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">
|
||||
{event.active ? 'Active' : 'Paused'}
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user