Commit 0835e53
committed
fix(web): r3 codex review — ribbon ranking, gloss label, dag rm
Three real defects from adversarial review of the r3 diff.
- Marginalia ribbon picked the wrong section. With rootMargin
-30%/-30% and `intersectionRatio` ranking, multiple sections often
qualified simultaneously and the SHORTEST section won (its bounding
rect occupied a larger fraction of the centre band). Visible bug:
ribbon showed "§ 02 · 7 · 骨格" while the readalong section was
dominant. Fix: walk SECTIONS on each observer fire, pick the chapter
whose vertical centre is closest to the viewport midpoint, and only
if a chapter actually straddles that midpoint. The ribbon now hides
when reading the hero / access bookends instead of staying pinned to
the last visited chapter.
- ReadAlong EN-pane gloss label was a constant. Every EN span carried
`SOURCE · {customId}`, so all five spans showed the same chip — the
recon brief calls for bidirectional gloss but the label didn't carry
per-span identity. Fix: use `glossLabel(p.section, p.page)` like the
JA-pane spans, so EN→JA hover surfaces the source section / page,
with the JA mate in the aux line.
- DAG RAF kept advancing under prefers-reduced-motion. The reducedMotion
state zeroed the ink-pressure speed multiplier but the loop still
ticked at the base rate, re-rendering React every frame for users who
explicitly opted out of motion. Fix: gate the RAF effect on
reducedMotion — when true, set static initial state and skip the
loop entirely.
Defence in depth: also added a `prefers-reduced-motion` media rule
zeroing `#paper-stage`'s velocity coupling, in case a future paper-rail
refactor ever stops pinning --paper-vel to 0.
Codex flags also surfaced false positives (cite-gloss tooltip jumping
into <sup>, duplicate 節度 across failures+manifest section-tags) —
logged in r3-readout.md "Adversarial review notes".
Typecheck clean, vitest 41/41.1 parent e88ea1f commit 0835e53
4 files changed
Lines changed: 57 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1148 | 1148 | | |
1149 | 1149 | | |
1150 | 1150 | | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
1151 | 1158 | | |
1152 | 1159 | | |
1153 | 1160 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
57 | 66 | | |
58 | 67 | | |
59 | 68 | | |
| |||
75 | 84 | | |
76 | 85 | | |
77 | 86 | | |
78 | | - | |
| 87 | + | |
79 | 88 | | |
80 | 89 | | |
81 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
56 | 69 | | |
57 | 70 | | |
58 | 71 | | |
59 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
60 | 76 | | |
61 | 77 | | |
62 | 78 | | |
| |||
0 commit comments