In this React Native + Expo p5 learning app, there's a "symbol popup" that shows reference info when a user taps a symbol (like a p5 function name) in the code editor or instruction. The popup is not scrollable when content is long. I need to find this popup component.
Please search for:
A modal/popup that shows symbol/p5 API reference info. Search for terms like "symbol", "openRef", "ReferenceModal", "SymbolPopup", "RefPopup", "reference", "popup", "modal" in src/components and src/app.
The exact file + line numbers where the popup's content container is defined, and its style — likely a or or with fixed maxHeight that fails to scroll. Report whether it's wrapped in a ScrollView or not.
How the content is loaded (HTML string? markdown? raw text?) and roughly how long it can get.
The trigger: there's a postMessage { type: 'openRef', symbol: ... } sent from the WebView (in src/utils/editor/exerciseHtml.ts around line 708-710) — find the handler on the React side that receives this and opens the popup.
Report file paths + line numbers + relevant JSX/style excerpts. Read only, no edits.
Assistant
The "popup" is actually the routed /ref page. Let me read its SymbolDetail component and styles.
Assistant
Let me verify the WebView trigger context in exerciseHtml.ts and check for any other popup/modal related to ref.
Assistant
Search Complete
Here's what I found. The "popup" is not actually a Modal — it's a routed Expo Router screen at /ref?symbol=<name> that opens as a full page. The detail rendering lives in the SymbolDetail component.
1. The component (file + key lines)
File:/workspaces/learn-p5/src/app/ref/index.tsx
SymbolDetail component: lines 132–356
Outer container: <View style={[styles.flex1, ...]}> at line 189
Content scroller: a single <FlatList> at lines 191–345
style={[styles.flex1, { paddingHorizontal: 16, paddingTop: 24 }]} — line 192
contentContainerStyle={{ paddingBottom: 48 }} — line 193
data={sym.parameters} — line 194 (so only the small parameter rows are "list items")
ListHeaderComponent (lines 196–271): contains the symbol name badge, the full description, the Usage/syntax box, and the entire Examples block.
ListFooterComponent (lines 292–344): prev/next nav buttons + "View on p5js.org" link.
2. Is it wrapped in a ScrollView? — No.
There is no <ScrollView> anywhere in this screen. The whole detail body is one FlatList. So in principle it should scroll. The actual problem is the Examples block inside the ListHeaderComponent (lines 228–261):
Each example renders a live p5 <WebView scrollEnabled={false}> plus a matching code block. When a symbol has many examples (e.g. filter has 32, blendMode 16), the FlatList header contains many nested React‑Native‑WebViews. Those WebViews intercept touch/scroll gestures even with scrollEnabled={false}, which is the classic RN bug that makes the surrounding FlatList feel "not scrollable" once content gets long. There is no fallback ScrollView or nestedScrollEnabled handling.
3. How the content is loaded & how long it gets
Source data: /workspaces/learn-p5/src/data/reference.generated.json, mapped through /workspaces/learn-p5/src/data/reference.ts:41-54 (toP5SymbolView) into P5SymbolView:
Format is plain text (description, syntax, param descriptions) + raw p5 source strings (each example rendered both live in a <WebView> and as a static code block). No HTML/markdown payload is rendered directly into React Native for the description itself — parseDescription (lines 75–130) just splits text and inlines tappable symbol spans.
Content can get very long (measured from the generated JSON):
symbol
desc chars
examples count
example chars
params
filter
1056
32
9148
2
colorMode
3315
13
6258
2
blendMode
2507
16
6409
1
blend
734
12
6952
10
createShader
7461
0
0
3
loadModel
2929
6
3821
5
For symbols like filter, the header alone mounts 32 separate <WebView> instances (each 260px tall ⇒ ~8,500px of content) inside the FlatList, which is exactly the configuration that breaks FlatList scrolling on React Native.
4. The trigger pipeline
(a) WebView side — /workspaces/learn-p5/src/utils/editor/exerciseHtml.ts
postOpenRef(symbol) definition, lines 728–732 (the actual postMessage is on line 730 — slightly below the ~708–710 you mentioned):
js
// exerciseHtml.ts:728-732
function postOpenRef(symbol) {
if (window.ReactNativeWebView && window.ReactNativeWebView.postMessage) {
window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'openRef', symbol: symbol }));
}
}
Binded twice for .symbol taps in instructions:
At line 831 — rebind after a task fade‑through swap of the instruction HTML.
At lines 1276–1280 — the initial bind over all .symbol elements:
(b) React Native side — /workspaces/learn-p5/src/app/learn/[course]/[id].tsx
The onMessage handler on the editor WebView (the callback starting at line 420) parses msg.type and routes openRef at lines 440–442:
tsx
// [id].tsx:440-442
case "openRef":
router.push(`/ref?symbol=${msg.symbol}`);
break;
That router.push opens the routed /ref screen at /workspaces/learn-p5/src/app/ref/index.tsx:358 (Reference default export), which reads useLocalSearchParams<{ symbol?: string }>() (line 359) and, when symbol is present, renders <SymbolDetail symbol={symbol} ... /> (line 378).
Summary of where the fix would focus
The non‑scrolling "popup" is the routed screen /workspaces/learn-p5/src/app/ref/index.tsx, component SymbolDetail (lines 132–356).
Scroll container is a single FlatList (line 191) — no ScrollView wrap, no nestedScrollEnabled/scrollEnabled issues on the FlatList itself, but the ListHeaderComponent mounts many child <WebView scrollEnabled={false}> elements (lines 242‑250) that hijack touch events, and the header has no fixed/maxHeight constraint other than the per‑WebView height: 260 (style at lines 600‑604).
For symbols with many examples (filter=32, blendMode=16) the header is thousands of px tall with multiple WebViews — that's the configuration failing to scroll.
The onMessage dispatcher that opens it is /workspaces/learn-p5/src/app/learn/[course]/[id].tsx lines 420–497, specifically the openRef case at 440–442.