Update Widgets tab copy to reflect that disabling actually stops polling

The "Hidden" tag, checkbox tooltip, and intro hint previously only described
sidebar visibility, which undersold what disabling now does (scheduler.ts
gates the actual poller on this flag too). Tag is now "Off", tooltips say
"stops polling and hides from the sidebar" / "resumes polling and shows in
the sidebar", and the intro hint spells out both effects plus the immediate
re-poll on re-enable. Bookmarks (no backend poller) gets its own accurate,
narrower wording via a new hasBackendPoller prop on WidgetSection instead of
inheriting a claim that doesn't apply to it.
This commit is contained in:
Claude
2026-07-26 18:50:08 +00:00
parent 2f083feb76
commit 9ca5bf566d
2 changed files with 27 additions and 8 deletions
@@ -3,18 +3,24 @@
// Minimized by default — Weather/Stocks/Bookmarks/PoE2 stacked at full height would
// make the consolidated "Widgets" tab unwieldy as more get added over time. Enabled
// state is independent of expanded state: disabling a widget only hides it from the
// sidebar (see Sidebar.svelte's widgetsEnabled gate), it doesn't stop the admin from
// expanding this section to keep configuring it.
// state is independent of expanded state: disabling a widget hides it from the
// sidebar AND stops its backend poller from making outbound requests (see
// scheduler.ts's widgets.* gate) — it just doesn't stop the admin from expanding
// this section to keep configuring it while it's off.
let {
title,
enabled,
onToggle,
// Weather/Stocks/PoE2 have a backend poller that scheduler.ts gates on this same
// flag (see scheduler.ts); Bookmarks doesn't poll anything, so disabling it only
// ever affects sidebar visibility — the tooltip shouldn't claim otherwise.
hasBackendPoller = true,
children
}: {
title: string;
enabled: boolean;
onToggle: () => void;
hasBackendPoller?: boolean;
children: Snippet;
} = $props();
@@ -26,9 +32,18 @@
<button class="head-btn" onclick={() => (expanded = !expanded)} aria-expanded={expanded}>
<span class="chevron" class:open={expanded}>▸</span>
<span class="title">{title}</span>
{#if !enabled}<span class="disabled-tag">Hidden</span>{/if}
{#if !enabled}<span class="disabled-tag">Off</span>{/if}
</button>
<label class="enable-toggle" title={enabled ? 'Hide from sidebar' : 'Show in sidebar'}>
<label
class="enable-toggle"
title={hasBackendPoller
? enabled
? 'Disable — stops polling and hides from the sidebar'
: 'Enable — resumes polling and shows in the sidebar'
: enabled
? 'Disable — hides from the sidebar'
: 'Enable — shows in the sidebar'}
>
<input type="checkbox" checked={enabled} onchange={onToggle} />
</label>
</div>
@@ -30,8 +30,12 @@
</script>
<p class="hint">
Each widget can be shown or hidden from the sidebar independently. Hiding one only affects
whether it's visible on the site — its own settings and data below keep working either way.
Each widget can be enabled or disabled independently. Disabling Weather, Stocks, or PoE2
hides it from the sidebar <strong>and</strong> stops its backend poller — no more outbound
requests until it's turned back on, at which point it polls again immediately rather than
waiting out its normal schedule. You can still edit a disabled widget's settings below; they
just won't fetch anything new until it's re-enabled. Bookmarks has no poller, so its toggle
only affects sidebar visibility.
</p>
<WidgetSection title="Weather" enabled={widgets.weather} onToggle={() => toggle('weather')}>
@@ -42,7 +46,7 @@
<StocksTab tickers={stockTickers} />
</WidgetSection>
<WidgetSection title="Bookmarks" enabled={widgets.bookmarks} onToggle={() => toggle('bookmarks')}>
<WidgetSection title="Bookmarks" enabled={widgets.bookmarks} onToggle={() => toggle('bookmarks')} hasBackendPoller={false}>
<BookmarksTab {bookmarks} />
</WidgetSection>