Skip to content

[News Archive] Add archive notice to old press releases - #3505

Merged
lvachon1 merged 12 commits into
mainfrom
lev/feat/old_news
Sep 22, 2026
Merged

lvachon1 merged 12 commits into
mainfrom
lev/feat/old_news

Conversation

@lvachon1

@lvachon1 lvachon1 commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Scope

Asana Ticket: 🗞️ 🕸️ Add archive notice to old press releases

Implementation

Added age calculation to news_controller, then used that age to determine if a cta should be shown in news_entry/show.html and what message to show.
Added a little bit of style to match the figma.

Screenshots

Screenshot 2026-09-17 at 2 02 09 PM Screenshot 2026-09-17 at 2 02 19 PM Screenshot 2026-09-17 at 2 02 26 PM Screenshot 2026-09-17 at 2 02 37 PM

How to test

Old entries start at around page 15
Two years is at around page 30
This is our oldest news entry at page 231

Confirm the messages show, and that the year difference calculation is correct.

@lvachon1
lvachon1 marked this pull request as ready for review September 16, 2026 19:52
@lvachon1
lvachon1 requested a review from a team as a code owner September 16, 2026 19:52
@lvachon1
lvachon1 requested a review from joshlarson September 16, 2026 19:52
@smartling-github-connector smartling-github-connector Bot added the Not Ready for Translation Remove this when the PR is approved to trigger a Smartling translation job label Sep 16, 2026

@joshlarson joshlarson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are three layout changes that I think this needs.


First off, there are some differences between the icon in the Figma versus this branch. I suspect that most of them don't really matter, but the Figma shows the icon top-aligned, as opposed to this branch, which shows the icon centered, and I do think that the top-aligned icon looks better. Also, the spacing doesn't look exactly the same, and while I'm not sure this needs to be pixel-perfect, I will say that subjectively, the current icon-text-distance makes the whole thing look a bit cramped.

Branch
Image

Figma
Image

I suspect this will require a change to the <.cta /> component. I don't remember where else that's used, but I bet that any other places it's used will also be enhanced with a top-aligned rather than centered icon.


Second, (also visible in ☝️ screenshots) the Figma shows the banner above the "Posted on" date, while this branch has it below.


Second off, on wider screens, the archive note has a different width than the content below it, which gives it kind of a disjointed feel. Would it be possible to either shrink the notice or widen the content?

Image

… top of the alert. Adjusted the width of the alert to better fit the text at various breakpoints.
@lvachon1
lvachon1 requested a review from joshlarson September 17, 2026 18:27

@joshlarson joshlarson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the banner width, content ordering, and icon alignment comments!

I left a comment about the icon alignment stuff - the current implementation on this branch borks things for other consumers of the <.cta /> component, and we need to fix that before merging this.

Comment thread lib/dotcom_web/components/components.ex Outdated
Comment thread lib/dotcom_web/templates/news_entry/show.html.heex
lvachon1 and others added 3 commits September 21, 2026 15:35
Co-authored-by: Josh Larson <jlarson@mbta.com>
Co-authored-by: Josh Larson <jlarson@mbta.com>

@joshlarson joshlarson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woop!

@lvachon1 lvachon1 removed the Not Ready for Translation Remove this when the PR is approved to trigger a Smartling translation job label Sep 22, 2026
…ws (#3519)

* Translations delivered for PR#3505 on es-LA locale

* Translations delivered for PR#3505 on ht-HT locale

* Translations delivered for PR#3505 on zh-TW locale

* Translations delivered for PR#3505 on pt-BR locale

* Translations delivered for PR#3505 on fr-FR locale

* Translations delivered for PR#3505 on zh-CN locale

* Translations delivered for PR#3505 on vi-VN locale

---------

Co-authored-by: smartling-github-connector[bot] <165276057+smartling-github-connector[bot]@users.noreply.github.com>
@lvachon1
lvachon1 enabled auto-merge (squash) September 22, 2026 18:26
@lvachon1
lvachon1 merged commit 38bf55d into main Sep 22, 2026
20 checks passed
@lvachon1
lvachon1 deleted the lev/feat/old_news branch September 22, 2026 18:37
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.

2 participants