Skip to content

feat(studio): Ended (collection rule) badge (#113) - #128

Merged
Madraka merged 2 commits into
mainfrom
feat/issue-113-ended-collection-rule
Oct 25, 2026
Merged

Madraka merged 2 commits into
mainfrom
feat/issue-113-ended-collection-rule

Conversation

@Madraka

@Madraka Madraka commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

What

Closes #113. A published entry whose collection's expiry has passed now shows Ended (collection rule) beside its status, in the collection list and in the entry editor header (RFC-0042 §3.3). Before this, such an entry looked plainly published while the site had already left it out of lists, or answered "not found".

  • endedByRule (apps/studio/src/components/listings/ended-rule.ts) uses the same derivedGate / entryVisibility as the site, so Studio and the site agree. The end is exclusive.
  • The entry's own state comes first. Drafts, embargoed entries and entries whose own "Hide after" has passed get no badge.
  • A translation reads its original's date only while the original is published, as the site does.
  • The badge is a new @cloudhal/ui block, ToggletipBadge: a secondary badge with a 14 px CalendarX icon inside a button.
    • It opens on hover, on keyboard focus and on a press, so a tap opens it on touch screens.
    • The reason is also part of its accessible name.
    • It names the date field, the instant in the site's time zone (grace included; for a date field, the next midnight) and what the site does (unlist or hide).
  • The badge and its listings words load only for collections that have an expiry (lazy chunk).
  • DESIGN.md §2ah and the component table document it.

Verification (local)

  • Studio Vitest: 80 files, 1297 tests pass. ended-collection-rule.test.tsx adds 18: unlist/hide, draft, embargo, own "Hide after", exclusive end, grace, translation with a published or draft original, list and editor, toggletip by keyboard and press.
  • @cloudhal/ui block tests pass.
  • These also pass: pnpm design:lint, the typechecks, pnpm size:check, pnpm drift and the Studio build (bundle 391.0 kB of 420 kB).
  • Screenshots on a local site with an events collection (expiry unlist on endsOn) at 1440 and 390 px, plus pseudo-RTL:
    • The entry that has ended shows "Published" + "Ended (collection rule)"; the upcoming one shows only "Published".
    • The editor header shows the badge.
    • The toggletip opens with the right text.

Review needed

  • Turkish wording: listings.ended.badge is "Sona erdi (koleksiyon kuralı)", and the reason text uses "… zamanında". Turkish is marked reviewed, so please check this wording. The other languages are AI drafts awaiting review, as usual.

Checklist

  • pnpm check and cargo test --workspace pass locally. The Studio and UI suites, design lint, typecheck, size check and drift were run piece by piece; there are no Rust changes. CI runs the full set.
  • Contract change? No contract change; the i18n params.ts was regenerated with pnpm gen and committed.
  • User-visible change in a published package? .changeset/studio-ended-collection-rule.md (@cloudhal/cli patch, Studio ships in the CLI)
  • Commits are signed off (git commit -s, DCO)
  • Docs / AGENTS.md updated if behaviour or commands changed (DESIGN.md §2ah)

🤖 Generated with Claude Code

Madraka and others added 2 commits October 25, 2026 20:36
A Kumo Badge inside a button that opens its reason as a Tooltip on hover,
keyboard focus and a press, so a tap explains it on touch screens where a
tooltip alone never opens. The reason is repeated in the accessible name;
every word is a prop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
A published entry whose collection's expiry has passed shows
"Ended (collection rule)" beside its status in the collection list and the
entry editor header (RFC-0042 §3.3). It uses the site's derivedGate and
entryVisibility, so Studio and the site agree; drafts, embargoed entries and
entries whose own "Hide after" passed get no badge, and a translation reads
its original's date only while the original is published. The toggletip names
the field, the instant in the site's zone and what the site does (unlist or
hide). The badge and its words load only for collections with an expiry.

Closes #113

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
@Madraka
Madraka enabled auto-merge October 25, 2026 17:36
@Madraka
Madraka merged commit 866113a into main Oct 25, 2026
4 checks passed
@Madraka
Madraka deleted the feat/issue-113-ended-collection-rule branch October 25, 2026 17:56
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.

Studio: show "Ended (collection rule)" on entries past an expiry gate (RFC-0042 §3.3)

1 participant