Skip to content

December launch: new News page, Features cleanup, Opinion and Sports fixes - #182

Draft
anthonysantiago-eng wants to merge 135 commits into
mainfrom
december
Draft

anthonysantiago-eng wants to merge 135 commits into
mainfrom
december

Conversation

@anthonysantiago-eng

Copy link
Copy Markdown
Collaborator

Summary

Everything planned for the December launch, in one branch, so it ships as one deploy: the new News page, the Features cleanup, and the Opinion (#181) and Sports (#180) cleanups. Site-wide fixes will land here before it's ready.

This stays a draft until early December. Please merge it with a merge commit, not a squash, so each part's commits stay readable.

What's in it

News (news-page, 20 commits)

  • Curated News page with its own layout editor
  • Student Senate / Executive Board timelines and terms
  • The masthead marks the current section; the News title row is gone
  • "Missed something?" search at the foot of the page
  • Review fixes: News-only layout permissions, atomic layout saves, unsaved-changes guard, full-archive pagination, no story shown twice

Features (features-cleanup, 5 commits, plus 1 on this branch)

  • Removes Upcoming Events and the public event form; /features/submit-event now redirects to /features
  • Removes the Collar City Column
  • One layout for phone, tablet and desktop instead of a hidden mobile copy; a type scale; Photo Spotlight as a swipeable carousel with proper captions
  • On Campus and The Arts only auto-fill stories with a matching kicker
  • No header row, matching News. News's search footer becomes a shared SectionSearchPrompt that both pages use

Opinion: everything from #181 (security, layout persistence, archives, accessibility).

Sports: everything from #180 (scoreboard, editor pins, kicker and caching; sports code reorganised).

Site-wide fixes (still to come on this branch):

  • top bar collides at 1024–1080px
  • accessible names on icon buttons, plus a skip link
  • dark mode follows the system setting
  • the article drop cap
  • the article byline reads like a photo credit
  • the sign-off misses write-in authors

Database and deploy

  • Migrations: three for News (news_page_layout, student_gov_updates, student_gov_terms) and one for Opinion (opinion_layout_singleton). All are in both migrations/ and scripts/run_deploy_sql_migrations.sh.
  • Deploy batches: Opinion is 34; News is 35, 35 and 36. Both branches originally claimed 34.
  • Opinion migration test: run on a copy of a dev database with two duplicate "Opinion Layout" rows added. The newest stays "Opinion Layout", the others become "Archived Opinion Layout #id", the unique index is created, and running the whole script again changes nothing.
  • Event submissions: the collection stays as a read-only archive. create is closed, so Payload's REST endpoint no longer accepts anonymous posts. The two Features SEO fields for the event page are hidden, not dropped. No schema change.

Before merging

  • Site-wide fixes are in
  • Latest main is merged in; CI is green
  • Migrations pass on a fresh database (CI)
  • The deploy SQL is run against a copy of the production database
  • The production build has enough Postgres connections. On a 16-core machine, next build runs about 15 workers, each with Payload's default pool of 10, which can exceed Postgres's default limit of 100 ("too many clients"). If the deploy server has many cores, set a pool max in payload.config.ts first

Testing so far

  • pnpm typecheck and pnpm lint (0 errors); next build --experimental-build-mode=compile
  • Local dev server: home, News, Features, Opinion, Sports, the feed, sitemap, search and archives all load. All four section layout editors open without errors.
  • Features was checked in screenshots at 1440, 1024, 768 and 390px, light and dark.

#181 and #180 are closed in favour of this PR. Their diffs are still there if they're easier to review on their own.

No change to what /sports renders.

- lib/sportsPage.ts loads everything the page needs, replacing 190 lines
  in the shared [section] route. The three schools queries are now one.
- lib/sportsLayout.ts defines the layout JSON once (it was copied in the
  editor, the route, /sports/all and a collection comment) and reads it
  through parseSportsLayout, so a malformed value falls back to its
  default instead of throwing. HEADLINE_COUNT was defined twice.
- lib/troyTime.ts and lib/sidearm.ts replace repeated date formatters and
  fetch options.
- SportsByline, SportsHeading and useScrollEdges replace copies in the
  page, the carousel, the standings card and the score strip.
- Comments: phone scoreboards always use logos; field hockey's Sidearm
  code differs between RPI Athletics and the Liberty League.
- Scoreboard shows only when the lead's game has both scores, so a
  preview story no longer reads "Final". The second below-lead slot
  follows the same rule on the page and in the editor.
- Layout editor loads every pinned story, including ones older than the
  pool or unpublished, marks them, and lets editors remove a pin whose
  story is gone.
- Kicker follows the sport until an editor writes their own, so changing
  the sport no longer leaves the old name. "General" adds no label.
- Scores must be whole numbers.
- /sports/all caches its sport tab counts for a minute instead of loading
  every sports story on each request.
- The schedule looks back only for sports the standings card will show.
- Feed links must be http(s); a blank points cell shows a dash, not NaN.
- section-layout route: drop the unused section argument.
- A story moved to another section drops its sport and game result, so
  it never keeps a hidden sport or scoreboard.
- docs/sports-section.md: /sports/all rendering and tab caching, the
  kicker and scoreboard rules, whole-number scores, unpublished and
  missing pins in the editor, the new lib files, and the Show-override
  gap.
- New `news-page-layout` collection with a custom admin editor
  (NewsLayoutEditor) driving the /news lead and section composition
- New `student-gov-updates` collection for short Senate / Executive Board
  updates; editable by admin, EIC and news-section editors
- /news/senate and /news/executive-board timeline pages (merged with
  articles carrying the matching kicker), plus a Student Government box
  on /news
- Admin sidebar dropdown under "News Layout" for the timeline page
  editors (TimelinePageEditor)
- Footer: optional flush spacing; rule matches the header's line weight
- formatArticle exposes imageAspect from the upload's width/height
- Migrations for both collections in migrations/ and the deploy SQL script
- scripts/seed-news.ts for local placeholder data
…ctions

- StudentGovTerms collection (GM Week to GM Week) with migration in both
  migrations/ and the deploy SQL script
- /news/student-government replaces /news/senate and /news/executive-board
- NewsFeatured, NewsSecondary and topic tabs on the News page; StudentGovShelf
- FitGroup and BalanceColumns for closing blank space on any page
- Seed scripts for terms, topics and the Student Government archive
- docs/news-section.md and docs/fit-text.md
- NewsSearchPrompt: a News-only search (/search?q=…&section=news) and a
  link to past News stories, added below the topic tabs
- The underline turns into the header search's travelling rainbow wave
  while typing and after submitting; stays red without scripts or with
  reduced motion
… title row

The masthead's section link for the page you're on is red with a bar on
the rule. Between sections the bar slides over, and a red copy of the
links cut to the bar's span turns each letter red as the bar passes
under it. From a page outside the sections the bar grows in; reloads and
reduced motion just draw it in place.

With the section marked up top, the News page drops its NEWS | ARCHIVE |
CONTACT row on desktop so the lead headline is above the fold. The title
stays for screen readers, and shows small on mobile (no section links in
the mobile header). Archive and Contact move to the foot, under "Missed
something?".
… strip arrows

- HeaderClient: the active section's bar hangs below the header into the
  sports score strip, which painted over its lower half; it now sits above
  (z-20)
- SportsScoreStrip: the arrow tabs hang 1px past the strip's ends so a
  sliver of the next cell doesn't show at fractional zoom (125%, 175%);
  drops the fade beside the tabs
… first screen

- NewsSecondary: each strip shows its story's photo, cropped square, on the
  right. A News Layout editor switch (secondaryPhotos in the layout JSON,
  missing = on) runs them text only; no schema change
- BalanceColumns: data-balance-fold keeps a photo box short enough that its
  data-balance-fold-end is on the first screen (as wide as the given ratio);
  "reach" options may overshoot when the other column can grow to meet them;
  several flexible boxes in a column share each change
- NewsLead: stacked and overlay photos are held to the fold (down to 2:1,
  flex now 16:9 to 5:4); with the text above or below the photo the column
  scales to 1.25 and the headline and subdeck stop at 48px and 18px
- StudentGovColumn: pinned stories' photos can crop from 3:2 to 2:1 so that
  column can reach the lead's
- Editor's lead crop preview uses 2:1 for stacked layouts
- docs/fit-text.md and docs/news-section.md
…ides and swipes

Terms list (StudentGovTermList), at the foot of both timelines:
- Every covered term, newest first: name, chair, stories and updates on
  the timeline. The four newest show, plus the term on the page if older;
  "Show N earlier terms" opens the rest and moves focus to the first new row
- A table with one header row from 600px (container query), stacked rows
  below. Each row is one link; the term on the page has a red rule and
  "Viewing". Missing chairs show a dash. The foot links the print archive
- Removes the bookshelf (StudentGovShelf, shelfDetails, spine colours and
  sizes, spineFoot) and the frame's sideways-wheel handling for it
- "Shelf" wording out of the 404 and admin copy; the terms collection's
  "On the shelf" checkbox is labelled "Listed" (label only, no migration)

Senate / Executive Board switch (StudentGovBodySwitch), in the photo panel
and the Terms list header:
- Marks the body you're on with a bar, as the masthead marks its section.
  Choosing the other slides the bar over, turning each label as it passes,
  using the masthead's own code, now shared in components/slidingBar.ts
- The page swipes towards the body you're moving to: every on-screen piece
  marked data-swipe slides out, staggered, and the new page's pieces slide
  in (pageSwipe.ts, Web Animations; no frozen page while the next loads).
  The other timeline is fetched in full as soon as the switch is pointed at.
  Reduced motion: nothing moves

docs/news-section.md covers both.
… pass

pnpm applies pnpm-workspace.yaml's esbuild: ^0.25.0 override to direct
dependencies too, so the pinned "0.25.12" in package.json didn't match the
lockfile and pnpm install --frozen-lockfile (CI, deploy) failed. Still
resolves to 0.25.12.
…a carousel

- pageSwipe.ts: nothing moves on the click; once the new page has rendered,
  before it's painted, the photo panel and the stream (data-swipe-chunk)
  each slide across as one block: a copy of the old one goes out one side
  while the new one follows right behind, clipped to the block, on the
  switch bars' timing. data-swipe-keep parts (breadcrumb and switch in the
  panel, the Terms list's switch and rule) stay put. Replaces the
  per-piece data-swipe stagger
- Switching with the Terms list on screen (data-swipe-anchor) opens the new
  page with its Terms list at the same spot, so Next doesn't scroll to the
  top; the panel's month observer counts its first reading at once, and
  picks the last month scrolled past when opened below the months
- Terms list: the "Terms" heading is for screen readers only; the switch
  sits on the right over the rule

docs/news-section.md updated.
The "back to the term in session" link at the top of a past term's stream
was a white book with a hanging Poly P charm, left over from the shelf.
It's now a red text link, "‹ TO 57TH SENATE", set like the Terms list's
"Show N earlier terms" button with its chevron pointing back. The text
underlines and the chevron nudges left on hover (still for reduced
motion). Removes polyP.ts, which only the charm used.
…efore the type

- Strips under the lead: the photo is as tall as the text beside it,
  16:10 at the shortest and square at the tallest, so a short subdeck
  no longer leaves a gap under a tall photo
- BalanceColumns: new `data-balance-art-first` column attribute; when
  that column is the short one, its flexible boxes grow before its type
- News lead column is marked art-first, so the strips' type only grows
  when the lead photo can't (e.g. held to the first screen)
- docs: fit-text.md and news-section.md updated to match
Rewrites scripts/seed-features.ts in the style of the news seed:

- 26 published features articles over the last six weeks, enough to
  fill every slot on /features plus the "More in Features" row
- reuses the four fixture photos from `pnpm db:seed` (the same ones the
  news seed uses) instead of generating flat grey placeholders
- idempotent: articles are matched by slug, so re-running adds nothing
- legacyImport context keeps the backdated dates and skips PostHog
  events and breaking-news pushes
- creates a Features layout when none exists (Arts and Collar City
  pinned, upcoming events, Photo Spotlight); an existing layout is left
  alone

Adds `pnpm db:seed:features` and removes update-features-images.ts,
which only replaced the old grey placeholders with photos downloaded
from picsum.photos.
The events box needed editor upkeep the section can't commit to, and
the Collar City Column has no columnist and too few stories. The
section header now matches News: Features | Archive | Contact.

- page: drop the events box, the "Have something you want to be
  featured?" box (it linked to the event form and split the On-Campus
  list) and the Collar City column; Photo Spotlight spans the middle
  and right columns of the lower row
- layout editor: drop the Events panel and the Collar City column;
  the spotlight spans two columns to match the page
- remove the /features/submit-event page, its API route and form;
  the old URL redirects to /features
- event-submissions stays as a read-only archive (no schema change);
  create is closed so Payload's REST endpoint stops accepting
  anonymous posts
- seo: hide the two submit-event fields (columns kept)
- seed: no events; the Collar City stories get a "Troy" kicker

Saved layouts may still carry events / collarCity keys; they're
ignored, and the next editor save drops them. No migration needed.
- lead column widens (the events box no longer needs 320px) and the
  lead headline goes to 42px on desktop
- right column is labelled Latest, styled like On-Campus; the editor
  calls it Latest too
- On-Campus and Latest get headline-only extras after every editor
  slot is filled, so the side columns end level instead of stopping
  ~560px short of the lead column
- Photo Spotlight spans the lower row in a 16:9 frame with a proper
  caption ("Photo by ... · From <story>"); its heading lines up with
  The Arts, and the two stories under it sit beside their images
- a story the spotlight links to isn't auto-filled into the lists, so
  it isn't shown twice
- the carousel no longer carries its own heading, which removes the
  doubled "Photo Spotlight" on phones
Rebuilds the Features page as a single layout instead of a desktop
grid plus a hidden phone copy. The two had drifted apart, every
heading existed twice, and hidden images still downloaded.

Layout
- the DOM is in phone reading order (lead, Latest, Photo Spotlight,
  On Campus, The Arts); CSS grid areas place the same sections on
  tablet (two columns) and desktop (the existing three)
- tablet gets a real layout: lead across the top, On Campus beside
  Latest, spotlight full width, The Arts and More in Features three
  across. The 768px page goes from ~11,900px to ~4,750px
- phones lead with the lead story, not On Campus. Each section's
  first flagged story gets the big photo; the rest are compact rows
  (headline, 88px thumbnail, hairline dividers). ~8,800px -> ~5,700px
- cards change shape per breakpoint with classes on one element, so
  each image is in the DOM once

Type and labels
- one headline scale: lead 42/36/32, wide story 24, cards 20,
  headline-only and phone rows 18; kickers 13px everywhere; More in
  Features headlines drop from 28px to 20px
- every section uses the same red-rule label (The Arts and Photo
  Spotlight no longer have their own centred style); "On Campus"
  without the hyphen, here and in the editor
- a kicker that repeats its section, or just says "Features", is
  hidden
- summary lines on the lead, the first story of each section and the
  wide story
- dates only in Latest, as short absolute dates ("Nov 14", Eastern
  time so server and browser agree, never split across lines)
- More in Features picks its column count from the number of stories

Photo Spotlight
- a swipeable scroll-snap rail; on phones the next photo peeks in
- prev/next and dots are 44px targets; caption links get a 24px hit
  area; smooth scrolling respects reduced motion

Accessibility and dark mode
- one heading outline: an h2 per section, story headlines h3
- sections are labelled landmarks; the carousel announces its slides
- dark mode: section rules and labels use the accent colour and
  white consistently
Auto-fill took the next story in the pool for every slot, so the On
Campus column listed stories kicked "Collar City Column", "Photo" or
"Events" under an ON CAMPUS label, and The Arts did the same when
unpinned.

- On Campus and The Arts auto-fill only stories whose kicker matches
  (on campus / campus; the arts / arts / music / theatre / film /
  dance) and fill before the lead and Latest, so their stories aren't
  used up elsewhere; editor-pinned slots are untouched
- a topic section with no matching story shows general stories under
  "More Stories" rather than leaving a hole in the grid
- when On Campus has fewer than six stories, the left column carries
  on with a separately labelled "More Stories" run, keeping the
  columns level without mislabelling anything
- a kicker that opens its own headline ("Photo" over "Photo: ...") is
  hidden
- CLAUDE.md: sports `games` array (legacy single-game fields hidden),
  `patches/` directory, `/get-involved` route, unit and Payload CLI test
  commands, the CI CLI check step, and why a conflicting PR shows no CI
- GEMINI.md: resync with CLAUDE.md, which it had drifted behind (iOS shell,
  production warning, full migration rule, push details)
- data-model.md: describe the `games` array and its backfill migration
- architecture.md: section labels link to section pages with an animated
  underline; Sports Continue Reading uses 24px gaps
Brings in the `redirects` collection, its middleware and migration.

Conflict resolution:
- payload.config.ts: December's collections plus Redirects
- migrations/index.ts: December's migrations plus add_redirects, in date
  order (Opinion, redirects, article games)
- run_deploy_sql_migrations.sh: main already deployed add_redirects as
  batch 34, so December's unreleased migrations move up one, as in the
  earlier Opinion/News merge: Opinion 35, News 36/36/37, article games 38.
  The redirects SQL sits between the Opinion and article games blocks.
- CLAUDE.md: keep both the redirects line and the `games` schools line;
  GEMINI.md mirrors it

Verified: lint (0 problems), typecheck, 77 unit tests, 13 Payload CLI
tests, regenerated payload-types.ts unchanged. Fresh DB runs all 59
migrations. The deploy SQL replays cleanly twice on a copy of the
December DB, and the redirects schema matches across both paths.
December adds the Get involved hub, which main's reserved-route list predates. A short link at /get-involved would otherwise shadow it, since middleware runs before routing.
The heading card, meeting box, primary buttons, Copy buttons and news tip
box are now windows onto one fixed photo that stays still as the page
scrolls. Editors pick the photo and set its focus point and zoom per
screen size in the new Get Involved Page global (Pages group), with live
previews; a bundled placeholder is used until a photo is chosen.

The image's `sizes` uses a media condition rather than max(), which
Safari before WebKit bug 304915 ignores, so iPhones and the iOS app
download the full-size file instead of a screen-width one.

Adds the get_involved_page table: TS migration 20261123_000000 and deploy
SQL batch 39.
Bylines across the site follow one convention (docs/bylines.md):
sentence case, "By" everywhere, names in ink at 600 and everything
else muted, no accent colour (red belongs to the kicker), and AP-style
joining without a serial comma ("A, B and C").

- Card names are plain text; a card is one link to its story. Profiles
  are linked from the article header and photofeature hero, where the
  decorative headshots no longer duplicate each name's link.
- Author lists come from one helper (utils/articleAuthors.ts), and an
  unsigned piece is credited to the Editorial Board only when it is a
  staff editorial.
- The article header adds "Photos by" for a featured-image photographer
  who isn't an author, with their job title and headshot.
- Dark mode mixes the muted byline colour toward the background so
  names keep the same contrast step as in light mode.
- Dates follow one set of rules (utils/articleDates.ts), in Troy's time
  zone: "3 hours ago" on home page cards for a week, the publish date on
  a home lead after that, absolute dates on Opinion cards and groups, the
  year on the Sports lead, and dates in the More in News and More in
  Features archives.
- Photo credits are upright at 11px instead of faded italics.
The Features page now opens with FeaturesCover in place of the old lead
and Latest columns: the lead and the two stories under it in the middle,
two photo stories and the "featured" request box on the left, and three
photo stories on the right (the editor's right-hand slots, then the
newest). Every cover story shows its publish date ("Nov 14, 2026").

Below the cover, the Photo Spotlight, On Campus and The Arts keep their
grid, now lined up with the cover's columns. The wide story moves under
the spotlight. The page fetches at depth 2 so photo credits have their
photographers.
Editors can set a photo band in the Features Layout editor: one wide
photo, pinned to the screen so it stays still while the page scrolls
past, between the cover and the sections below it. It's credited
"Photo by Name · Story title ›", with the photographer's profile and the
story linked; the band itself isn't a link.

- The editor's new Photo Band panel picks a media-library photo from a
  story (the image search is now shared with Photo Spotlight) and aims it
  with a click, with a wide preview beside it.
- The layout json stores { mediaId, articleId, focusX, focusY };
  lib/featuresPhotoBand.ts resolves the photo's size, alt text and
  photographer and the story's title and link. No migration: it's a key
  in the existing json, and no band shows until one is chosen.
- The photo covers the whole screen, so it's a large download. PhotoWindow
  gains loadImage, and the band only loads its photo once the reader is
  within about a screen of it.
- Fixes blank story titles in the editor's image search results.
The strips under the News lead showed their subdeck on tablets only; it now shows on phones and desktops too. Updates docs/news-section.md.
The overlay lead's photo no longer darkens when hovered. On phones, where the text sits below the photo, the headline still turns red on hover; from tablet up, where the text is over the photo and stays white, the lead now has no hover change.
Replaces Photo Spotlight, On Campus, The Arts and More in Features under
the cover and photo band with two pieces in the Get involved page's style:

- Browse by section: Around Campus, Arts & Troy, People and Photo Stories
  as desk-list rows (name, summary, count). The open row shows its five
  newest stories and "All N stories", which filters the index below.
  Kickers map to sections in lib/featuresDepartments.ts; a story that
  fits none is never shown under a section's name.
- Every Features story: the whole archive from one light query
  (lib/featuresIndex.ts), filtered by section and semester in the
  browser, grouped by semester, ten at a time with "Show 10 more".
- A thin second band onto the same pinned photo above the index.

The Get involved desk list's accordion moves into useDetailsAccordion so
both lists share it. The editor's On Campus, The Arts and Photo Spotlight
panels are now unused by the page; their keys are ignored.
CI typechecks before it builds, so the gitignored next-env.d.ts that Next generates doesn't exist yet and the Get Involved page's hero.webp import fails to type. A tracked image-types.d.ts references Next's image types directly.
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