Skip to content
SprecherEast
Issue 580

feat: Neighborhood updates, a short post type with "from" and "until" dates

Back to our plan
Open
enhancementfrontendcmspriority: high

Problem

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 (date with pickerAppearance: '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.
  • activeFrom and activeUntil: dayAndTime date fields, shown only for an update (admin.condition).
    • activeFrom defaults to the publish time.
    • activeUntil is required for an update and must be after activeFrom (field validate).
  • A short admin.description: "Shown in Happening now from 'from' until 'until'; it stays on the Updates page afterwards."

What residents see:

  • Cards: PostCard shows 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: PostCard is 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 find returns 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:

  1. Native: Payload select and date fields, admin.condition, validate, a migration.
  2. Official plugins: none needed.
  3. Open source: none needed.
  4. 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.config tests 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' find returns postType, activeFrom and activeUntil.

Area

cms, frontend

Priority

high


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab