Skip to content

Fix dashboard article status and scheduled-date display - #195

Merged
ssavutu merged 2 commits into
mainfrom
fix/dashboard-scheduled-relative-time
Aug 6, 2026
Merged

Fix dashboard article status and scheduled-date display#195
ssavutu merged 2 commits into
mainfrom
fix/dashboard-scheduled-relative-time

Conversation

@ssavutu

@ssavutu ssavutu commented Aug 6, 2026

Copy link
Copy Markdown
Member

Two fixes to the dashboard's "All Recent Articles" table.

Negative relative times. Scheduled articles showed a negative relative time — e.g. -429m ago for an article going live in about seven hours. timeAgo() assumed every article was already published, so Date.now() - published_date went negative for anything in the future and the sign leaked straight into the label. It now takes the absolute difference and reads the direction off its sign: future dates render in 7h, past dates keep 7h ago, and anything inside the last minute reads just now. An unparseable date falls back to , the same as a missing one.

Lowercase status badges. The badges rendered the raw API value (scheduled, published) while the articles page shows Scheduled / Published / Draft. They're now capitalized to match. RecentArticle.status was also typed "published" | "draft" even though the endpoint returns "scheduled" too; widened.

Frontend typecheck passes.

🤖 Generated with Claude Code

ssavutu and others added 2 commits August 6, 2026 02:02
The dashboard's timeAgo() assumed every article was already published, so a
scheduled article's future date produced a negative minute count and rendered
as "-429m ago". Take the absolute difference and pick the direction from its
sign, and guard an unparseable date the same way a missing one is guarded.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The articles page renders "Published"/"Scheduled"; the dashboard was showing
the raw lowercase API value. Also widens the RecentArticle status type to
include "scheduled", which the endpoint already returns.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ssavutu ssavutu changed the title Show scheduled articles as "in 7h" instead of "-429m ago" Fix dashboard article status and scheduled-date display Aug 6, 2026
@ssavutu
ssavutu merged commit abec16f into main Aug 6, 2026
6 checks passed
@ssavutu
ssavutu deleted the fix/dashboard-scheduled-relative-time branch August 6, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant