feat: group the list view by section and let the groups collapse

Every page of a forum repeats its global announcements, announcements and
stickies before the first real topic. On a phone that is the whole first
screen, scrolled past on every page turn, and the rebuild made it worse: the
board separates those blocks with header rows the card stream dropped, so
what remained was one undifferentiated run of cards.

Each block now carries a header with its name and card count, and tapping it
folds the block away. The announcement blocks start folded, which is the
point of the change; folding rather than filtering keeps them reachable
without editing the script. The state is kept per kind, so a decision taken
in one forum holds in all of them.

localStorage rather than GM_setValue: no @grant, and identical behaviour in
Tampermonkey and the iOS app, against the risk that Safari clears the value
after long inactivity and the sections return to their default. That is a
reset of one preference, not data loss.

Rows are classified by the icon in their first column instead of a title
prefix, because the board marks the type nowhere else. The header labels come
from the board's own separator rows, so sections nobody anticipated still
read correctly.

The menu bar links the forum rules and the FAQ as topics. That row has
neither a topic title nor numeric columns, but it passed the layout brake and
had been yielding a ghost card at the head of every list — visible now that
it would claim a section header of its own.
This commit is contained in:
Andre
2026-08-02 15:26:04 +02:00
parent 4ce48b3875
commit 2474cd3b9f
3 changed files with 204 additions and 50 deletions
+37 -12
View File
@@ -27,12 +27,24 @@ card; category headers become section headings. Rows are recognised by phpBB's
own `forumlink` / `forumdesc` classes, and failing that by their shape — two
purely numeric columns are only ever a forum's topic and post count.
Where forums and topics end up in the same stream of cards, a header strip
naming the kind and its count (`FOREN 4`, `THEMEN 3`) is inserted wherever the
kind changes, and forum cards additionally carry a coloured left edge. The
original page separates the two by putting them in tables of their own; that
boundary is otherwise lost. The strip is left out directly below
a category heading, which already introduces the forums under it.
Forums, global announcements, announcements, stickies and topics all end up in
the same stream of cards, which loses the separation the original page draws
between them. A header strip naming the section and its card count is therefore
inserted wherever the kind changes, and forum cards additionally carry a
coloured left edge. The label is taken from the board's own separator row
(`Global Announcements`, `Stickies`, `Topics`), so sections this script does not
know are named correctly too. Which kind a topic row is comes from the icon in
its first column, not from its title. The strip is left out directly below a
category heading, which already introduces the forums under it.
Tapping a header collapses its section. Global announcements, announcements and
stickies start collapsed: they precede the topics on *every* page of a forum and
otherwise fill the first screen. The state is stored per kind in `localStorage`,
so collapsing stickies once applies to every forum. `localStorage` is used
rather than `GM_setValue` because it needs no `@grant` and behaves the same in
Tampermonkey and in the iOS app; the trade-off is that Safari may clear
script-writable storage after long inactivity, which resets the sections to
their default.
The thread navigation bar holds first / previous / next / last and a page
indicator. Tapping the indicator opens a sheet with a number field and a grid of
@@ -206,12 +218,25 @@ Zwischenüberschriften. Erkannt werden die Zeilen an phpBBs eigenen Klassen
`forumlink` / `forumdesc` und ersatzweise an ihrer Form — zwei rein numerische
Spalten hat nur eine Forenzeile mit Themen- und Beitragszahl.
Stehen Foren und Themen im selben Kartenstrom, wird bei jedem Wechsel ein
Gruppenkopf mit Art und Anzahl eingezogen (`FOREN 4`, `THEMEN 3`); Forenkarten
tragen zusätzlich eine farbige linke Kante. Die Originalseite trennt beide über
eigene Tabellen mit eigenem Kopf — diese Grenze geht sonst verloren.
Direkt unter einer Kategorieüberschrift entfällt der
Gruppenkopf, weil die Überschrift die Foren darunter schon einleitet.
Foren, globale Ankündigungen, Ankündigungen, Stickies und Themen landen alle im
selben Kartenstrom, womit die Trennung verlorengeht, die die Originalseite
zwischen ihnen zieht. Bei jedem Wechsel wird deshalb ein Gruppenkopf mit dem
Namen des Abschnitts und der Zahl seiner Karten eingezogen; Forenkarten tragen
zusätzlich eine farbige linke Kante. Die Beschriftung stammt aus der Trennzeile
der Seite selbst (`Global Announcements`, `Stickies`, `Topics`), damit auch
Abschnitte richtig heißen, die dieses Script nicht kennt. Welcher Art eine
Themenzeile ist, verrät das Symbol ihrer ersten Spalte, nicht der Titel. Direkt
unter einer Kategorieüberschrift entfällt der Gruppenkopf, weil die Überschrift
die Foren darunter schon einleitet.
Ein Tipp auf den Kopf klappt seinen Abschnitt zu. Globale Ankündigungen,
Ankündigungen und Stickies starten zugeklappt: sie stehen auf *jeder* Seite
eines Forums vor den Themen und füllen sonst den ersten Bildschirm. Der Zustand
liegt je Art in `localStorage`, einmal zugeklappte Stickies gelten also in jedem
Forum. `localStorage` statt `GM_setValue`, weil es ohne `@grant` auskommt und
sich in Tampermonkey wie in der iOS-App gleich verhält; dafür kann Safari
schreibbaren Speicher nach längerer Nichtnutzung räumen, dann stehen die
Abschnitte wieder auf ihrer Voreinstellung.
Die Navigationsleiste im Thread enthält erste / vorherige / nächste / letzte
Seite und eine Positionsanzeige. Ein Tipp darauf öffnet ein Sheet mit