Skip to content

Emit section difficulty events for sectionmap integration - #12

Open
carochacs wants to merge 1 commit into
claude/feedback-dynamic-difficulties-plugin-vs9x07from
claude/sectionmap-dynamic-difficulty-placement-aozv7g
Open

Emit section difficulty events for sectionmap integration#12
carochacs wants to merge 1 commit into
claude/feedback-dynamic-difficulties-plugin-vs9x07from
claude/sectionmap-dynamic-difficulty-placement-aozv7g

Conversation

@carochacs

@carochacs carochacs commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds event emission of section difficulty data to enable the sectionmap plugin to display glass-filling difficulty visualization for each song section.

Changes

  • Add calculateAndEmitSectionDifficulties() function to compute difficulty metrics per section
  • Calculate section difficulty based on phrase data within each section's time range
  • Determine appropriate glass size (small/medium/large) based on difficulty
  • Emit difficulty:sections-updated event with section difficulty map
  • Emit updated data whenever mastery changes or song loads
  • Export function for testing

Data Structure

Each section receives difficulty data with:

  • fillPercentage: 0-100 value representing how much the glass fills (based on mastery vs max difficulty)
  • glassSize: from 1 to 5 - determined by section's relative difficulty
  • avgDifficulty: Average difficulty of phrases in section
  • maxDifficulty: Maximum difficulty of phrases in section

Event Contract

Plugins listen for the event via:

window.feedBack.on('difficulty:sections-updated', (event) => {
    const { sectionDifficulties, mastery, maxDifficulty } = event.detail;
    // Use sectionDifficulties map to render section-specific visualizations
});

This enables seamless integration with the sectionmap plugin for unified section difficulty visualization.


Generated by Claude Code

- Calculate difficulty data for each section based on phrase data
- Emit 'difficulty:sections-updated' event with section difficulties
- Include fillPercentage and glassSize for visualization
- Update section difficulties when mastery changes
- Export function for testing

This allows the sectionmap plugin to display glass-filling difficulty
visualization for each section using the calculated data.
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.

2 participants