Skip to content

Commit 1c10e81

Browse files
lxb12123claude
andcommitted
fix(03-attention): output_i card no longer overlaps the mixer; spread w·v labels
- Push the output_i card well clear of the mixer sphere (right, clamped to stay in-frame) so it stops covering the mixer and the converging green beams. - Place the wⱼ·vⱼ labels up near each Vⱼ source and y-stagger neighbours, so they no longer bunch/clip at the convergence point. typecheck/lint/114 unit/7 e2e/check-assets pass; both-theme screenshots verified. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 25c90ec commit 1c10e81

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

components/3d/attention/AttentionSandbox.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,22 +295,27 @@ export function AttentionSandbox({ defaultText }: AttentionSandboxProps) {
295295
);
296296
})}
297297

298-
{/* wⱼ·vⱼ labels — sit in the LOWER gap (on the green lane). */}
299-
{state.progress.valuemix > 0.5 && view.entries.filter((e) => !e.masked).map((e) => {
300-
const mx = (tokenX(e.j) + tokenX(qi)) / 2;
301-
const my = (VALUE_Y - 0.35 + MIXER_Y + 0.4) / 2;
298+
{/* wⱼ·vⱼ labels — placed UP near each Vⱼ source (so they spread out by
299+
token, not bunch at the mixer) and y-staggered so neighbours never
300+
collide or clip the output_i card. */}
301+
{state.progress.valuemix > 0.5 && view.entries.filter((e) => !e.masked).map((e, idx) => {
302+
const t0 = 0.32;
303+
const mx = tokenX(e.j) + (tokenX(qi) - tokenX(e.j)) * t0;
304+
const yTop = VALUE_Y - 0.35, yBot = MIXER_Y + 0.4;
305+
const my = yTop + (yBot - yTop) * t0 + (idx % 2 === 0 ? 0.16 : -0.16);
302306
return (
303307
<BeamLabel key={`vlbl-${e.j}`} position={[mx, my, 0.12]} text={`${e.weight.toFixed(2)}·v${e.j}`}
304308
theme={theme} accent={theme.v} onClick={() => setSelJ(e.j)} />
305309
);
306310
})}
307311

308-
{/* Output mixer + output_i */}
312+
{/* Output mixer + output_i. The card is pushed well clear of the mixer
313+
sphere and the converging green beams, clamped to stay in-frame. */}
309314
{state.progress.valuemix > 0.05 && (
310315
<>
311316
<OutputMixer position={[tokenX(qi), MIXER_Y, 0]} theme={theme} reveal={state.progress.valuemix} />
312317
{state.progress.valuemix > 0.6 && (
313-
<MixerLabel position={[tokenX(qi) + 1.1, MIXER_Y, 0]} theme={theme} dims={view.output} />
318+
<MixerLabel position={[Math.min(tokenX(qi) + 2.0, 2.7), MIXER_Y, 0]} theme={theme} dims={view.output} />
314319
)}
315320
</>
316321
)}
2.53 KB
Loading

0 commit comments

Comments
 (0)