File size: 3,620 Bytes
450f198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
title: Topic stories, screen by screen
description: Why the topic stories share the Data Center Story's screen machine, which screens a topic gets, and what was left out (#1224).
---

# Topic stories, screen by screen

[#1224](https://github.com/getcommunityone/open-navigator/issues/1224). Added 2026-11-26. Owner: "All the stories
should have horizontal scroll drill down with swipe like data center."

## Decision

Topic stories (`TopicStory.tsx`) use the Data Center Story's screen machine instead of a long page. The machine was moved
out of `DataStory.tsx` unchanged into `components/stance/useStoryScreens.ts` (landing on `?screen=`, writing the screen in
view back to the URL, the cover hold, keyboard paging, focus on the settled screen's heading), and one screen's markup into
`components/stance/StoryScreenFrame.tsx`, which `StoryScreenView` now renders. A copy would have drifted; both pages now
move, announce and focus alike, and `e2e/story-nav.check.mjs` checks both.

## Which screens

`utils/topicStoryScreens.ts` holds the list and `planTopicScreens`, which drops a screen whose data loaded empty, and a
screen whose only populated category is the clear outcome (all green: every meeting read had the public for it, every
bill enacted, every local vote advanced it, or what followed the meetings was only that clear outcome). Coming up,
Nonprofits and What happened follow the same rule ([#1509](https://github.com/getcommunityone/open-navigator/issues/1509)).
Overview and Recap always stay. A loading screen stays and says it is loading; a failed request stays. Nothing is
invented to fill a screen. The left-out rows are not written on the Overview. They are listed at
`/data-explorer/story-quality` (`?story=`, `?state=`, `?city=`), which is the quality report for that story and place.
When nothing was left out, that page says so and does not draw a row per screen.

## What was left out, and why

- **County drill-down and box transition** (#1195): the topic endpoints count meetings by state only. Adding a county
  grain needs a jurisdiction-to-county count for `topic_transcript_link`; until then the Overview says there is no county
  view.
- **Unit matrix "By who spoke"**: needs one record per meeting with its AI reading; `/api/topics/{id}/state-map` and
  `caption-facts` serve counts. The Who spoke screen draws the counts as bars in the topic's words.
- **A closing vote**: only the data center pack has a question; the Recap ends on Next story.
- **City grain**: #1186.

## Layout: one Next, one Close (owner, 2026-11-27)

The owner found the cover's two stacked buttons ("Start the … story →" and "Next story: … →") confusing and asked for one
green Next at the bottom right, always visible, and a Close (×) at the top right. So the topic stories draw their own bar
(the title sentence, the screen's word, Close and the segments) instead of `ScopeBar`, and one fixed `StoryNextButton`
replaces the inline Next, the floating Next, the phone bar's Next, the cover's pair and the next-story card. The last
screen's Next is a quiet Done that goes home: readers choose the next story there. The #1234 branch is building the same
pieces for the Data Center Story; when both are in, the two should share one Close and one Next component.

## Swipe

`hooks/useSwipeNav.ts` turns a quick sideways flick (at least 50px, 1.5 times its vertical travel, under 800ms) into
Next/Back with passive listeners (the same file the #1234 branch adds), so the browser's own vertical scroll and snap keep working. It is used by the topic
stories; the Data Center Story can take the same hook.