Skip to content

Section-practice override 2/4 (core): activate and clear the practice-difficulty override from Section Practice #140

Closed

Description

@cchacs

Effort: M

Part of the Section Practice difficulty override feature tracked in get-flashbacks/feedback-plugin-difficulty-ladder#160 (2/4). Builds on the Host capability shipped in #136 / PR #138 (static/capabilities/practice-difficulty.js). This is the producer integration: Section Practice (a core surface in this repo, static/js/section-practice.js) now drives the practice-difficulty override.

Note: "Section Practice" is not a standalone plugin. feedBack-plugin-riffrepeater and others treat core's Section Practice popover as a core surface (e.g. they call core's _sectionPracticeBarInnerHtml()). The producing repository is therefore this repo (feedBack core), not a plugin repository.

Scope

  • Activate the practice-difficulty override for the looped section using the manual difficulty_pct pin, and clear it when the loop ends or Section Practice mode exits.
  • Register/activate through the Host capability only — no direct writes to another plugin's state.
  • The override is a manual percentage pin, not a second adaptive controller. Section Practice owns the practice workflow; Difficulty Ladder keeps owning song-wide adaptive difficulty.
  • Track which loop the override belongs to so a foreign loop that clears or replaces ours clears the override exactly once (idempotent clear).

Integration points (current main)

  • practiceSection(index, opts) — static/js/section-practice.js. Arm the loop via host.setLoop(start, end, ...) first, and only activate once the loop is confirmed, so a failed loop never leaves a live override.
  • _setSectionPracticeMode(on, opts) — the single teardown funnel for turning the feature off, clearLoop(), and song/arrangement changes. Emit clear here when an override is active.
  • _syncSectionPracticeFromLoop(...) — recognizes externally armed loops that match the current section and can turn Section Practice on. Decide whether a foreign matching loop should activate the core-owned override, or only a loop this feature armed.
  • hasPhraseData() — sections with no authored phrases need an explicit answer, since the override currently changes nothing for them.
  • Capability surface: static/capabilities/practice-difficulty.js (register-participant, unregister-participant, activate, clear; override-activated / override-cleared / override-rejected events).

Open decisions

  1. Where does difficulty_pct come from? Core Section Practice has no difficulty control today, so the pin needs a source: a core UI, a participant registration from another plugin, or a persisted per-section value.
  2. What is the stable core source ID? Unlike a plugin there is no manifest-based registration, so the capability call needs a fixed, documented source identifier (plus per-source cleanup for participant unregistration).
  3. External loop ownership — activate on any matching external loop, or only on loops this feature armed?

Acceptance criteria

  • With the practice-difficulty capability present, looping a section pins its effective difficulty and leaving the loop (or exiting Section Practice) restores the song-wide value.
  • No activate is emitted when setLoop fails, and no override leaks after clearLoop(), song change, or arrangement change.
  • Clearing is idempotent — a loop ended by another producer clears our override at most once.
  • A matching issue/PR links back to feedback-plugin-difficulty-ladder#160 so the tracking issue can be unblocked.

Out of scope

Making Step Mode a difficulty provider (only if it explicitly opts in), per #22.

Activity

  1. deleted a comment from pullfrog on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions