Skip to content

Commit cd37b1b

Browse files
committed
Coming soon list, month in review, Common Sense Media and trailer links
- Search > Coming soon: US theatrical releases for the next five months, sorted by fit or date; Want to see adds to the Want to list, kept off Tonight until release - Stats: month in review from the movie-night log, with month stepping - Trailer and Common Sense Media links on the movie page and Quick Swipe card Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G2dLcmvA9SD3LvDambcg9X
1 parent bf9efff commit cd37b1b

11 files changed

Lines changed: 215 additions & 21 deletions

File tree

‎family-movie-night/README.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ Everyone who opens the site shares one space: the same names, ratings and shortl
176176

177177
**Not tonight.** On any movie's page, **Not tonight** hides it from your suggestions for 3 weeks without ruling it out. It applies whenever you're one of the people watching. Hidden movies are listed at the bottom of Tonight with **Bring back**.
178178

179+
**Coming soon** (Search tab): movies opening in US theatres over the next five months, sorted by how well they fit your taste or by date. **Want to see** adds one to your Want to list; it stays off Tonight until its release date.
180+
181+
**Month in review** (top of Stats): for any month since your first logged movie night: how many nights and hours, the most-watched genre, how movies were chosen, movie of the month, biggest letdown (only if it averaged under 3), the movie that split the room, the full list with scores, and how many each person watched. It's built from the movie-night log, since individual ratings aren't dated.
182+
179183
**Stats** (top right of Tonight): how many movie nights and how they were chosen, the best and worst night by score, how closely each pair of people agree (100% = identical stars; each star apart costs 25 points; needs 4 movies both rated), the movie that split you most, family favourites (average 4+), and each person's count, average and top genre. Only star ratings count.
180184

181185
**Score reminder.** Two hours after a movie night is logged, anyone who watched and hasn't scored it sees "How was …?" at the top of Tonight and a dot on History and the Tonight tab. The ✕ dismisses that reminder on that device.
@@ -206,7 +210,7 @@ It is anonymous by construction: the app stores who has voted and how many votes
206210

207211
**Favourites.** An all-time favourite is stored on the person and recorded as watched-and-loved (no stars). It counts double in their taste profile, and the Tonight list looks for movies like it. Adding one never overwrites a rating you gave yourself.
208212

209-
**Movie page extras.** **Trailer** opens the official trailer on YouTube (or a YouTube search when TMDB has none). **Where to watch** shows, for the US: **Free** (free services, usually with ads, or free with a library card such as Kanopy and Hoopla), **Included with** (subscription services), or the stores that rent or sell it. The data comes from JustWatch through TMDB, is refreshed every two weeks and can lag. It says which services carry a movie but not what they charge, so there are no prices in the app; **Compare rental prices** opens JustWatch, which lists them. Service names are shown as text. Add-on channels are folded into the service ("AMC+ Amazon Channel" counts as AMC+).
213+
**Movie page extras.** On a movie's page and on the Quick Swipe card: **Trailer** opens the official trailer on YouTube (or a YouTube search when TMDB has none), and **Common Sense Media** opens their search for the title, for age guidance. **Where to watch** shows, for the US: **Free** (free services, usually with ads, or free with a library card such as Kanopy and Hoopla), **Included with** (subscription services), or the stores that rent or sell it. The data comes from JustWatch through TMDB, is refreshed every two weeks and can lag. It says which services carry a movie but not what they charge, so there are no prices in the app; **Compare rental prices** opens JustWatch, which lists them. Service names are shown as text. Add-on channels are folded into the service ("AMC+ Amazon Channel" counts as AMC+).
210214

211215
**Number keys.** On a computer, on the Quick Swipe card and on a movie's page: **1–5** sets that many stars, the **same key again** takes half a star off (4, 4 → 3½), **0** clears the stars. On Quick Swipe the arrow keys answer for movies you haven't watched: **←** Want to, **↓** Don't care, **→** No thanks (each saves and moves on; they're off once stars are set). **Delete** is undo: it takes back stars you just set, or with none set, goes back to the previous movie and removes its rating (same as the Undo button). **Enter** on Quick Swipe goes to the next movie: with 3 stars or more it saves the movie as "would watch again", with 2½ or fewer as plain watched, and with no stars it skips. On a movie's page, Enter saves what's selected. Keys are ignored while you're typing in a search box.
212216

@@ -289,6 +293,7 @@ groups/family/movies/{tmdbId} ← one document per movie anyone has rate
289293
crew: [ { id: 1, name: "Robert Zemeckis", role: "director" }, … ], // director(s) + up to 2 writers
290294
imdb: "tt0088763",
291295
rt: null, mc: 88, // Rotten Tomatoes and Metacritic scores, 0–100 or null
296+
release: "2017-11-22", // release date; a wanted movie stays off Tonight until then
292297
scored: 2, // critic-score lookup done (version number)
293298
watch: { v: 2, at: 1795700000000, // US availability, and when it was checked
294299
on: [ { name: "Disney+" } ], // included with a subscription

‎family-movie-night/src/App.jsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export default function App() {
197197
{tab === 'tonight' && <Tonight entries={entries} members={members} me={me} away={away} onToggleAway={toggleAway} shortlist={shortlist} onShortlist={(list) => store.setShortlist(list)} vote={vote} voting={voting} history={history} onSnooze={(memberId, movie, until) => store.snooze(memberId, String(movie.id), until)} onWatch={logWatched} onRemoveHistory={(id) => store.removeHistory(id)} onOpen={setOpen} onRate={() => go('rate')} />}
198198
{tab === 'rate' && <Rate key={me} entries={entries} me={me} onRate={rate} />}
199199
{tab === 'ask' && <Ask entries={entries} members={members} me={me} present={present} onTogglePresent={toggleAway} shortlist={shortlist} onShortlist={(list) => store.setShortlist(list)} onOpen={setOpen} />}
200-
{tab === 'search' && <Browse entries={entries} members={members} onOpen={setOpen} />}
200+
{tab === 'search' && <Browse entries={entries} members={members} me={me} onWant={(m, on) => rate(m, on ? { status: 'unseen', stars: null } : null)} onOpen={setOpen} />}
201201
{tab === 'mine' && <Mine entries={entries} members={members} me={me} onWant={(m) => rate(m, { status: 'unseen', stars: null })} onPass={(m) => rate(m, { status: 'pass', stars: null })} favorites={favorites} onAddFavorite={addFavorite} onRemoveFavorite={removeFavorite} onOpen={setOpen} onRate={() => go('rate')} />}
202202
</>
203203
)}

‎family-movie-night/src/components/Browse.jsx‎

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,36 @@
1-
import { useEffect, useState } from 'react';
2-
import { ArrowLeft, Search, X } from 'lucide-react';
1+
import { useEffect, useMemo, useState } from 'react';
2+
import { ArrowLeft, Check, Plus, Search, X } from 'lucide-react';
33
import { hasTmdb } from '../lib/config.js';
4-
import { filmography, searchMovies, searchPeople } from '../lib/tmdb.js';
4+
import { comingSoon, filmography, searchMovies, searchPeople } from '../lib/tmdb.js';
5+
import { predictStars, tasteProfile } from '../lib/suggest.js';
56
import { MemberDots, MovieRow, Notice } from './ui.jsx';
67

7-
const MODES = [['movies', 'Movies'], ['people', 'Directors']];
8+
const MODES = [['movies', 'Movies'], ['people', 'Directors'], ['soon', 'Coming soon']];
9+
const opens = (date) => new Date(`${date}T12:00:00`).toLocaleDateString(undefined, { month: 'short', day: 'numeric' });
810

911
/** Find one specific movie, or look up a director (or writer) and browse what they made. */
10-
export default function Browse({ entries, members, onOpen }) {
12+
export default function Browse({ entries, members, me, onWant, onOpen }) {
1113
const [mode, setMode] = useState('movies');
1214
const [query, setQuery] = useState('');
1315
const [results, setResults] = useState([]);
1416
const [state, setState] = useState('idle'); // idle | loading | ready | error
1517
const [error, setError] = useState('');
18+
const [soon, setSoon] = useState({ state: 'idle', list: [] }); // movies opening in theatres soon
19+
const [soonSort, setSoonSort] = useState('fit'); // fit | date
1620
const [person, setPerson] = useState(null); // the chosen director, with { directed, written } once loaded
1721

1822
useEffect(() => {
23+
if (mode !== 'soon' || soon.state !== 'idle') return;
24+
setSoon({ state: 'loading', list: [] });
25+
comingSoon().then((list) => setSoon({ state: 'ready', list })).catch((e) => setSoon({ state: 'error', list: [], error: e.message }));
26+
}, [mode]); // eslint-disable-line react-hooks/exhaustive-deps
27+
const taste = useMemo(() => tasteProfile(entries, me), [entries, me]);
28+
const upcoming = useMemo(() => soon.list
29+
.map((movie) => ({ movie, fit: Math.round(predictStars(taste, movie) * 20) }))
30+
.sort((a, b) => (soonSort === 'date' ? a.movie.release.localeCompare(b.movie.release) : b.fit - a.fit))) // ties keep TMDB's order: most anticipated first, [soon.list, taste, soonSort]);
31+
32+
useEffect(() => {
33+
if (mode === 'soon') return undefined;
1934
const q = query.trim();
2035
if (!q) { setState('idle'); setResults([]); return undefined; }
2136
let live = true;
@@ -71,12 +86,39 @@ export default function Browse({ entries, members, onOpen }) {
7186

7287
return (
7388
<div className="flex flex-col gap-4">
74-
<div className="grid grid-cols-2 gap-1 rounded-full bg-seat p-1" role="tablist" aria-label="Search for">
89+
<div className="grid grid-cols-3 gap-1 rounded-full bg-seat p-1" role="tablist" aria-label="Search for">
7590
{MODES.map(([id, label]) => (
7691
<button key={id} type="button" role="tab" aria-selected={mode === id} onClick={() => switchMode(id)} className={`rounded-full py-2 text-sm font-bold transition ${mode === id ? 'bg-gold text-house' : 'text-dim hover:text-cream'}`}>{label}</button>
7792
))}
7893
</div>
7994

95+
{mode === 'soon' && (
96+
<section className="flex flex-col gap-3">
97+
<div className="flex flex-wrap items-end justify-between gap-2">
98+
<p className="text-sm text-dim">Opening in US theatres over the next five months. Tap <span className="font-bold text-cream">Want to see</span> and it joins your Want to list, then shows up on Tonight once it's out.</p>
99+
<div className="flex gap-2" role="group" aria-label="Sort by">
100+
{[['fit', 'Best fit for me'], ['date', 'Soonest']].map(([key, label]) => <button key={key} type="button" aria-pressed={soonSort === key} onClick={() => setSoonSort(key)} className={`rounded-full border px-3 py-1.5 text-sm font-bold ${soonSort === key ? 'border-gold bg-gold text-house' : 'border-aisle text-cream'}`}>{label}</button>)}
101+
</div>
102+
</div>
103+
{!hasTmdb && <Notice>Coming soon needs the TMDB key.</Notice>}
104+
{soon.state === 'loading' && <p className="py-10 text-center text-sm text-dim">Finding what's coming…</p>}
105+
{soon.state === 'error' && <Notice>{soon.error}</Notice>}
106+
{soon.state === 'ready' && hasTmdb && upcoming.length === 0 && <p className="py-10 text-center text-sm text-dim">Nothing announced yet.</p>}
107+
<ol className="-mx-2 flex flex-col divide-y divide-aisle/60 lg:grid lg:grid-cols-2 lg:gap-x-8 lg:divide-y-0">
108+
{upcoming.map(({ movie, fit }) => {
109+
const mine = entries[movie.id]?.ratings?.[me];
110+
const wanted = mine?.status === 'unseen';
111+
return (
112+
<MovieRow key={movie.id} movie={entries[movie.id]?.movie || movie} onOpen={onOpen}
113+
note={<span><span className="font-bold text-gold">Opens {opens(movie.release)}</span>{taste.genres.length ? ` · ${fit}% your kind of movie` : ''}</span>}
114+
action={<button type="button" onClick={() => onWant(movie, !wanted)} aria-pressed={wanted} className={`mr-1 inline-flex shrink-0 items-center gap-1 rounded-full border px-3 py-1.5 text-xs font-bold ${wanted ? 'border-gold bg-gold text-house' : 'border-aisle text-cream'}`}>{wanted ? <><Check size={13} /> Wanted</> : <><Plus size={13} /> Want to see</>}</button>} />
115+
);
116+
})}
117+
</ol>
118+
</section>
119+
)}
120+
121+
{mode !== 'soon' && <>
80122
<div className="relative">
81123
<Search size={18} className="pointer-events-none absolute left-3.5 top-1/2 -translate-y-1/2 text-dim" />
82124
<input id="movie-search" type="search" autoComplete="off" value={query} onChange={(e) => setQuery(e.target.value)} placeholder={mode === 'people' ? 'Search a director or writer' : hasTmdb ? 'Search any movie' : 'Search 150 built-in movies'} aria-label={mode === 'people' ? 'Search directors and writers' : 'Search movies'} className="w-full rounded-full border border-aisle bg-seat py-3 pl-11 pr-10 text-cream placeholder:text-dim focus:border-gold focus:outline-none" />
@@ -106,6 +148,7 @@ export default function Browse({ entries, members, onOpen }) {
106148
))}
107149
</ul>
108150
)}
151+
</>}
109152
</div>
110153
);
111154
}

‎family-movie-night/src/components/Rate.jsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { useEffect, useMemo, useRef, useState } from 'react';
22
import { ChevronDown, SlidersHorizontal, Undo2 } from 'lucide-react';
33
import { hasTmdb, pref } from '../lib/config.js';
4-
import { enrich, ERAS, GENRE_CHOICES, topOfYear, yearsFor } from '../lib/tmdb.js';
4+
import { enrich, ERAS, GENRE_CHOICES, topOfYear, trailerUrl, yearsFor } from '../lib/tmdb.js';
55
import Rank from './Rank.jsx';
6-
import { CertBadge, Chip, directedBy, NOT_WATCHED, Notice, Poster, ScoreBadge, StarRating, STATUS, TitleLink, KeyHint, useStarKeys } from './ui.jsx';
6+
import { CertBadge, Chip, directedBy, NOT_WATCHED, Notice, Poster, ScoreBadge, StarRating, STATUS, TitleLink, KeyHint, MovieLinks, useStarKeys } from './ui.jsx';
77

88
const PER_YEAR = [5, 10, 20];
99
// Arrow keys for the three "haven't watched it" answers, laid out like the buttons: left, middle, right.
@@ -170,6 +170,7 @@ function QuickSwipe({ entries, me, onRate }) {
170170
<span className="tabular-nums">#{position} of {movies.length}</span>
171171
</div>
172172
<div className="text-xs text-dim">{[movie.genres?.slice(0, 3).join(' · '), directedBy(movie)].filter(Boolean).join(' · ')}</div>
173+
<MovieLinks movie={movie} trailer={trailerUrl(movie)} className="mt-1.5 justify-center" />
173174
</div>
174175

175176
<div className="flex w-full flex-col items-center gap-3 rounded-xl bg-seat p-4">

‎family-movie-night/src/components/RateSheet.jsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { useEffect, useState } from 'react';
2-
import { Check, Clock, Play, Plus, X } from 'lucide-react';
2+
import { Check, Clock, Plus, X } from 'lucide-react';
33
import { shownStars } from '../lib/suggest.js';
44
import { enrich, pricesUrl, trailerUrl } from '../lib/tmdb.js';
55

66
const SNOOZE = 21 * 24 * 60 * 60 * 1000; // "not tonight" hides a movie for three weeks
77
const day = (ms) => new Date(ms).toLocaleDateString(undefined, { month: 'short', day: 'numeric' });
8-
import { Avatar, CertBadge, directedBy, formatRuntime, ScoreBadge, NOT_WATCHED, Poster, StarRating, STATUS, StatusStub, TitleLink, KeyHint, useStarKeys } from './ui.jsx';
8+
import { Avatar, CertBadge, directedBy, formatRuntime, ScoreBadge, NOT_WATCHED, Poster, StarRating, STATUS, StatusStub, TitleLink, KeyHint, MovieLinks, useStarKeys } from './ui.jsx';
99

1010
/** Bottom sheet: movie details, your rating, the shortlist toggle, and what everyone else said. */
1111
export default function RateSheet({ movie: initial, entry, members, me, listed, snoozedUntil, onSnooze, onToggleListed, onWatched, onSave, onClose }) {
@@ -48,7 +48,7 @@ export default function RateSheet({ movie: initial, entry, members, me, listed,
4848
</div>
4949
<div className="flex flex-wrap items-center gap-2">
5050
<ScoreBadge movie={movie} size="lg" />
51-
<a href={trailerUrl(movie)} target="_blank" rel="noopener noreferrer" className="inline-flex items-center gap-1 rounded-full border border-aisle px-2.5 py-1 text-xs font-bold text-cream hover:border-dim"><Play size={12} fill="currentColor" /> Trailer</a>
51+
<MovieLinks movie={movie} trailer={trailerUrl(movie)} />
5252
</div>
5353
<div className="flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-dim">
5454
{movie.year && <span className="tabular-nums">{movie.year}</span>}

0 commit comments

Comments
 (0)