Let more than one story break at a time - #230
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
GetBreakingNewsStatenow returns every published flagged article, newestfirst, 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,textandarticle_slugdescribing the newest story and addsitemsbeside them:Scalene reads those three fields today (
index.astro:19-21), so it keepsrendering the newest story until it learns about
items. No window where thebanner is blank because one repo deployed before the other. The manual banner
is an item too, so a reader can treat
itemsas the whole banner.Pins
priorityis no longer exclusive. The threeClearFeaturedExceptcall sitesare 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 withCMS_TEST_DSN, so theintegration tests actually ran rather than skipping. Plus
go vet,tsc --noEmit, vitest (20), andswag initregenerated.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