fix: mobile-game footer selector + hub teaser honors Boundaries (Codex)

- app.css: the playing-game footer-hide targeted the old footer.site; the shared
  footer is footer.ub-foot now → during a mobile game the footer lingered. Retarget.
- Homepage hub teaser fetched /api/brief without the reader's prefs, so an excluded
  topic could still be featured on /. initPrefs() + append P.param(prefs.data),
  matching the News Brief — boundaries now respected on the hub.

(Nonblocking, noted for later: legacy /?view=… redirects are client-side and drop
unrelated params like UTM.)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
jay
2026-06-28 20:05:36 -04:00
parent 667b1a82c3
commit 03aed9c37d
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -72,5 +72,5 @@ button { font-family: inherit; cursor: pointer; }
/play and always removed on navigation via effect cleanup. Mobile only. */
@media (max-width: 720px) {
html.playing-game, html.playing-game body { overflow: hidden; }
html.playing-game footer.site { display: none; }
html.playing-game footer.ub-foot { display: none; }
}
+5 -1
View File
@@ -1,6 +1,8 @@
<script>
import { onMount } from 'svelte';
import { getJSON } from '$lib/api.js';
import * as P from '$lib/prefs.js';
import { prefs, initPrefs } from '$lib/prefs.svelte.js';
import HubBar from '$lib/components/HubBar.svelte';
import Footer from '$lib/components/Footer.svelte';
@@ -94,6 +96,7 @@
const nextJoy = () => (isNarrow ? railTo(joyIdx + 1) : (joyIdx = (joyIdx + 1) % 3));
onMount(async () => {
initPrefs(); // load the reader's saved boundaries so the teaser honors them (like the News Brief)
try {
const a = await getJSON('/api/art/today');
if (a) art = { title: a.title, artist: a.artist, year: a.date_text, image: a.image_url };
@@ -105,8 +108,9 @@
const hs = localStorage.getItem('goodnews:homeScope') || 'nearby';
if (hv && hs !== 'world') homeq = `&home=${encodeURIComponent(hv)}&scope=${hs}`;
} catch { /* global brief */ }
const q = P.param(prefs.data); // the reader's boundaries (excluded topics, ceilings)
try {
const it = (await getJSON(`/api/brief?limit=1${homeq}`))?.items?.[0];
const it = (await getJSON(`/api/brief?limit=1${homeq}${q ? '&' + q : ''}`))?.items?.[0];
if (it) news = { id: it.id, title: it.title, summary: it.summary || it.description || '', image: it.image_url || null, topic: it.topic || null, source_read_minutes: it.source_read_minutes };
// Photos display full (cover); only wide/tall figures (diagrams) get the framed plate.
if (news?.image) {