mirror of
https://github.com/got-feedBack/feedBack.git
synced 2026-07-26 06:42:32 +00:00
* refactor(app): carve resume-session out of app.js (R3a)
static/js/resume-session.js (157) — the snapshot taken when you leave a song and the
pill that offers it back. Bodies VERBATIM. app.js 7,727 → 7,601.
Fifth slice out of the strongly-connected core. ONE hook (playSong) + a
currentFilename getter.
S.pendingResume JOINS THE CONTAINER — on demand, exactly as intended. app.js WRITES
it (playSong({ resume }) arms it; the song:ready listener consumes it) while this
module reads it, so it cannot be a plain export: an imported binding is read-only.
Same reason isPlaying is there. The container grows one field per carve that needs
it, never speculatively.
THE CONTRACT TEST CAUGHT THE MISSING HOOK, again on a path nothing executes:
"playSong is read by a module but never wired by app.js — it would throw at runtime".
Second time it has caught a real wiring gap the moment it appeared.
A REAL TRAP, worth remembering: I first did the S.pendingResume rewrite by feeding
acorn's identifier RANGES from node into python, and it corrupted the file
(`_pS.pendingResume null;`). **Acorn's offsets are UTF-16 code units; Python's string
indices are code points.** static/app.js contains emoji, so every offset past one
drifts. Do an AST-driven rewrite in the SAME language that produced the offsets.
`node --check` caught it; a silent version of that bug is very easy to imagine.
VERIFIED. A/B against origin/main in two browsers, real song: the window API
(resumeLastSession / _snapshotResumeSession / _readResumeSession /
_clearResumeSession), snapshot, read-back, and clear — IDENTICAL, zero page errors.
HONEST LIMIT: my probe never got the snapshot to actually PERSIST (there is a guard
beyond the 3s minimum position that a scripted playSong does not satisfy), so that
path is verified only as identical-to-main, not as observed-working. The real
coverage is tests/browser/resume-session.spec.ts, which drives the flow properly.
Zero harnesses broke. pytest 2396, node 1040/1040, ESLint 0 (no-cycle clean),
tailwind clean, Codex 0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* refactor(app): carve the JUCE/desktop audio shims out of app.js (R3a)
static/js/juce-audio.js (994) — bodies VERBATIM. app.js 7,603 → 6,643.
THE LARGEST SINGLE SLICE of the whole carve phase: 960 lines, ~13% of what was left.
Three self-installing IIFEs:
_installJuceEngineRoutingWatcher (444) routes a song to the JUCE engine or HTML5 as
the desktop output enters/leaves exclusive/ASIO
_installRendererBusFeeder (337) feeds the highway renderer bus from whichever
transport is actually running
_installJuceAudioElementShim (156) patches audio.play/pause so the rest of the app
keeps talking to the <audio> element while JUCE
owns the transport
They EXPORT NOTHING — all three publish through `window.*` (_juceMode,
_reevaluateJuceRouting, _reevaluateRendererBus, …). So app.js needs only a
side-effect import plus the one binding it actually uses
(_resetJuceAudioShimChain, which the shim IIFE assigns).
THE ORDERING QUESTION, CHECKED RATHER THAN ASSUMED. Importing this module runs the
IIFEs EARLIER than before: imports evaluate ahead of app.js's body, and therefore
ahead of configureHost(). A hook read at IIFE-execution time would THROW. So I walked
the AST at IIFE-body depth to see what they actually touch when they run: nothing but
listener registration, and `audio.play`/`audio.pause` patching — and `audio` is itself
an imported module now. Verified in the browser: both are patched on the carved build
exactly as on main, which proves the shim installs correctly at its new, earlier point.
(Had I got this wrong, host.js throws loudly rather than silently misbehaving — which
is the whole reason it has no no-op defaults.)
VERIFIED. A/B against origin/main in two browsers: the entire window.* surface the
IIFEs publish (_juceMode, _juceOutputIsExclusive, _reevaluateJuceRouting,
_reevaluateRendererBus, _clearJuceRerouteMemo), audio.play/pause patched, a real song
loading and togglePlay driving the public mirror — IDENTICAL, zero page errors.
Harnesses: juce_engine_reroute (19 tests) + renderer_bus_feeder (13) slice the IIFEs by
signature — retargeted, and each sandbox gains a `host` object routed at its EXISTING
stubs so every assertion holds unchanged. test_plugin_runtime_idempotence is SPLIT: 3 of
its 4 source-asserts stayed in app.js, the sm.emit('song:resume') one moved.
pytest 2396, node 1040/1040, ESLint 0 (no-cycle clean), tailwind clean, Codex 0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
||
|---|---|---|
| .. | ||
| alpha_warning_banner.test.js | ||
| app_tour_library.test.js | ||
| audio_effects_host.test.js | ||
| audio_effects_test_harness.js | ||
| audio_element_accessor.test.js | ||
| audio_session_compat.test.js | ||
| audio_session_host.test.js | ||
| audio_session_input.test.js | ||
| audio_session_mix.test.js | ||
| audio_session_monitoring.test.js | ||
| audio_session_routes.test.js | ||
| audio_session_stems_bridge.test.js | ||
| audio_session_stems.test.js | ||
| audio_session_test_harness.js | ||
| autoplay_exit.test.js | ||
| badges_handedness.test.js | ||
| beats_loaded.test.js | ||
| capabilities_claims.test.js | ||
| capabilities_diagnostics.test.js | ||
| capabilities_lifecycle.test.js | ||
| capabilities_manifest_runtime.test.js | ||
| capabilities_multi_provider.test.js | ||
| capabilities_ownership.test.js | ||
| capabilities_test_harness.js | ||
| capabilities_versioning.test.js | ||
| capability_inspector_nav.test.js | ||
| capability_inspector_render.test.js | ||
| diagnostics_summary.test.js | ||
| drum_keys_highway_3d_resize_reframe.test.js | ||
| edit_metadata_modal.test.js | ||
| editor_pending_view.test.js | ||
| handshapes_pipeline.test.js | ||
| highway_3d_arp_deferral.test.js | ||
| highway_3d_camera_framing.test.js | ||
| highway_3d_context_loss.test.js | ||
| highway_3d_fret_label_render_order.test.js | ||
| highway_3d_fret_row_labels.test.js | ||
| highway_3d_fret_spacing.test.js | ||
| highway_3d_lean_sustain.test.js | ||
| highway_3d_lefty.test.js | ||
| highway_3d_overlay_full_cover.test.js | ||
| highway_3d_panel_controls.test.js | ||
| highway_3d_pool_warm.test.js | ||
| highway_3d_render_order.test.js | ||
| highway_3d_resize_reframe.test.js | ||
| highway_3d_slide_target.test.js | ||
| highway_3d_smooth_clock_pause.test.js | ||
| highway_3d_sustain_bloom.test.js | ||
| highway_3d_sustain_rail.test.js | ||
| highway_3d_wide_fov.test.js | ||
| highway_adaptive_scale.test.js | ||
| highway_audio_barrier.test.js | ||
| highway_bend_curve.test.js | ||
| highway_chord_harmony.test.js | ||
| highway_chord_render_cache.test.js | ||
| highway_colors_facade.test.js | ||
| highway_filtered_notes.test.js | ||
| highway_monotonic_clock.test.js | ||
| highway_note_state.test.js | ||
| highway_pause_throttle.test.js | ||
| highway_phrases.test.js | ||
| highway_renderer_swap_canvas_reset.test.js | ||
| highway_string_colors.test.js | ||
| highway_teaching_marks.test.js | ||
| highway_visibility.test.js | ||
| host_contract.test.js | ||
| juce_engine_reroute.test.js | ||
| legacy_shim_hits.test.js | ||
| library_card_actions.test.js | ||
| live_guitar_tone_source.test.js | ||
| live_performance_hud.test.js | ||
| loop_api.test.js | ||
| loop_restart.test.js | ||
| midi_input_domain.test.js | ||
| note_detection_domain.test.js | ||
| pedal_cables.test.js | ||
| play_button_reroute_guard.test.js | ||
| play_queue_peek.test.js | ||
| play_queue_shuffle.test.js | ||
| playback_app_adapter.test.js | ||
| playback_compat.test.js | ||
| playback_diagnostics.test.js | ||
| playback_domain.test.js | ||
| playback_test_harness.js | ||
| plugin_hydration_wipe.test.js | ||
| plugin_loader_script_type.test.js | ||
| plugin_style_injection.test.js | ||
| plugins_page.test.js | ||
| progress_calibration.test.js | ||
| progression_notifications.test.js | ||
| progression_progress_events.test.js | ||
| renderer_bus_feeder.test.js | ||
| section_practice_dismiss.test.js | ||
| settings_autosave.test.js | ||
| song_close.test.js | ||
| song_credits_overlay.test.js | ||
| song_event_payload.test.js | ||
| song_restart.test.js | ||
| song_seek.test.js | ||
| speed_reset.test.js | ||
| test_utils.js | ||
| tour_engine.test.js | ||
| tuner_auto_open.test.js | ||
| tuner_core.test.js | ||
| tuning_display.test.js | ||
| tuning_targets.test.js | ||
| v3_add_to_playlist_menu.test.js | ||
| v3_az_rail.test.js | ||
| v3_collections.test.js | ||
| v3_favorites_toggle.test.js | ||
| v3_keep_practicing.test.js | ||
| v3_library_refresh.test.js | ||
| v3_playlist_cover.test.js | ||
| v3_songs_score_badge_refresh.test.js | ||
| v3_songs_scroll.test.js | ||
| v3_songs_tuning.test.js | ||
| v3_songs_window_recycle.test.js | ||
| v3_theme_read_api.test.js | ||
| v3_user_select_policy.test.js | ||
| venue_instrument_pov.test.js | ||
| venue_mood_fx.test.js | ||
| venue_scene_3d.test.js | ||
| venue_viz.test.js | ||
| visualization_domain.test.js | ||
| window_contract.test.js | ||
| working_tuning_capability.test.js | ||
| working_tuning.test.js | ||