Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ All notable changes will be documented here. The format follows [Keep a Changelo

### Added

- `FAD-0502` Application-row slice: asynchronous validated local PNG icons with text fallback, playing/idle/muted state, and accessible mixed-volume help. Output-device controls remain pending.

- `FAD-0202` Secure local PNG icon resolution with trusted XDG roots, bounded caching, and traversal, symlink, malformed-file, and size protections.
- `FAD-0203` Flatpak-first canonical identity from bounded sandbox metadata and exported host desktop entries.
- `FAD-0204` Optional Snap identity from corroborated wrapper metadata without invoking or depending on Snap tooling.
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ dotnet run --project src/Fadrio.Cli -- profile clear xdg:firefox

The override appears in subsequent `apps` output while the canonical ID remains unchanged.

Launch the in-development mixer with `dotnet run --project src/Fadrio.UI`. Its application rows reflect the live PipeWire snapshot and use the same application-wide volume/mute command path as the CLI. Output-device controls, icons, tray behavior, and UI polish remain on the roadmap.
Launch the in-development mixer with `dotnet run --project src/Fadrio.UI`. Its application rows reflect the live PipeWire snapshot and use the same application-wide volume/mute command path as the CLI. Application rows load validated local PNG icons asynchronously, fall back to an initial when artwork is missing or invalid, and show playback/mute state. Mixed-volume controls explain that an adjustment sets every owned stream to the same level. Output-device controls, tray behavior, and UI polish remain on the roadmap.

[See the current application-row screenshot](docs/screenshots/fad-0502-application-icon.png), captured with an isolated silent fixture and the normal host fonts.

[See the first live-row screenshot](docs/screenshots/fad-0501-live-fixture.png), captured with a controlled, silent PipeWire fixture rather than a user's applications.

Expand Down
4 changes: 4 additions & 0 deletions ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ Canonical ticket format:

- [x] `FAD-0501` `P0` Connect immutable mixer snapshots and commands to the Avalonia view models.
- [ ] `FAD-0502` `P1` Build accessible output and logical-application rows with mixed-volume state.
- Status: In progress
- Scope: Validated asynchronous local application icons, readable fallback/activity states, and mixed-volume help are the current application-row slice. Output-device rows remain pending.
- Acceptance: Accessible logical-application and output rows, verified mixed-volume behavior, local icon fallback, and rendered keyboard/mouse checks.
- Evidence: `docs/development/qualifying-application-rows.md`; this slice does not complete output control or REL-00006.
- [x] `FAD-0503` `P1` Add stable sorting, interaction freeze, empty, unavailable, and reconnect states.
- Scope: Deterministic active-row ordering and pointer/keyboard interaction freeze; connected-empty versus unavailable states and reconnect-safe commands. Persistent pinned/inactive rows remain FAD-0303.
- Acceptance: Rows are reused, structural changes wait until gesture end, removed targets disable immediately, queued commands are discarded on disconnect, and rendered controls recover after an isolated daemon restart.
Expand Down
2 changes: 2 additions & 0 deletions docs/design/icons.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ Icon resolution order is user override, desktop entry, PipeWire icon name, local
Bundled icons require editable source and known licensing. Runtime-resolved installed icons are not automatically redistributable repository assets. Cap file size and dimensions, allow only supported local formats, and never download icons from the network in v1.

The current local resolver accepts PNG files only. It searches configured XDG icon roots with a bounded, deterministic traversal, rejects URLs and paths outside those trusted roots (including symlink escapes), and validates the PNG signature and dimensions before copying it. Cached files live under `$XDG_CACHE_HOME/fadrio/icons/`, are keyed by source path plus modification signature, and are pruned by both entry count and total bytes. Vector decoding and rasterization remain out of scope until they can use a reviewed decoder.

The application UI loads these validated PNGs on background workers, limits parallel loads to two, and decodes thumbnails with both dimensions bounded by 64 pixels. Missing or undecodable artwork shows the first Unicode text element of the application name. Detached rows cancel obsolete loads and dispose their bitmaps. SVG-only installed icons use the fallback.
48 changes: 48 additions & 0 deletions docs/dev-diaries/003-icons-that-cannot-crash-the-mixer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
> Status: Draft; not published.
> Suggested community: r/Fadrio; flair: Development Update.
> Website slug: fadrio-dev-diary-03-icons-that-cannot-crash-the-mixer
> Image: docs/screenshots/fad-0502-application-icon.png (actual isolated silent fixture).

# Fadrio Dev Diary #3 — An icon should not be able to crash a mixer

Fadrio is the Linux application mixer I want to use myself: one recognizable application, one slider, and one mute action, even when that application owns several playback streams. This update makes those rows easier to recognize. It also found a surprisingly enthusiastic failure mode for a tiny PNG.

## From identity to something you can recognize

The resolver already knew where to find trusted local application icons. The window now actually uses them. Each row loads its validated PNG in the background, shows the application name beside it, and falls back to a readable initial when the artwork is missing or invalid.

The loading path keeps the existing rules: local XDG roots only, bounded file sizes and dimensions, a bounded disk cache, and no downloading. Only two searches/decodes run at once. The decoded thumbnail fits inside 64 × 64 pixels, including unusually tall or wide images. When a row disappears or its icon changes, obsolete work is canceled and replaced bitmaps are disposed.

There is a deliberate limitation here: this path currently supports PNG. An installed application with only an SVG icon gets the fallback. A missing icon should be a small visual inconvenience, not a reason to make the audio controls disappear.

## The PNG that had a header and very little ambition

For the rendered regression check, I copied the first 24 bytes of a valid PNG and left out the actual image data. The existing resolver accepted the signature and dimensions. Avalonia.Skia 12.1.2 then attempted to use a null codec and threw a `NullReferenceException`.

That originally took down the window. The UI now contains that specific decoder failure at the decode boundary and displays the initial instead. The real desktop check then drags the slider and toggles mute on the same fixture. This is why I want visual tests alongside unit tests: a plausible image header and a working mixer are different achievements.

The icon has been relieved of its responsibilities as application supervisor.

## What “mixed” means when one application has several streams

The row also shows a textual playback/mute state. `Playing` comes from the existing stream activity state; it is not a new signal meter. `Muted` does not depend on spotting a different color.

For multiple streams with different levels, the row retains the mixed-volume label. The tooltip and accessibility help now explain the action: moving the slider sets **every owned stream to the same level**. It does not silently preserve a ratio or invent a separate routing policy. Backend refreshes still reuse the same row objects, and an active gesture keeps its position while other applications change.

## What I actually checked

The local build passes **109 managed tests**, including 23 UI cases, plus two native tests, six Python roadmap/synchronization tests, and the isolated PipeWire integration scenario. Formatting and roadmap checks also pass.

In the actual 360 × 680 Avalonia window on this GNOME Wayland desktop through XWayland, the isolated silent fixture reaches 37% with a drag and 10% with Home plus ten Right keys. The mute button works. The controls remain usable after the damaged icon, and work again after stopping the private PipeWire daemon during a drag and restarting it.

The screenshot shows that controlled fixture and Fadrio's own icon. It is not a mockup or somebody's private application list.

Normal host-font startup also reached the window today. The previous startup stall did not reproduce, so I am keeping that investigation open rather than pretending to have found its cause. No host fonts were removed or restricted.

## Still an alpha, still development work

This is an application-row slice in FAD-0502. Output-device controls, tray/single-instance behavior, pinned/inactive rows and durable volume policies still need work. The broader KDE, native Wayland, scaling and screen-reader qualification matrix remains open. There is no new supported binary release from this change.

The implementation is under review; this diary is a draft for the website and Reddit, not a release announcement.

For a daily mixer, which missing behavior would you prioritize next: remembered application levels, pinned controls for applications that are currently silent, or quick access from the tray?
31 changes: 31 additions & 0 deletions docs/development/qualifying-application-rows.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# FAD-0502 application-row slice

Recorded on 2026-10-06 on the local GNOME Wayland desktop through XWayland. This is application-row progress; output-device controls and the REL-00006 desktop matrix remain open.

## Behavior

Rows display the resolved identity's local PNG icon, or the first Unicode text element of the application name when artwork is missing, rejected, or undecodable. The existing local resolver enforces trusted XDG roots, source/dimension limits, and bounded disk caching. No network access or SVG decoder is added. Two concurrent background loads are allowed; decoded thumbnails fit within 64 x 64 pixels. Reference changes and row detachment cancel obsolete loads, clear the old image, and dispose replaced or stale bitmaps. Backend snapshots do not wait for artwork.

The fallback adds no tab stop; application name, slider and mute remain the usable controls. Long names have a tooltip. Mixed-volume help is available both as a tooltip and automation help text: a slider adjustment sets every owned stream to the same level. Playing/Idle reflects the existing backend stream state, not measured signal amplitude; Muted is explicit text. Screen-reader conformance remains unqualified.

A header-only PNG passed the resolver's header check but caused Avalonia.Skia 12.1.2 to dereference a null codec in `ImmutableBitmap`. The UI contains that specific exception at the decode boundary, uses the text fallback, and keeps the row usable. The desktop harness retains this real malformed-input regression; it is not a synthetic claim that all image decoders are safe.

## Local validation

- `FADRIO_RUN_PIPEWIRE_INTEGRATION=1 ./scripts/test.sh`: 109 managed tests, two native tests, and isolated PipeWire integration passed.
- Seven additional UI cases cover icon/reference refresh on a reused row, Unicode fallback, activity/mute state, and mixed-volume explanation after adjustment. The UI suite has 23 cases.
- Six Python roadmap/synchronization tests, roadmap audit, formatting verification, and whitespace check passed.
- `./scripts/test-ui-interactions.sh` with default `FADRIO_UI_FONT_MODE=host`: rendered icon, 37% drag, Home + ten Right keys to 10%, mute, usable controls after a header-only icon, disconnect during drag, and controls after isolated daemon restart.
- The native bridge and Core dependencies are unchanged. No ordinary host audio is modified by the harness.

![Validated fixture icon](../screenshots/fad-0502-application-icon.png)

![Malformed-icon fallback](../screenshots/fad-0502-icon-fallback.png)

The screenshots show the actual 360 x 680 Avalonia window with a silent, controlled `Fadrio Fixture` stream and the project's own licensed icon, not third-party application artwork or a design mockup.

## Startup observation and limits

The normal host-font configuration reached the mixer in the bounded local checks; the retained harness records whole-second window readiness in `startup.txt`. There are 2,773 entries in this host's current `fc-list` output. No fonts or host caches were removed or restricted. The old BUG-00004 stall did not reproduce, so its original root cause remains unknown and the ticket stays open. Rider could list configurations but reported that its debug launch did not start; the direct window/trace and harness are the runtime evidence here.

The harness locates the slider from its actual rendered track with Python Pillow, rather than assuming fixed font metrics. It asks GNOME to activate the owned window through `_NET_ACTIVE_WINDOW`, verifies X keyboard focus, explicitly focuses the recreated slider, and polls observed backend state with a bounded timeout after asynchronous commands. Direct X input-focus assignment alone produced intermittent keyboard-probe failures. The harness defaults to inherited host fonts. `FADRIO_UI_FONT_MODE=fixture` is an explicit process-local alternative for fixture diagnosis. A screenshot/control result is not KDE, native Wayland, fractional scaling, packaged installation, or long-running qualification. PNG-only loading means some installed SVG-only icons use the fallback. Unchanged references are loaded on attach/reference change; file watching for already displayed artwork is not implemented in this slice.
6 changes: 3 additions & 3 deletions docs/development/qualifying-ui-interactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ After a normal local build, close other Fadrio windows and run:
./scripts/test-ui-interactions.sh
```

This optional developer harness requires an X11/XWayland display, DejaVu fonts, X11/XTest libraries, `xwininfo`, `xprop`, `ffmpeg`, PipeWire tools, Python and .NET. It injects mouse/keyboard events into the exact Fadrio window whose process ownership it verifies. Do not interact with the desktop while it runs. It restores the prior pointer/focus and terminates only its owned processes. Its private runtime/data/cache directory is retained with logs and screenshots; the path is printed at exit. It is not part of headless CI or the supported-desktop matrix.
This optional developer harness requires an X11/XWayland display, DejaVu fonts, X11/XTest libraries, `xwininfo`, `xprop`, `ffmpeg`, PipeWire tools, Python with Pillow and .NET. It injects mouse/keyboard events into the exact Fadrio window whose process ownership it verifies. Do not interact with the desktop while it runs. It restores the prior pointer/focus and terminates only its owned processes. Its private runtime/data/cache directory is retained with logs and screenshots; the path is printed at exit. It is not part of headless CI or the supported-desktop matrix.

The fixture intentionally sets a process-local minimal Fontconfig configuration. It does not change host fonts or ship a restricted-font workaround in the app.
The harness now defaults to the inherited host Fontconfig configuration. Set `FADRIO_UI_FONT_MODE=fixture` explicitly for the process-local minimal font fixture. It never changes host fonts. Current evidence is in [qualifying-application-rows.md](qualifying-application-rows.md).

## Open qualification limits

- `BUG-00004`: normal launch with this host's full Fontconfig configuration stalled before `App.Initialize`, consuming a CPU core. The startup trace showed font/cache enumeration. A restricted process-local DejaVu configuration allowed the window to open; a software-rendering attempt did not resolve normal startup. This isolates a useful investigation path, not a proven upstream cause or a production fix. Default host-font startup is unqualified.
- Historical `BUG-00004` observation (2026-09-27): normal launch with this host's full Fontconfig configuration stalled before `App.Initialize`, consuming a CPU core. The startup trace showed font/cache enumeration. A restricted process-local DejaVu configuration allowed the window to open; a software-rendering attempt did not resolve normal startup. This isolates a useful investigation path, not a proven upstream cause or a production fix. Default host-font startup is unqualified.
- The checks above are XWayland, not native Wayland, KDE, screen-reader, fractional-scaling, packaged installation or long-running qualification. Those gates remain open.
- Output control, icons, persistence of pinned/inactive rows, tray integration and localization are still later roadmap work. No new release is justified by this slice alone.
2 changes: 1 addition & 1 deletion docs/development/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ The opt-in isolated PipeWire test is enabled with `FADRIO_RUN_PIPEWIRE_INTEGRATI
Browser qualification evidence and its reproducible checklist are documented in [qualifying-browser.md](qualifying-browser.md).
PipeWire restart and command-recovery evidence is documented in [qualifying-reconnect.md](qualifying-reconnect.md).
Native ownership and sanitizer coverage is documented in [native-sanitizers.md](native-sanitizers.md).
Rendered mixer gesture/reconnect evidence and the opt-in desktop test are documented in [qualifying-ui-interactions.md](qualifying-ui-interactions.md). That check uses process-local fixture fonts; it does not qualify the separately tracked full-host-font startup issue.
Rendered mixer gesture/reconnect evidence and the opt-in desktop test are documented in [qualifying-ui-interactions.md](qualifying-ui-interactions.md). That check now defaults to host fonts and covers malformed application-icon fallback; see [the current row qualification](qualifying-application-rows.md). The original font-startup cause and the wider desktop matrix remain open.
Binary file added docs/screenshots/fad-0502-application-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshots/fad-0502-icon-fallback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading