Skip to content

Drop the label below an upward-pointing triangle (#242) - #245

Merged
IanMayo merged 1 commit into
mainfrom
claude/github-issue-242-8rx57u
Aug 21, 2026
Merged

Drop the label below an upward-pointing triangle (#242)#245
IanMayo merged 1 commit into
mainfrom
claude/github-issue-242-8rx57u

Conversation

@IanMayo

@IanMayo IanMayo commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Fixes #242.

The problem

An upward-pointing triangle is drawn to point at the gram above it, but the label was stacked over its apex — covering exactly the data the analyst had aimed it at.

The issue offered two fixes: a per-set label toggle, or teaching the layout that this one symbol carries its label underneath. This is the second, so it costs no extra interaction: pick the triangle, and the space it points at stays clear.

What changed

One shared predicate — labelSitsBelowSymbol() in src/rendering/symbols.js — decides this for every labelled feature, so the rule cannot drift between them:

  • Analysis markers (markerLabelPlacement()): the baseline drops a whole line of text past the symbol's bottom edge, so the glyphs — which hang above their baseline — start clear of the mark.
  • Harmonic and sideband pins (PinSetMode.labelStackPositions()): the symbol still caps the pin line and the anchor never moves; only the number changes sides, landing over ink the pin already spends. The top-edge clamp now measures from whichever part leads the stack (the symbol when the label hangs below), so FR-011 still holds.

Sidebands come along for free — both modes share PinSetMode — which covers the issue's note about #241.

The hotspot follows the digits rather than staying where they used to be: labelStackBounds() inverts with the layout, and now reports the symbol's underside separately so a hidden-pin set's mini-pin stub keeps hanging from the symbol regardless of where the label went.

Only the up triangle is affected. triangle-down points at the space below it, so its label stays above, and every other symbol is unchanged.

The marker label's font size moves into utils/markerLabel.js, which needs it to size the drop; rendering/labels.js imports it back, so the placement rule and the element that obeys it read one number.

Testing

  • yarn test — 330 passed, including new coverage: an up-triangle pin stacks symbol → label with the gram above the apex clear; the label under the triangle still grabs its set, while the space it vacated now grabs nothing; the mini-pin still hangs from the symbol; and an up-triangle marker draws its label centred below the symbol.
  • yarn test:unit — 136 passed, including the placement rule and a check that triangle is the only symbol in the catalogue that inverts.
  • yarn typecheck, yarn lint, yarn hygiene — all clean, no baselines moved.

Docs updated: docs/Gram-Modes.md (Analysis and Harmonics behaviour) and the mode summary in CLAUDE.md.


Generated by Claude Code

An up-pointing triangle is drawn to point AT the gram above it, so the
label stacked over its apex covered exactly the data the analyst had
aimed it at. For that one symbol the label now hangs underneath instead
— over ink the feature already spends — and no toggle or extra click is
needed to read what is beneath it.

One shared predicate, `labelSitsBelowSymbol()` in rendering/symbols.js,
decides this for every labelled feature:

- analysis markers, via `markerLabelPlacement()`: the baseline drops a
  whole line of text past the symbol's bottom edge, so the glyphs clear
  the mark;
- harmonic and sideband pins, via `PinSetMode.labelStackPositions()`:
  the symbol still caps the line, only the number changes sides, and the
  top-edge clamp now measures from whichever part leads the stack.

The grab region follows the digits rather than staying where they used
to be: `labelStackBounds()` inverts with the layout, and reports the
symbol's underside separately so a hidden-pin set's mini-pin stub keeps
hanging from the symbol regardless of where the label went.

The marker label's font size moves into utils/markerLabel.js, which
needs it to size the drop, and rendering/labels.js imports it back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SpLe4XCjhvgj7fEaYhghxZ
@github-actions

Copy link
Copy Markdown
Contributor

PR Preview

Preview deployment is ready! View Preview

Last updated: 2026-08-21T13:13:38.316Z

@IanMayo
IanMayo merged commit bfc18f1 into main Aug 21, 2026
6 checks passed
@IanMayo
IanMayo deleted the claude/github-issue-242-8rx57u branch August 21, 2026 13:16
github-actions Bot added a commit that referenced this pull request Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow harmonic label to be toggled

2 participants