Repository navigation
Replace section glasses with the shared difficulty tier rail (#14) - #18
Conversation
Section Map's per-section indicator was a glass whose fill percentage and glass size came from Difficulty Ladder's v2 payload. That metaphor encoded difficulty as size and could only show a fraction. Replace it with the semantic tier rail the peer's own guide draws: one fixed-size segment per tier, the first current+1 lit, and an outline on the tier a section plays in full. Difficulty is now shown by how many segments are lit, never by a segment's size. - Prefer the render-neutral difficulty:sections-updated-v3 payload (current_tier / top_tier / max_tier / has_chart_content), feature-detected via window._ddCapabilities.sectionsSchema === 'difficulty_ladder.sections.v3'. The payload's own schema field is ignored; the capability marker is the contract. - Keep the frozen v2 event as a bounded-transition fallback: reconstruct a coarse rail from fillPercentage (topTier = maxTier = maxDifficulty, currentTier = round(fill x topTier)) and discard glassSize entirely. The fallback is deleted once the peer's transition policy drops v2. - Normalize both payload shapes before rendering. Entries without finite numeric tiers (v3) or fillPercentage (v2) are dropped; a container that isn't readable is ignored so the last good state survives, while a well-formed payload with nothing renderable clears the rails. current_tier null is 'unknown' (an unlit rail), not a zero tier. - Collapse a block too narrow for its segments to a single marker; a resize listener invalidates the per-section signatures so the width-dependent form is re-decided. The readable detail 'Section name · tier X of Y · full detail at Z' is the same wording in the block title and aria-label, and only tier-bearing blocks are focus stops (managed in both the full-render and in-place-update paths). - Repaint rails in place from the peer's events via a per-section signature; no full _smRender() per event. - Delete the glass code (_smRenderGlassFilling, .sm-glass, SM_GLASS_SIZES, glassSize handling) and rename the state to _smSectionTiers. - Add tier-rail, responsive-collapse, a11y, late-provider, malformed-payload and narrow-section tests; bump to 1.4.0.
|
Fixed the check suite failure on PR #18 (CodeFactor: "Complex Method" on Diagnosis: the failed check was CodeFactor flagging Fix: split the rail DOM update and the block attribute/title update out of Pushed as
|
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (5 files)
Reviewed by efficient · Input: 62K · Output: 13.7K · Cached: 346.1K |

Closes #14.
Section Map's per-section indicator was a glass whose fill percentage and glass size came from Difficulty Ladder's v2 payload. That metaphor encoded difficulty as size and could only ever show a fraction. This replaces it with the semantic tier rail the peer's own guide draws: one fixed-size segment per tier, the first
current + 1lit, and an outline on the tier a section plays in full. Difficulty is now shown by how many segments are lit, never by a segment's size.What changed
window._ddCapabilities.sectionsSchema === 'difficulty_ladder.sections.v3', Section Map subscribes todifficulty:sections-updated-v3and renderscurrent_tier/top_tier/max_tier/has_chart_contentdirectly. Feature-detected via the capability marker, never version-pinned — the payload's ownschemafield is deliberately ignored.difficulty:sections-updated; Section Map reconstructs a coarse rail fromfillPercentage(topTier = maxTier = maxDifficulty,currentTier = round(fill × topTier)) and discardsglassSizeentirely. Delete the fallback when the peer's transition policy drops v2.fillPercentage(v2) are dropped; an unreadable container is ignored so the last good state survives, while a well-formed payload with nothing renderable clears the rails.current_tier: nullis "unknown" (an unlit rail), not a zero tier.resizelistener invalidates the per-section signatures so the width-dependent form is re-decided. The readable detailSection name · tier X of Y · full detail at Zis the same wording in the blocktitleandaria-label, and only tier-bearing blocks are focus stops — managed in both the full-render and in-place-update paths (so no phantom focus stop when data disappears)._smRender()per event._smRenderGlassFilling,.sm-glass,SM_GLASS_SIZES,glassSizehandling); state renamed to_smSectionTiers.node tests/screen.test.js→ 44/44.plugin.jsonto 1.4.0 and updatesREADME.md/CLAUDE.md/ the capabilities block.Standalone behavior
Unchanged: section colors, labels, click-to-seek and wheel nudging all work with no peer installed. The rail is the only dependent feature, gated on the capability marker — absent peer means no rails, never an error.
big-pickle(free) | 𝕏