Expand description
<SystemAudioPicker /> β live-data picker for the speaker /
per-app audio capture in the Recorder surface (M-AUDIO-SYS.2 /
AUT-279 / AUT-282).
Mirrors crate::mic_picker for the speaker path with two key
differences:
- Master on/off toggle (
enabledsignal) gates everything. The mic picker has no master toggle because a mic device is always selectable; system audio is opt-in and the toggle is the cleanest UX. - Multi-select with bundle-id persistence. Each app row has a
checkbox; the selected bundle ids round-trip through
LocalStorageso a Spotify selection survives across launches.
Ships the full picker: filter chips (All / None / Suggested / Custom) with
the suggested-app heuristic, a 250 ms debounced filter-apply, real app
icons (AUT-288 β inline PNG data: URLs from the backend, glyph fallback),
and the SCK-denial settings deep-link.
StructsΒ§
- System
Audio πBody Props - Props for the
SystemAudioBodycomponent. - System
Audio Picker Props - Props for the
SystemAudioPickercomponent.
EnumsΒ§
- Active
Chip π - Which filter-chip is visually active given the current picker
state.
Customis the implicit βuser hand-edited the checkboxesβ mode β no chip is mapped to it as a click target; it just lights up when none of the other three describe the current selection.
ConstantsΒ§
- SUGGESTED_
BUNDLE_ πPREFIXES - Suggested-app heuristic (M-AUDIO-SYS.3 / AUT-288). Best-effort baseline list of bundle-id prefixes the recorder thinks the user probably wants when they click the βSuggestedβ chip: browsers, media / streaming apps, and comm apps. Excludes system services + the recorder itself by omission.
FunctionsΒ§
- System
Audio πBody - Required Props
- System
Audio Picker <SystemAudioPicker />β master toggle + expandable per-app checklist.- apply_
filter_ πfrom_ selection - Build a filter from the current selection and push it to the
backend. Empty selection β
AllAudio(capture everything); non-empty βOnlyApps(capture just those). - base64_
encode π - Standard base64 (RFC 4648) of
input. Tiny + pure (no dep) so it runs in the native unit tests as well as wasm β used to inline the app-icon PNG (AUT-288) as adata:URL. - compute_
active_ πchip - Compute which chip should appear active. Order matters β when multiple chips could describe the state (e.g. empty selection could be βAllβ OR βSuggested produced no matchesβ), the most specific wins.
- icon_
data_ πurl - A
data:image/png;base64,β¦URL for the app icon (AUT-288), orNonewhen no icon was captured (empty bytes β the row then shows its glyph). The backend ships native-size PNGs;Noneis the headless / no-icon path. - read_
enabled π - read_
selected_ πids - render_
app_ πrow - same_
set π - Order-insensitive equality of two bundle-id lists.
- schedule_
filter_ πapply - suggested_
bundle_ πids - Walk the running-app list and pull out bundle ids whose prefix
is in
SUGGESTED_BUNDLE_PREFIXES. - summary_
label π - write_
enabled π - write_
selected_ πids