feat: Neighborhood updates, a short post type with "from" and "until" dates
Back to our planProblem
In plain words: some news only matters for a while: a road is closed until Friday, a bank opens next week, a siren is going up in the park this month. Editors need to mark a post as a neighborhood update and say from when until when it applies. The site can then show it while it's current and keep it in the archive afterwards.
Summary of the owner's request (2026-11-02, Claude conversation, text): the website should include things that are going on nearby, in a section suited to that kind of information.
Today (checked):
- Posts (
src/modules/news/cms/posts.ts) have a title, photo, content, related posts, categories, SEO,publishedAt, authors and the review-queue fields. They have no type and no "applies until" date. - Events have one day only (
datewithpickerAppearance: 'dayOnly'), so they can't hold a multi-day closure. - Scheduled publish and unpublish are on for both collections.
Proposed fix
Fields on Posts:
postType: a select, Article (default) or Neighborhood update, in the sidebar.activeFromandactiveUntil:dayAndTimedate fields, shown only for an update (admin.condition).activeFromdefaults to the publish time.activeUntilis required for an update and must be afteractiveFrom(fieldvalidate).
- A short
admin.description: "Shown in Happening now from 'from' until 'until'; it stays on the Updates page afterwards."
What residents see:
- Cards:
PostCardshows an "Update" label and "Until Fri, Nov 8". - The post page: shows "In effect: Nov 3 – Nov 8" in the byline row (the row #571 creates).
- Watch out:
PostCardis used on many pages. Check every page that uses it.
Tags: updates use topics only, per the rule issue. Before the first update, an editor checks the category tree in Admin and adds the topics that are missing, for example "Roads & traffic", "Local businesses" and "Public projects". This is a content step, not code: agents can't create categories.
Data:
- One SQLite migration adds the columns, including the version table. Existing posts become Article.
- Test the migration on a copy of the schema with data.
- Add the fields to the agents' read view so
findreturns them.
Not used: scheduled unpublish as expiry. It would remove the item from the archive. Editors can still schedule an unpublish for something that should vanish completely.
Native first, one line per step:
- Native: Payload
selectanddatefields,admin.condition,validate, a migration. - Official plugins: none needed.
- Open source: none needed.
- Our code: the fields, a mapper change in
src/modules/news/data/mappers.ts, and the card label.
Acceptance criteria
- Not done: In Admin, an editor can create a Neighborhood update with "from" and "until". Saving without "until", or with "until" before "from", is refused with a clear message.
- Not done: Existing posts show as Article and look exactly as before.
- Not done: The migration runs up and down on a copy of the schema with data. The
payload.configtests pass. - Not done: An update's card and page show the label and dates at the six widths (320, 430, 768, 1024, 1280, 1920), light and dark. Contrast meets WCAG AA. Screenshots are in the PR.
- Not done: Search still finds updates. The agents'
findreturnspostType,activeFromandactiveUntil.
Area
cms, frontend
Priority
high
Generated by Claude Code, opens in a new tab