1ce0dc6c61
Rewrite audio source editor modal for capture/processed types only. Remove old multichannel/mono/band_extract HTML sections and i18n keys. Clean up legacy DOM section null-checks in audio-sources.ts.
4.7 KiB
4.7 KiB
Phase 6: Frontend — Source Types
Status: Done Parent plan: PLAN.md Domain: frontend
Objective
Update the audio source UI to support the new ProcessedAudioSource and CaptureAudioSource types, and remove the old MonoAudioSource and BandExtractAudioSource UI.
Tasks
- Task 1: Update audio source TypeScript types/interfaces for new source types
- Already done in Phase 3:
CaptureAudioSourceandProcessedAudioSourceintypes.ts AudioSourceType = 'capture' | 'processed'already defined
- Already done in Phase 3:
- Task 2: Create
ProcessedAudioSourcecard component- Already done in Phase 3/5:
renderAudioSourceCardinstreams.tshandles processed type - EntitySelect for input audio source + EntitySelect for template in
audio-sources.ts
- Already done in Phase 3/5:
- Task 3: Update
CaptureAudioSourcecard (relabeled from Multichannel)- Already done in Phase 3: card shows capture icon, device info, template badge
- Task 4: Remove
MonoAudioSourcecard component/rendering- Already done in Phase 3: removed from
audio-sources.tsandstreams.ts
- Already done in Phase 3: removed from
- Task 5: Remove
BandExtractAudioSourcecard component/rendering- Already done in Phase 3: removed from
audio-sources.tsandstreams.ts
- Already done in Phase 3: removed from
- Task 6: Update audio source creation dialog/flow
- Phase 3 already set up separate CardSections:
csAudioCaptureandcsAudioProcessed - Each has its own
addCardOnclickpointing toshowAudioSourceModal('capture')/showAudioSourceModal('processed') - Modal type is set via hidden input, not a type picker dropdown
- Phase 3 already set up separate CardSections:
- Task 7: Update EntitySelect dropdowns that list audio sources
- Already done:
color-strips.tsandvalue-sources.tsboth show[capture]/[processed]badges and usegetAudioSourceIcon
- Already done:
- Task 8: Update i18n keys for renamed/new source types
- Removed old keys: multichannel, mono, band_extract group/add/edit/type keys, channel keys, band keys, freq keys
- Added new keys: capture/processed add/edit/type keys, processing_template label+hint
- Updated parent hint to reference processing filters instead of channel extraction
- Updated value_source.audio_source.hint to remove "(multichannel or mono)" reference
- All 3 locales updated (en.json, ru.json, zh.json)
- Task 9: Update any inline onclick handlers or window exports in app.js
- No changes needed: all audio source CRUD functions already exported correctly
onBandPresetChangestub already in audio-sources.ts (no-op), not exported to window
Files Modified
templates/modals/audio-source-editor.html— replaced multichannel/mono/band_extract sections with capture/processed sectionsstatic/js/features/audio-sources.ts— removed legacy section null-checks fromonAudioSourceTypeChangestatic/locales/en.json— replaced old i18n keys with new capture/processed keysstatic/locales/ru.json— samestatic/locales/zh.json— same
Acceptance Criteria
- ProcessedAudioSource can be created/edited/deleted from the UI
- CaptureAudioSource shows correctly with updated label
- MonoAudioSource and BandExtractAudioSource UI is completely removed
- EntitySelect for audio sources shows type badges
- Source type picker shows only Capture and Processed
- All strings are internationalized
Notes
- NEVER use plain HTML
<select>— use project custom selectors - NEVER use emoji — use SVG icons
- Use fetchWithAuth for ALL API calls
- Call cache.invalidate() before load in save/delete handlers
- Check DOM ID conflicts when adding new card types (project checklist)
Review Checklist
- All tasks completed
- Code follows project conventions
- No unintended side effects
- Build passes
- Tests pass (new + existing)
Handoff to Next Phase
What was built
- Cleaned up the HTML modal template to only show capture and processed source type sections (removed multichannel/mono/band_extract HTML)
- Updated all 3 locale files to replace old multichannel/mono/band_extract i18n keys with new capture/processed keys
- Removed legacy section null-checks from
onAudioSourceTypeChange
What Phase 7 needs to know
- The frontend now fully supports only two audio source types: capture and processed
- The modal hidden type input defaults to "capture" (was "multichannel")
- Audio source EntitySelects in color-strips.ts and value-sources.ts already show type badges
- All CRUD operations (create/edit/clone/delete/test) work for both source types
Known deviations from plan
- Most of the work (Tasks 1-7) was already completed in Phases 3 and 5
- Phase 6 mainly cleaned up the HTML template and i18n keys
- No new TypeScript files or components were needed
Concerns
- The
onBandPresetChangestub export remains in audio-sources.ts for backward compatibility; can be removed in Phase 7 cleanup