Skip to content

Let more than one story break at a time - #230

Merged
ssavutu merged 1 commit into
mainfrom
feat/multiple-breaking-and-pinned
Sep 3, 2026
Merged

Let more than one story break at a time#230
ssavutu merged 1 commit into
mainfrom
feat/multiple-breaking-and-pinned

Conversation

@ssavutu

@ssavutu ssavutu commented Sep 3, 2026

Copy link
Copy Markdown
Member

From this morning's Slack: DragonFly went out, the Academy story broke an hour
later, and there was nowhere to put it. The banner shows one story, and pinning
the second would have taken the first one down. Erik asked for both; Audrey's
workaround was to wait a day.

Banner

GetBreakingNewsState now returns every published flagged article, newest
first, capped at 3. The cap is about how long a reader waits for a headline to
come back around on a scrolling banner, not about width.

Backward compatible on purpose. The response keeps enabled, text and
article_slug describing the newest story and adds items beside them:

"breaking_news": {
  "enabled": true,
  "text": "DragonFly story",
  "article_slug": "dragonfly",
  "items": [
    { "text": "DragonFly story", "article_slug": "dragonfly" },
    { "text": "Academy story",   "article_slug": "academy" }
  ]
}

Scalene reads those three fields today (index.astro:19-21), so it keeps
rendering the newest story until it learns about items. No window where the
banner is blank because one repo deployed before the other. The manual banner
is an item too, so a reader can treat items as the whole banner.

Pins

priority is no longer exclusive. The three ClearFeaturedExcept call sites
are gone along with the functions, so nothing takes a pin down on an editor's
behalf. Pinned stories lead the homepage newest-first, up to 3.

Per your call: recency decides the order, the toggle decides what is in the
running. An editor who wants the older story on top unpins the newer one.

Editor UI

Settings lists every story on the banner with a link to each article, since an
editor wondering why their headline is not up needs to see the ones that are.
Both checkbox blurbs now state the cap instead of "only one article can be
featured".

Not in this PR

The public site still renders one banner story and one lead card. Scalene needs
the marquee and the second lead slot before any of this is visible; happy to do
that next.

Verification

go test -p 1 ./... against a real MariaDB 11.8 with CMS_TEST_DSN, so the
integration tests actually ran rather than skipping. Plus go vet, tsc --noEmit, vitest (20), and swag init regenerated.

New tests: banner ordering, banner cap, manual-banner-as-item, settings listing
both stories, pin ordering, pin cap, and the homepage end-to-end with two pins.
The old exclusivity test now asserts the opposite.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L4qBhBdQto1yNp1zP7VLYc

The newsroom hit both limits on the same morning. DragonFly went out, the
Academy story broke an hour later, and there was nowhere to put it: the
banner shows one story, and pinning the second would have taken the first
one down. Erik asked for both, and Audrey's workaround was to wait a day.

Banner: GetBreakingNewsState now returns every published flagged article,
newest first, capped at three. The cap is about how long a reader waits for
a headline to come back around on a scrolling banner, not about width.

The response keeps `enabled`, `text` and `article_slug` describing the
newest story and adds `items` alongside them. Scalene reads those three
fields today, so it goes on rendering the newest story until it learns
about `items` -- no window where the banner is blank because one repo
deployed before the other.

Pins: `priority` is no longer exclusive. The three ClearFeaturedExcept
calls are gone, and with them the functions, so nothing takes a pin down
on an editor's behalf. Pinned stories lead the homepage newest-first, up
to three, and an editor who wants the older one on top unpins the newer.
Recency decides the order; the toggle decides what is in the running.

The homepage splices all of them rather than one, dropping duplicates so a
pinned news story is promoted rather than printed twice, and re-trims to
the block's limit.

Settings lists every story on the banner with a link to each article, since
an editor wondering why their headline is not up needs to see the ones that
are. The two checkbox blurbs say what the caps are.

Tests: the exclusivity test now asserts the opposite, and there are new ones
for banner ordering and its cap, the manual banner as an item, pins ordering
and their cap, and the homepage end-to-end with two pins. Run against a
real MariaDB 11.8 with CMS_TEST_DSN, not just the unit path.

The public site still renders one banner story and one lead card. This is
the CMS half; Scalene needs the marquee and the second lead slot before any
of it is visible.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L4qBhBdQto1yNp1zP7VLYc
@ssavutu
ssavutu merged commit 3d6882d into main Sep 3, 2026
7 checks passed
@ssavutu
ssavutu deleted the feat/multiple-breaking-and-pinned branch September 3, 2026 20:59
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