gitoria

jukebox

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain10f8a8c8Merge branch 'code-order' into mainJukeboxmain/reports/JB3b-keyboard-gap.md

1.7 KB

  1. # Hybriel gap: a keydown handler in the parent makes the child's audio element load its source again
  2. Where: components/main.hl of the jukebox (the shell); it composes MediaPlayer (components/media-player) with `src = nowSrc`. A song is playing (currentTime about 3 s).
  3. What happens: any keydown that reaches a handler written in the shell makes the audio element fire emptied, loadstart and, because autoPlay is 'true', play again: the song restarts at 0.
  4. It does not matter where the handler sits (`document.addEventListener('keydown', (k) => ...)` inside a mount handler, `on keydown(e)` on body, `on keydown(e)` on the app div), whether it emits the key event or a plain string, or whether the handler does anything: `emit jbKey('none')` with a handler that only returns null is enough.
  5. Clicks, pointer events and a timer's `emit jbTick()` in the same shell do not do it. Without any keydown listener a key press changes nothing.
  6. Measured with CDP (listeners for emptied, loadstart, play, pause, seeking on the audio element; Input.dispatchKeyEvent for the key x): [emptied, loadstart, play] after one key.
  7. Probably the shell re-applies the child's `src` prop after a keydown handler although nothing changed (setting the src attribute again loads the element again).
  8. To reproduce in the jukebox: add to the View of components/main.hl `body { on keydown(e) { emit jbKey(e) } ... }` and `on jbKey(e) { return null }`, start a song, press any key.
  9. The keyboard code that was tried: actions space (play / pause), ArrowLeft / ArrowRight (10 s), n (next), p (previous), Escape (close the overlay), ignored in input, textarea and select fields.
  10. Next step for a fresh worker: build the minimal repro app (a parent with an audio-playing child and an `on keydown(e)` that returns) and report it to hybriel.

Branches

Latest commits

  • 10f8a8c8Merge branch 'code-order' into mainJukebox
  • 204fc828Merge branch 'day72' into mainJukebox
  • 95f5faae|||PR jukebox#7 Drop needless let declarationsmre
  • 33072bb5|||PR Record day72 gates and Chrome proofmre
  • 95f2cd73|||PR Use typed parent methods for screen playback and local server facesmre
  • 6422a020Sync media-player at 51c3818mre
  • b582ba1cVendor complete Hybriel day72 plugin setmre
  • 02dccbc9Merge branch 'records-1119' into mainJukebox
  • a39e1c23|||PR Records: missions 013-015, reconnect fix livemre
  • fc7db075Merge branch 'reconnect-retry' into mainJukebox
  • ac6f4c6fL2: plain declaration for a in pickedNextmre
  • 2f335086Review round 2: only an explicit queue pick drops pend (not the automatic advance); jb23 records every source changemre
  • 3eb6695fReview fixes: action generation, queue pick clears pend, Previous/Next retry the decided request, typed handlersmre
  • 7a53c0c2|||PR A tap lost to a dead socket plays after reconnect (mission 015)mre
  • 1f0cd77bMerge branch 'records-day41' into mainJukebox
  • 67be229f|||PR Records: day41 live (PR #4), mission 012, statusmre
  • 0bb027daconductor: caramboleyo is the user, not owner/creatorApollo
  • 04f5d9d5Merge branch 'day41' into mainJukebox
  • 8ed6da45|||PR README: media-player pin df9e7dfmre
  • d5d45fc3|||PR media-player df9e7df (repeat-one fix), sync pin and SOURCEmre