fix(ui): grupuj changelog po miesiacu, zdejmij naglowek z Sites

Changelog: 17 sierpniowych wpisow drukowalo "AUGUST 2026" 17 razy, bo naglowek szedl
przy KAZDYM wpisie. Teraz wpisy sa laczone w grupy miesieczne (sa juz newest-first,
wiec wystarczy sklejac kolejne z tym samym `date`), naglowek leci raz na grupe.

Sites: usuniety tytul "SITES" + licznik i podpowiedz "tap a tube -> newest scenes".
Byl jedynym ekranem-zakladka z wlasnym naglowkiem, przez co jego tresc zaczynala sie
nizej niz na pozostalych. Martwe style (headerRow/headerLabel/headerCount/hint) wyciete.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
goon-foss 2026-08-18 12:23:04 +02:00
parent 17e4ecaa8a
commit 576058497a
3 changed files with 26 additions and 27 deletions

View file

@ -16,6 +16,14 @@ export type ChangelogEntry = {
}; };
export const CHANGELOG: ChangelogEntry[] = [ export const CHANGELOG: ChangelogEntry[] = [
{
id: '2026-08-18f',
date: 'August 2026',
items: [
'This list now shows the month once per group instead of repeating it above every single entry.',
'Sites: dropped the redundant title and hint line, so the list starts right where the other tabs do.',
],
},
{ {
id: '2026-08-18e', id: '2026-08-18e',
date: 'August 2026', date: 'August 2026',

View file

@ -8,7 +8,6 @@ import React from 'react';
import { Modal, Pressable, ScrollView, StyleSheet, Text, View } from 'react-native'; import { Modal, Pressable, ScrollView, StyleSheet, Text, View } from 'react-native';
import { import {
CHANGELOG,
NEWEST_CHANGELOG_ID, NEWEST_CHANGELOG_ID,
unseenEntries, unseenEntries,
type ChangelogEntry, type ChangelogEntry,
@ -48,6 +47,19 @@ export function WhatsNewModal() {
if (NEWEST_CHANGELOG_ID) setLastSeenChangelog(NEWEST_CHANGELOG_ID).catch(() => {}); if (NEWEST_CHANGELOG_ID) setLastSeenChangelog(NEWEST_CHANGELOG_ID).catch(() => {});
}, []); }, []);
// Nagłówek miesiąca RAZ na grupę, nie przy każdym wpisie. Wcześniej 17 sierpniowych
// wpisów drukowało „AUGUST 2026" 17 razy (zgłoszenie 2026-08-18). Wpisy są już
// newest-first, więc kolejne z tym samym `date` po prostu doklejamy do bieżącej grupy.
const months = React.useMemo(() => {
const out: { date: string; items: string[] }[] = [];
for (const e of entries) {
const last = out[out.length - 1];
if (last && last.date === e.date) last.items.push(...e.items);
else out.push({ date: e.date, items: [...e.items] });
}
return out;
}, [entries]);
if (!visible || entries.length === 0) return null; if (!visible || entries.length === 0) return null;
return ( return (
@ -56,10 +68,10 @@ export function WhatsNewModal() {
<View style={styles.card}> <View style={styles.card}>
<Text style={styles.title}>What's new</Text> <Text style={styles.title}>What's new</Text>
<ScrollView style={styles.scroll} contentContainerStyle={{ paddingBottom: 4 }}> <ScrollView style={styles.scroll} contentContainerStyle={{ paddingBottom: 4 }}>
{entries.map((e) => ( {months.map((m) => (
<View key={e.id} style={styles.entry}> <View key={m.date} style={styles.month}>
{CHANGELOG.length > 1 ? <Text style={styles.entryDate}>{e.date}</Text> : null} <Text style={styles.entryDate}>{m.date}</Text>
{e.items.map((it, i) => ( {m.items.map((it, i) => (
<View key={i} style={styles.itemRow}> <View key={i} style={styles.itemRow}>
<Text style={styles.bullet}>•</Text> <Text style={styles.bullet}>•</Text>
<Text style={styles.itemText}>{it}</Text> <Text style={styles.itemText}>{it}</Text>
@ -101,7 +113,7 @@ const styles = StyleSheet.create({
marginBottom: 14, marginBottom: 14,
}, },
scroll: { flexGrow: 0 }, scroll: { flexGrow: 0 },
entry: { marginBottom: 14 }, month: { marginBottom: 16 },
entryDate: { entryDate: {
color: theme.accentText, color: theme.accentText,
fontSize: 12, fontSize: 12,

View file

@ -73,12 +73,6 @@ export function SitesScreen() {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View style={styles.headerRow}>
<Text style={styles.headerLabel}>Sites</Text>
<Text style={styles.headerCount}>{items.length}</Text>
</View>
<Text style={styles.hint}>tap a tube → newest scenes · tap the ★ → rating breakdown</Text>
<Toolbar> <Toolbar>
<SearchInput value={q} onChangeText={setQ} placeholder="search site…" /> <SearchInput value={q} onChangeText={setQ} placeholder="search site…" />
</Toolbar> </Toolbar>
@ -267,21 +261,6 @@ function RatingModal({ source, onClose }: { source: SourceOut | null; onClose: (
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { flex: 1, backgroundColor: theme.bg, paddingHorizontal: SCREEN_PAD_H, paddingTop: SCREEN_PAD_TOP }, container: { flex: 1, backgroundColor: theme.bg, paddingHorizontal: SCREEN_PAD_H, paddingTop: SCREEN_PAD_TOP },
headerRow: {
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
paddingBottom: 4,
},
headerLabel: {
color: theme.muted,
fontSize: 12,
textTransform: 'uppercase',
letterSpacing: 1.2,
fontWeight: '700',
},
headerCount: { color: theme.fg, fontSize: 22, fontWeight: '800' },
hint: { color: theme.mutedDim, fontSize: 11, marginBottom: 12 },
segment: { flexDirection: 'row', gap: 8, marginBottom: 12 }, segment: { flexDirection: 'row', gap: 8, marginBottom: 12 },