feat(ux): B3.5 + B3.14 — sparkline range picker + shutdown copy
B3.5: settings.sparklineRangeDays (added schema-only in B2b) now drives
the recentCompletions fetch via a reactive effect; new segmented control
in Settings → Tasks lets the user pick 7 / 28 / 90 days. Default 7.
B3.14: /shutdown "Open loops" header softened to "Still here", body
copy updated to remove pressure ("Just naming them helps — nothing to
do here"), truncation tail drops the count. The whole "Still here"
section is now gated by a fresh-start derived flag — when B3.1 lands
and writes reentryFreshStartUntil, this surface auto-suppresses.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -814,6 +814,33 @@
|
||||
}
|
||||
});
|
||||
|
||||
// B3.5 — sparkline range picker. SegmentedButton works on string
|
||||
// options; settings.sparklineRangeDays is the integer 7 / 28 / 90.
|
||||
// Mirror in both directions so changes from either side propagate.
|
||||
let sparklineRangeLabel = $state(
|
||||
settings.sparklineRangeDays === 90
|
||||
? "90 days"
|
||||
: settings.sparklineRangeDays === 28
|
||||
? "28 days"
|
||||
: "7 days",
|
||||
);
|
||||
$effect(() => {
|
||||
const next = sparklineRangeLabel === "90 days" ? 90 : sparklineRangeLabel === "28 days" ? 28 : 7;
|
||||
if (settings.sparklineRangeDays !== next) {
|
||||
settings.sparklineRangeDays = next;
|
||||
}
|
||||
});
|
||||
$effect(() => {
|
||||
const label = settings.sparklineRangeDays === 90
|
||||
? "90 days"
|
||||
: settings.sparklineRangeDays === 28
|
||||
? "28 days"
|
||||
: "7 days";
|
||||
if (sparklineRangeLabel !== label) {
|
||||
sparklineRangeLabel = label;
|
||||
}
|
||||
});
|
||||
|
||||
async function downloadModel(size) {
|
||||
downloadingModel = size;
|
||||
downloadProgress = 0;
|
||||
@@ -1575,8 +1602,29 @@
|
||||
<Toggle
|
||||
bind:checked={settings.showMomentumSparkline}
|
||||
label="Show momentum sparkline"
|
||||
description="A tiny chart of the last 7 days' completion counts, shown on the Tasks header. Never counts against you."
|
||||
description="A tiny chart of recent completion counts, shown on the Tasks header. Never counts against you."
|
||||
/>
|
||||
|
||||
<!-- B3.5 — sparkline range picker. The integer field
|
||||
settings.sparklineRangeDays drives the
|
||||
list_recent_completions_cmd days argument via a
|
||||
reactive effect in completionStats.svelte. The
|
||||
SegmentedButton component works on string options, so
|
||||
we marshal between display labels and the integer
|
||||
the rest of the system expects via a local mirror. -->
|
||||
{#if settings.showMomentumSparkline}
|
||||
<div class="mt-5 pl-1 animate-fade-in">
|
||||
<p class="text-[10px] font-medium text-text-tertiary uppercase tracking-wider mb-2">Sparkline range</p>
|
||||
<SegmentedButton
|
||||
options={["7 days", "28 days", "90 days"]}
|
||||
bind:value={sparklineRangeLabel}
|
||||
size="small"
|
||||
/>
|
||||
<p class="text-[11px] text-text-tertiary mt-2">
|
||||
How far back the sparkline looks. Wider windows show longer-arc trends; the narrower window stays close to right-now.
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user