Skip to content

fix(changelog): always render newest entries on top; align seed dates; announce the widget - #202

Merged
obvious-autobuild-staging[bot] merged 3 commits into
masterfrom
feat/changelog-ordering
Sep 7, 2026
Merged

obvious-autobuild-staging[bot] merged 3 commits into
masterfrom
feat/changelog-ordering

Conversation

@obvious-autobuild-staging

Copy link
Copy Markdown
Contributor

Why

The changelog popout shipped in #201 renders entries in stored-array order with no sort, and the seed dates contradict id order: "Edit the JSON output in place" (id 4, dated 2026-09-03) displayed above "Pastes land where they belong" (id 3, dated 2026-09-05), so the visible dates jumped 09-05 → 09-03 → 09-05 → 09-04 and read as a misordered list. Nothing stopped a future out-of-order append from silently reshuffling the display.

What

How to Review

  • app/src/changelog/entries.tsnewestFirst() helper, entry 6, the date fix.
  • app/src/changelog/ChangelogButton.tsx — the only render-path change (3 lines).
  • Ordering is locked by tests at two levels: schema tests (unique ids, newestFirst() sorts any input, dates non-increasing in rendered order) and a component test that mocks the bundle module to a scrambled order with a future entry spliced mid-array, proving an out-of-order append still renders on top and drives the unseen dot.
  • No PHP changes; the shim suites are untouched and run in CI.

Acceptance

  • Popout rows strictly newest-id-first; dates agree with rendered order — schema test + live DOM check.
  • Entry 6 renders on top with tag "new".
  • An out-of-order append cannot break the order — test-proven.
  • 351/351 Vitest (347 baseline + 4 new), lint, tsc, production build with app/dist parity, and verify-seo.sh green locally.
  • Dogfood screenshot recorded via qa-evidence-upload against tested head SHA 147d952.

Test Evidence

  • Live dogfood on the dev server with headless Chrome: popout headings render Introducing the changelog → Icons match the design → Edit the JSON output in place → Pastes land where they belong → A calmer empty state → Smarter number handling; relative dates read today → 2 days ago ×3 → 3 days ago ×2. Screenshot uploaded as tc-1 evidence (fl_jAtgVTRd).
  • verify-shim.sh was not run locally (no PHP in the sandbox; zero PHP files touched) — CI's PHP job covers it.

🔗 Obvious Project · 🧵 Obvious Thread

…rder; align seed dates with real ship dates

Rendering now goes through newestFirst() — a defensive sorted copy — so
the newest id is always on top even if a future entry is appended out of
order. Entry 4's date is corrected to its real ship date (PR #198 merged
2026-09-05), so displayed dates no longer jump backwards mid-list.

Schema tests now lock id uniqueness, newestFirst ordering, and
non-increasing dates down the rendered list; component tests prove an
out-of-order append cannot reshuffle the popout.
Entry 6 — "Introducing the changelog" (tag: new, dated the widget's ship
date) — renders on top and re-lights the unseen dot for returning
visitors, the intended announcement mechanism. First dogfood of the
add-an-entry authoring convention in .obvious/obvious.md.
@obvious-autobuild-staging
obvious-autobuild-staging Bot marked this pull request as ready for review September 7, 2026 19:41

@obvious-autobuild-staging obvious-autobuild-staging Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obvious PR Review

Verdict: COMMENT — no blocking findings. 0 Blocker · 0 High · 0 Medium · 2 Suggestions.

Reviewed the full canonical patch at 147d952, with all gates re-run in an isolated worktree:

  • Verified green: vitest 351/351 (26 files), eslint, tsc -b --noEmit, production build — committed app/dist is byte-identical to a fresh build — and verify-seo.sh passed.
  • Dates cross-checked against merge history: entry 4's correction to 2026-09-05 matches #198's actual squash-merge (2026-09-05T19:03Z); entry 6's 2026-09-07 matches #201. Rendered dates now agree with id order, and the new schema test turns any future out-of-order seed date into a CI failure.
  • Ordering: newestFirst() derives render order from ids — the same source of truth as the unseen-dot logic — and the new ordering test scrambles the real bundle to prove it. A consumer scan confirms nothing else depends on authoring order.

Suggestions (non-blocking)

  1. (hygiene) .obvious/obvious.md still describes the bundle as "newest first" — a one-line note that render order is now enforced by newestFirst() (authoring order free) keeps the repo guidance accurate for future contributors.
  2. (hygiene) app/src/changelog/ChangelogButton.test.tsx:15NEWEST_ID is hand-bumped per seed entry (5→6 in this PR). Deriving it via Math.max(...changelogEntries.map(e => e.id)) removes the recurring per-entry tax and cannot go stale.

View full review in Obvious

…ve test ids from the bundle

Review-hygiene fixes from the automated review (non-blocking, both taken):
- .obvious/obvious.md no longer describes the bundle as "newest first" —
  render order is enforced by newestFirst(); authoring order is free.
- ChangelogButton.test.tsx derives NEWEST_ID and the expected rendered
  id list from the bundle via newestFirst(), so future entries never
  require hand-bumping these tests.
@obvious-autobuild-staging

Copy link
Copy Markdown
Contributor Author

Replying to this comment

Both suggestions taken in d8f5c8f:

  1. .obvious/obvious.md now states render order is enforced by newestFirst() with authoring order free (newest-first authoring kept as convention), plus the dates-agree-with-id-order rule.
  2. NEWEST_ID and the expected rendered id list in ChangelogButton.test.tsx are now derived from the bundle (Math.max + newestFirst), so adding an entry never means bumping these tests.

Lint/typecheck/351 tests green; CI re-running on the new head.

@obvious-autobuild-staging obvious-autobuild-staging Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obvious PR Review — Pass 2 (d8f5c8f)

No findings — clean pass.

The incremental delta (docs(changelog): align repo guidance with enforced render order; derive test ids from the bundle) resolves both pass-1 Suggestions, and nothing new was introduced:

  • .obvious/obvious.md now documents the enforced render contract — order comes from newestFirst(), authoring order is free but newest-first by convention, and seed dates must agree with id order (schema-tested).
  • ChangelogButton.test.tsx now derives NEWEST_ID from the bundle via Math.max(...) and asserts popout order against newestFirst(changelogEntries) instead of the hardcoded [6,5,4,3,2,1]. The order-regression guard stays in the scrambling ordering test with its literal expectation, so no coverage was lost.

Re-verified at d8f5c8f in an isolated worktree: vitest 351/351 (26 files), eslint clean, tsc -b --noEmit clean, production build with byte-identical committed app/dist, and verify-seo.sh passed.

View full review in Obvious

@obvious-autobuild-staging

Copy link
Copy Markdown
Contributor Author

Replying to this comment

Thanks — clean pass acknowledged. Both pass-1 suggestions landed in d8f5c8f as described; proceeding to merge on green.

@obvious-autobuild-staging
obvious-autobuild-staging Bot merged commit 4571239 into master Sep 7, 2026
3 checks passed
@obvious-autobuild-staging
obvious-autobuild-staging Bot deleted the feat/changelog-ordering branch September 7, 2026 19:54
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