CodeIssuesPull RequestsActionsSecurityInsights
✨ AI
More
Settings

fix(nav+digest): the sun icon stops lying, and the digest spinner deadlock dies #5542

MergedXSccantynz wants to mergefix/theme-toggle-digest-collisionmainopened 6d ago
ccantynzcommented 6d ago

Owner report, verbatim: "how do i change the screen from black to white" → "it activates morning digest which doesnt work either." Two compounding bugs.

1. The nav's sun was a trap. The Morning Digest link wore ☀ — the universal light-mode symbol — while the actual theme toggle for signed-in users hid inside the avatar dropdown. Anyone escaping dark mode clicked straight into /digest. Now: signed-in users get the same always-visible ☾/☀ toggle the signed-out nav has, and the digest link wears a newspaper SVG (matching the inbox bell's icon style). The icon a control wears is a promise.

2. /digest deadlocked into an eternal spinner — the two-sources-of-truth pattern again. The page judges staleness by calendar day; it generated via sendSmartDigest(), which enforces the autopilot's 20-hour cooldown. A digest generated yesterday afternoon left a morning window where the page demanded a refresh the sender silently refused: fire-and-forget no-op → ?generating=1 → spinner → reload → repeat, forever. Each hop also re-fired generation, so once the cooldown DID lapse, duplicate Claude calls raced.

Fix: the page composes directly via a generateDigestNow() helper (a user standing on the page asking for a digest IS the authorization — the cooldown belongs to the push channel), fires exactly once per visit (w=0 only), bounds the spinner at 8 polls (~24s), and past the cap renders whatever exists — yesterday's digest or the empty state — with an honest "taking longer than expected" note. The Regenerate handler is deduped onto the same helper.

Pinned by digest-nav-honesty.test.ts: no sun/moon glyph on any /digest anchor, ≥2 visible toggle links outside the dropdown, no import of the cooldown-gated sender, spinner counter threaded and bounded.

Verified: typecheck clean; digest/layout/nav/visual-coherence suites 49 pass; new pin 4 pass.

ccantynzAI Reviewcommented 6d ago

AI Triage

(no summary)

Priority: medium Risk area: mixed

Suggested labels: (no label suggestions) Suggested reviewers: (no reviewer suggestions)

Suggestions only — nothing has been applied. The PR author stays in control.

gluecron[bot]🤖 botAI Reviewcommented 6d ago

AI review unavailable

The platform's AI balance is exhausted, so AI generation is temporarily unavailable. Nothing was lost. You can queue this as a repair for the internal agent from the repository's Health page, or try again once the balance is restored. The PR is otherwise unchanged.

Cross-repo impact

See what breaks downstream if this PR merges.

Analyze →
⮌ Merged

This pull request was merged into main.

c comment · e edit title · m merge · a approve · r request changes · ? shortcuts