Upgrade Native SDK 0.8.0 -> 0.8.4, add track-change notifications - #31
Merged
Conversation
The HiDPI patch needed no edit: gtk_host.c changed by ~80 lines but every change falls outside the eight patched hunks, and regenerating against the pristine 0.8.4 tarball produced a byte-identical file. Only the two version pins move. Verified with gpu_scale=1.6666666 on the fractional display. 104/104 tests pass before and after with nothing under src/ changed -- Effects is additive, PlatformFeature is unchanged, and the automation protocol fingerprint is the same.
shouldNotifyTrack carries the whole decision as a pure predicate because fx.showNotification is inert and unrecorded under fake execution, so the effect call itself can never be observed by a test. notify_track is in view_unbound only until the back-panel switch binds it.
track_changed is hoisted out of the nowPlaying block so the notification fires after the show name is filled -- otherwise the toast would pair the new track with the previous show.
bell is not in the SDK's built-in icon set, so it ships as a registered app SVG reached from markup as app:bell.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the SDK pin from 0.8.0 to 0.8.4, and builds on the one thing in those four releases this app can actually use: desktop notifications.
What 0.8.4 gives us
fx.showNotificationis new, and it's wired on all three platforms we ship to (show_notification_fnis non-null in the macOS, Windows and Linux hosts). It takes{ title, subtitle, body }, bounded at 128 / 128 / 1024 bytes.That makes it the closest thing to a Now Playing surface the SDK offers, so the player now posts a toast when the track changes. The rule is background-only and on-air-only:
Each clause is there for a reason.
notify_trackis the opt-in.!app_activemeans no toast while you're looking at the player, because the LIVE stage already names the track and a toast every three minutes would just repeat it.live_now()keeps it quiet while tuned out, buffering or failed, since this is a player and not a station ticker.has_track()catches the first fill:got_npsetstrack_changedwhen the title flips from""on the very first fetch, and that's a launch artifact, not a song change.Off by default. An existing
settings.jsonhas nonotifyTrackkey, so nobody's update silently starts producing OS toasts. The switch is a new NOTIFICATIONS row in the back panel.Why the decision is a pure predicate
fx.showNotificationis inert and unrecorded under fake execution and session replay. There's nonotificationState()to assert on the waywindowActionState()exists for window verbs, so a test can never observe the call. Putting every gate inshouldNotifyTrackis what makes the feature testable at all; the effect call itself is one line with no branching.Also new, and skipped
Audio capture landed too (
startAudioCapture/stopAudioCapture/feedAudioCapture, asystem_audiopermission, amicicon). That's microphone input. A radio player has no use for it, so it's untouched.The four new markup attributes (
imageson<markdown>,submit-on-enter,max_width,on_drag) aren't adopted either. No existing view was waiting on any of them.Checked, not assumed
Effectspub fnlistshowNotification, the audio-capture verbs, threefeed*test helpersPlatformFeatureenum,*_fnplatform servicessrc/platform/linux/gtk_host.capp.zonmanifestsystem_audio0x096c8aa4730c11ec, unchanged, so existingnative automatecalls keep workingminimum_zig_version.events, so-Dtrace=offstays mandatoryStill no audio output-device API and still no OS media-controls surface (no MPRIS, MPNowPlayingInfoCenter or SystemMediaTransportControls) anywhere in the 0.8.4 tree. Both grepped for rather than carried forward. Upstream native#156, the fractional-scale bug the local patch works around, is still open.
The HiDPI patch needed no edit
I expected to regenerate it, because
gtk_host.cmoved. It turns out every change falls outside the eight patched hunks: applying the old patch to a pristine 0.8.4 tarball landed at zero offset with no rejects, and the regenerated diff came back byte-identical to the committed one (same md5). So onlypatch_sdk_versionmoved.All seven scale-reporting sites in the stock tree still read an integer API, four
gtk_widget_get_scale_factor()and threegdk_surface_get_scale_factor(), with zero uses of the fractionalgdk_surface_get_scale(). The patch is still load bearing.Both version pins moved together, which is the thing that broke the 0.6.0 upgrade:
patch_sdk_versioninscripts/apply-sdk-patches.shandnative-sdk-versionin.github/actions/setup-native/action.yml.Verification
native testpasses 106/106, up from 104/104 by the two new tests. The SDK upgrade itself changed nothing undersrc/: 104/104 before and after, with the app untouched.native checkclean, with the same pre-existingview_unboundwarnings as before.scripts/apply-sdk-patches.shstill idempotent (already applied, 1/1),scripts/check-release-flags.shpasses, andscripts/set-close-policy.shstill round-trips hide/quit after theapp.zonpermissions edit.gpu_scale=1.6666666, not the integer 2.value=0on a fresh model,widget-action toggleflips it tovalue=1, and"notifyTrack":truelands insettings.json. Screenshot checked by eye.One thing is not verified: an actual OS notification appearing. It needs the app to lose focus and then a real track change, and there's no automation verb to deactivate the app, so testing it would have meant moving windows around on my desktop. The effect is also unobservable under fake execution, so no test reaches it either. The predicate is tested gate by gate and the wiring compiles and validates, but the final hop from
fx.showNotificationto a visible toast is worth a manual check before this merges: turn the switch on, click away, wait for a song change.Docs
docs/sdk-notes.mdgets a 0.8.4 section covering the notification semantics, the audio-capture verbs we skip, and the patch finding. The re-checked-at claims inCLAUDE.md,README.mdanddocs/sdk-audio-device-request.mdmove forward, and the media-controls gotcha inCLAUDE.mdis revised, since it is no longer flatly true that there is no OS-facing now-playing surface at all.