Shell 28: platform-shortcuts-on-wayland (#820) #905
Closed
charles
wants to merge 0 commits from
shell-28-platform-shortcuts-on-wayland into shell
pull from: shell-28-platform-shortcuts-on-wayland
merge into: charles:shell
charles:main
charles:camera
charles:dailyuse
charles:textchat
charles:fix-1008-idle-in-voice
charles:camera-21-acceptance
charles:feat-1000-app-sounds-output
charles:fix-1001-local-time
charles:camera-20-parity-list-for-the
charles:fix-931-silent-voices
charles:camera-15-ui-settings-voice-video
charles:camera-14-ui-camera-buttons-camera
charles:camera-16-ui-layout-with-cameras
charles:camera-17-core-toggle-camera-shortcut
charles:camera-13-ui-mirrored-video-and
charles:camera-12-appsfluxer-camera-runtime-and
charles:camera-10-capture-camera-on-linux
charles:camera-11-capture-camera-on-windows
charles:camera-9-voice-the-camera-track
charles:camera-7-core-the-own-camera
charles:camera-6-capture-camera-trait-mode
charles:camera-8-core-remote-cameras-tile
charles:camera-3-spike-a-camera-track
charles:camera-4-video-camera-formats-and
charles:camera-18-devserver-camera-scenario
charles:camera-1-spike-capture-linux
charles:camera-5-core-camera-ports-commands
charles:camera-2-spike-capture-windows
charles:camera-plan
charles:shell
charles:fix-925-keybinds-persist
charles:feat-934-935-stream-view
charles:feat-933-stream-output-device
charles:shell-44-acceptance
charles:feat-946-select-message-text
charles:shell-43-parity-list-for-the
charles:fix-589-black-band-linux-sender
charles:shell-37-ui-system-wide-shortcuts
charles:shell-ship
charles:fix-931-voices-silent-after-long-uptime
charles:shell-39-ui-settings-notifications
charles:shell-36-ui-settings-keybinds
charles:shell-16-core-autostart
charles:fix-923-late-publication-next-share
charles:fix-921-share-teardown-publish-race
charles:shell-1-spike-iced-daemon-hide
charles:shell-10-core-instance-messages-tasks
charles:shell-11-core-keybinds-actions-combos
charles:shell-13-core-badge-attention-sound
charles:shell-14-core-notification-settings-inactive
charles:shell-18-platform-desktop-entry-and
charles:shell-2-spike-tray-on-linux
charles:shell-3-spike-wayland-global-shortcuts
charles:shell-41-devserver-shell-scenario
charles:shell-5-spike-overlay-technique-for
charles:shell-6-core-shell-ports-settings
charles:shell-7-platform-settings-shell-keybinds
charles:shell-8-core-tray-model-and
charles:shell-9-core-window-rules-close
charles:fix-913-keep-awake-retry
charles:shell-35-ui-in-window-voice
charles:shell-sync-textchat
charles:shell-34-app-shortcuts-runtime
charles:fix-913-keep-screen-awake
charles:fix-910-deepfilter-windows-timing
charles:shell-33-app-shell-runtime
charles:fix-910-deepfilter-late-frame
charles:shell-29-platform-shortcuts-by-direct
charles:shell-27-platform-shortcuts-on-x11
charles:shell-17-platform-single-instance
charles:shell-24-platform-badge-displays-and-24
charles:shell-26-platform-shortcuts-on-windows
charles:shell-21-platform-tray-on-linux
charles:shell-22-platform-tray-on-windows
charles:fix-908-flaky-stream-end-test
charles:shell-30-platform-wayland-activation
charles:shell-38-ui-settings-desktop
charles:shell-19-platform-autostart
charles:shell-25-platform-shortcut-back-end
charles:shell-23-platform-badge-displays-and
charles:shell-40-ui-companion-apps-control
charles:shell-31-statusapi-default-avatars
charles:shell-12-core-system-wide-shortcut
charles:shell-20-platform-tray-trait-icons
charles:shell-32-ui-daemon-window-lifecycle
charles:shell-4-spike-raising-a-wayland
charles:shell-15-core-status-payload-gaps
charles:fix-876-share-resolution-and-bars
charles:shell-42-packaging-windows-shortcuts-and
charles:fix-874-tests-must-not-notify
charles:fix-868-deepfilternet-start
charles:gamenight-plan
charles:fix-867-869-stream-end-soundboard-limits
charles:feat-229-windows-hardware-encoding
charles:fix-857-vaapi-hardware-encoding
charles:fix-849-inert-cards
charles:fix-848-pinned-messages-clickable
charles:shell-plan
charles:fix-764-nvenc-above-720p30
charles:serveradmin
charles:feat-780-forum-archived-filter
charles:serveradmin-35-acceptance
charles:feat-781-no-join-chime-with-entrance-sound
charles:feat-784-rejoin-voice-after-update
charles:fix-779-782-search-dropdown-paste-preview
charles:fix-783-781-dm-rail-entrance-sound
charles:serveradmin-34-parity-screenshots
charles:serveradmin-31-ui-channel-permissions
charles:fix-773-cargo-deny-advisories
charles:serveradmin-33-ui-sudo-delete-transfer
charles:serveradmin-28-ui-members-page
charles:serveradmin-26-ui-role-permissions
charles:serveradmin-30-ui-voice-overview-channel-invites
charles:serveradmin-fix-27-29
charles:serveradmin-25-ui-roles-tab
charles:serveradmin-27-ui-menus-moderation-modals
charles:serveradmin-29-ui-channel-settings
charles:fix-589-stream-top-strip-encode
charles:serveradmin-24-ui-moderation-invites-bans
charles:feat-760-version-in-title
charles:fix-751-stream-audio-pipewire
charles:serveradmin-20-core-menu-rows
charles:fix-752-linux-notification-panic
charles:serveradmin-17-core-overrides
charles:fix-740-updater-always-latest
charles:serveradmin-23-ui-community-settings-overview
charles:serveradmin-12-core-roles
charles:serveradmin-19-core-sudo-delete-transfer
charles:serveradmin-32-ui-sidebar-drag
charles:serveradmin-15-core-members-page
charles:serveradmin-16-core-channel-settings
charles:serveradmin-14-core-bans-invites
charles:fix-615-restore-on-stored-session-start
charles:serveradmin-22-runtime
charles:serveradmin-13-core-member-moderation
charles:serveradmin-18-core-channel-reorder
charles:fix-732-status-api-speaking
charles:serveradmin-10-core-permission-lists
charles:serveradmin-11-core-forms-community
charles:serveradmin-21b-devserver-channels-members-sudo
charles:serveradmin-4-api-community-roles-sudo
charles:serveradmin-9b-core-hierarchy-bulk-events
charles:serveradmin-21a-devserver-community-roles
charles:serveradmin-9a-core-ports
charles:serveradmin-8-form-widgets
charles:serveradmin-5-api-channels-members-bans
charles:serveradmin-7-settings-shell
charles:serveradmin-1-proto-community-roles
charles:serveradmin-3-proto-members-bans-invites
charles:serveradmin-6-reorder-widget
charles:serveradmin-2-proto-channel-admin
charles:fix-706-presence-after-reconnect
charles:fix-615-start-on-last-view
charles:feat-663-create-channel
charles:serveradmin-plan
charles:fix-662-long-text-wrap
charles:fix-660-661-menu-toolbar-paste-focus
charles:fix-620-forum-list-reactions
charles:fix-657-windows-console
charles:fix-622-emoji-in-names
charles:fix-smoke-645-648
charles:fix-614-install-location
charles:dailyuse-41-acceptance
charles:fix/597-copy-id
charles:dailyuse-40-parity-screenshots
charles:dailyuse-35-ui-quick-switcher-keybinds
charles:dailyuse-38-ui-profile-modal
charles:fix/voice-view
charles:fix/side-panel-composer
charles:dailyuse-37b-ui-composer-barriers-blocked
charles:fix/image-viewer
charles:fix/619-picker-flicker
charles:fix/editor-forum-edit
charles:dailyuse-32-ui-status-picker
charles:dailyuse-34b-ui-add-guild-invite-modal
charles:dailyuse-28-app-dailyuse-runtime
charles:dailyuse-36-ui-voice-badge-refusals
charles:fix/594-menu-placement-textchat
charles:fix/589-stream-top-strip
charles:fix/594-menu-placement
charles:dailyuse-39-ui-report-modal
charles:dailyuse-37a-ui-attachment-audio-group-icon
charles:dailyuse-24-core-notification-icon-passive
charles:fix/587-quiet-voice
charles:dailyuse-30-ui-notification-settings-modal
charles:dailyuse-31-ui-user-dm-menus
charles:dailyuse-22b-core-composer-barriers-blocked
charles:dailyuse-22a-core-mark-unread-attachments
charles:dailyuse-29-ui-channel-guild-menus
charles:dailyuse-18-core-user-dm-menus
charles:dailyuse-33-ui-confirm-friends-page
charles:dailyuse-22c-core-trusted-domains-hide-muted
charles:dailyuse-20-core-keyboard-navigation
charles:dailyuse-15-core-friends-blocking
charles:dailyuse-23-core-profile-report-flow
charles:dailyuse-19-core-quick-switcher
charles:dailyuse-14-core-status-idle-presence
charles:dailyuse-17-core-channel-guild-menus
charles:ci/27-linux-cache
charles:dailyuse-37c-ui-trust-links-hide-muted
charles:dailyuse-13-core-honour-mutes
charles:dailyuse-34a-ui-invite-cards-accept
charles:dailyuse-16b-core-create-invites-guilds
charles:dailyuse-12-core-notification-settings-mutes
charles:dailyuse-16a-core-invite-links
charles:dailyuse-25-audio-attachments
charles:dailyuse-21-core-voice-refusals
charles:dailyuse-11b-core-state-skeleton
charles:dailyuse-11a-core-dailyuse-ports
charles:dailyuse-26b-devserver-dailyuse-b
charles:dailyuse-26a-devserver-dailyuse-a
charles:dailyuse-4-api-settings-acks-reports
charles:dailyuse-5-api-relationships-invites-guilds
charles:dailyuse-27-platform-notification-idle
charles:dailyuse-10-highlight-languages
charles:fix-search-focus-hover-emoji
charles:dailyuse-8-context-menu-widget
charles:dailyuse-9-image-load-retry
charles:dailyuse-7-chat-navigation-persistence
charles:dailyuse-2-proto-relationships-invites-reports
charles:dailyuse-1-proto-notification-presence
charles:dailyuse-6-gateway-op12-presence
charles:textchat-next
charles:fix-stream-black
charles:fix-reactions-hover
charles:textchat-68-app-video-playback-runtime
charles:textchat-35-acceptance
charles:textchat-34-parity-screenshots
charles:textchat-74-app-updater-runtime
charles:textchat-67-ui-video-player
charles:textchat-stage-46-47
charles:textchat-47-ui-media-channel
charles:textchat-75-promote-stable-workflow
charles:textchat-46-ui-forum-composer
charles:textchat-73-ui-update-button
charles:textchat-64-media-playback-crate
charles:textchat-stage-43-48
charles:textchat-72-platform-updater
charles:textchat-44-ui-thread-view
charles:textchat-70-release-update-feed
charles:textchat-48-ui-announcements
charles:textchat-45-ui-forum-view
charles:textchat-71-core-updater
charles:textchat-43-ui-sidebar-links-notes
charles:textchat-stage-40
charles:textchat-42-app-channel-types-runtime
charles:textchat-39-core-forums
charles:textchat-40-core-announcements-thread-admin
charles:textchat-60-ui-entrance-sounds
charles:textchat-63-ffmpeg-lgpl-packaging
charles:textchat-stage-batch6
charles:textchat-69-proto-update-manifest
charles:textchat-61-app-soundboard-entrance-runtime
charles:textchat-52-app-audio-devices-runtime
charles:textchat-38-core-channel-routing
charles:soundboard-effect-emoji
charles:status-api-rebind
charles:textchat-28-ui-gif-picker
charles:textchat-41-devserver-channel-types
charles:voice-panel-soundboard
charles:textchat-29-ui-message-actions
charles:textchat-37-api-channel-types
charles:textchat-66-core-video-players
charles:autoupdate-plan
charles:textchat-33-ui-message-list-settings
charles:textchat-32-ui-dms
charles:textchat-62-rename-flaxative
charles:fix-chatcolumn-tree
charles:textchat-65-audio-media-source
charles:textchat-31-ui-threads
charles:textchat-stage-27
charles:textchat-30-ui-search-pins-inbox
charles:textchat-53-ui-audio-sources-menu
charles:textchat-27-ui-expression-picker
charles:textchat-57-core-entrance-library
charles:textchat-36-proto-channel-types
charles:textchat-26-ui-upload-tray
charles:textchat-59-ui-soundboard-popout-parity
charles:textchat-58-audio-sound-edit
charles:textchat-55-proto-api-entrance-library
charles:textchat-25-ui-composer
charles:textchat-56-core-soundboard-parity
charles:rename-video-plan
charles:textchat-stage-25
charles:textchat-stage-23-24
charles:soundboard-plan
charles:textchat-24-ui-message-row
charles:textchat-22-ui-attachments-media
charles:textchat-23-ui-embeds
charles:textchat-14-core-expressions
charles:textchat-21-app-textchat-runtime
charles:textchat-16-core-navigation-read
charles:textchat-17-core-search
charles:textchat-19-core-dms-settings
charles:textchat-stage-13-15-18
charles:textchat-54-livekit-stereo-audio
charles:textchat-50-core-stream-audio-sources
charles:textchat-12-core-uploads
charles:textchat-15-core-message-actions
charles:textchat-11-core-composer
charles:textchat-18-core-threads
charles:textchat-13-core-reactions
charles:textchat-51-audio-pipewire-devices
charles:textchat-49-capture-audio-targets
charles:audio-plan
charles:textchat-plan2
charles:textchat-20-devserver-textchat
charles:textchat-6-api-chat-endpoints
charles:textchat-10-core-chat-ports
charles:textchat-9-ui-code-highlighting
charles:textchat-3-proto-expressions-threads-prefs
charles:textchat-5-api-messages-uploads
charles:textchat-2-proto-chat-requests-events
charles:textchat-8-ui-inline-flow-emoji
charles:screenshare
charles:textchat-7-platform-files-clipboard
charles:textchat-1-proto-message-content
charles:textchat-4-emoji-crate
charles:screenshare-31-acceptance
charles:screenshare-29-parity-screenshots
charles:textchat-plan
charles:screenshare-24-ui-focus-layout
charles:screenshare-27-ui-stream-menu
charles:screenshare-30-packaging-ci
charles:screenshare-21-app-screenshare-runtime
charles:screenshare-22-ui-sidebar-live
charles:screenshare-23-ui-stream-tile
charles:screenshare-26-ui-source-picker
charles:screenshare-28-ui-screenshare-settings
charles:screenshare-13-core-previews
charles:screenshare-12-core-codec-negotiation
charles:screenshare-25-ui-share-controls
charles:screenshare-18-hw-encode-linux
charles:screenshare-19-spike-hw-encode-windows
charles:screenshare-11-core-stream-params
charles:screenshare-20-devserver-screenshare
charles:screenshare-10-core-go-live
charles:screenshare-17-voice-livekit-video
charles:screenshare-14-audio-capture-linux
charles:wip/screenshare-17
charles:screenshare-integration
charles:feat-user-profile
charles:fix-voice-join
charles:feat-entity-images
charles:screenshare-16-voice-video-session
charles:screenshare-9-core-watching
charles:screenshare-5-capture-windows
charles:fix-wire-livekit
charles:screenshare-4-capture-linux
charles:screenshare-15-audio-capture-windows
charles:fix-member-list
charles:screenshare-8-core-stream-ports
charles:fix-live-protocol
charles:screenshare-6-ui-video-widget
charles:screenshare-3-capture-crate
charles:fix-altcha-captcha
charles:screenshare-1-video-frames
charles:screenshare-7-proto-api-streams
charles:screenshare-2-spike-livekit-video
charles:voice
charles:voice-26-acceptance
charles:voice-23-voice-e2ee
charles:voice-25-packaging-ci
charles:voice-13-voice-livekit-interop
charles:voice-24-parity-screenshots
charles:voice-19-ui-soundboard
charles:voice-20-ui-participant-menu
charles:voice-22-ui-dm-calls
charles:voice-21-ui-voice-settings
charles:voice-18-ui-call-view
charles:voice-14-app-voice-runtime
charles:voice-10-core-soundboard
charles:voice-17-ui-voice-panel
charles:voice-9-core-voice-settings-advert
charles:voice-5-audio-clips-chimes
charles:voice-15-devserver-voice
charles:voice-8-core-live-room-volumes
charles:voice-11-core-calls-status
charles:voice-12-voice-session
charles:voice-4-audio-devices-mixer
charles:voice-16-ui-voice-sidebar
charles:voice-7-core-voice-connection
charles:foundation
charles:voice-2-proto-api-soundboard-rtc
charles:voice-6-core-voice-states
charles:voice-3-audio-dsp
charles:voice-1-proto-voice-gateway
charles:task/26-acceptance
charles:task/25-packaging-release
charles:task/24-screenshot-tests
charles:task/20-ui-message-list-composer
charles:task/22-ui-settings-parity
charles:task/18-ui-main-layout
charles:task/23-notifications
charles:task/17-ui-shell-login
charles:task/14-app-runtime
charles:ci/51-windows-disk-space
charles:task/12-platform-persistence
charles:task/13-devserver
charles:task/21-ui-avatar-image-cache
charles:task/10-core-messages-readstate
charles:task/9-core-guilds-channels
charles:task/7-gateway-machine-transport
charles:task/11-core-presence-ui
charles:task/19-ui-rich-text
charles:task/8-core-store-session
charles:task/16-ui-theme-fonts-icons
charles:task/15-status-api
charles:task/4-proto-gateway-events
charles:task/5-openapi-vendor-contract
charles:task/6-api-client
charles:task/3-proto-rest-models
charles:task/2-proto-primitives
charles:task/1-workspace-scaffold
No reviewers
Labels
Clear labels
bug
A bug found while working on something else; steps to reproduce and the commit seen on
ci
Build, CI runners and workflows
follow-up
Deferred reviewer finding, linked from the PR it came from
good-first-task
Small, well-scoped, no cross-crate knowledge needed
parity
Settings/behaviour parity with the Electron client
question
Design question that needs Charles; blocks its task until answered
ready-to-merge
Reviewer approved, foundation merged in, CI green on both runners; waiting for the orchestrator to merge
task
A plan task (one per Foundation plan task)
No labels
bug
ci
follow-up
good-first-task
parity
question
ready-to-merge
task
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
charles/fluxer-native!905
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "shell-28-platform-shortcuts-on-wayland"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on: shell-3-spike-wayland-global-shortcuts, shell-18-platform-desktop-entry-and, shell-25-platform-shortcut-back-end (Shell 3 and 18 are already on
shell; Shell 25 is merged into this branch).What this builds
crates/fluxer-platform/src/shortcuts/portal.rs:PortalBackend, theGlobalShortcutsportal back end (ashpd0.14, Linux only), built from the Shell 3 spike, withsystem_backend(BackendKind::Portal)returning it.start, and every laterstart, which is how core's recovery reopens): a new bus connection whose first portal call isorg.freedesktop.host.portal.Registry.Register("flaxative")(refused without Shell 18's desktop entry: reported asregistered: false, and the session opens anyway), thenCreateSessionandListShortcuts. The result isOpened { version, registered, listed }, orOpenFailedclassified as the original'sclassify_*_error/classifyOpenFailure. No answer within 30 s (OPEN_TIMEOUT, the original'sSETUP_TIMEOUT) isTimeout.portal_bind):BindShortcutswith every global-capable action, inShortcutAction::ALLorder, with its label and the XDG trigger of its first global combo as preferred trigger. There is no timeout on the desktop's dialog. As the original'sbind_step: response 1 isCancelledand response 2 isDenied; an empty success is checked withListShortcuts, and an empty list there isDenied.portal_configure):ConfigureShortcutson version 2. On version 1, or when the portal answers UnknownMethod or Failed, it reportsConfigureUnsupported.Activated/Deactivated→BackendOutput::Event.Activatedis ignored for a hold. For a toggle it is ignored unless 1.5 s have passed since the last one; then it gives a release and a press (TOGGLE_REARM,D/LinuxGlobalShortcutsPortal.ts:462-475).Deactivatedis deliveredHOLD_RELEASE_DEBOUNCE(60 ms) later, unless anActivatedfor it arrives first. In that case neither reaches core (KDE bug 484525; the reason is in the module doc). A press is never invented.ShortcutsChangedreleases at once every held action whose trigger changed or went away (ashandleShortcutsChanged), then reportsTriggers.Session.Closedreleases every hold and reportsSessionLost(Closed). The portal's name changing owner does the same withSessionLost(PortalRestarted).Available. It is watched after a failed open as well.stopreleases everything (including a pending debounce), closes the session, joins every thread and reportsStoppedonce.Deviations from the plan (please look)
PortalUpdate::Shell(fluxer_core::shell::PortalUpdate)is appended to the platform'sPortalUpdate, and the back end reports everything through it. Shell 25's variants (Version,Unregistered,Bound,Denied,Triggers,Reconnecting) were written before core's portal machine (Shell 12), and they cannot carry what core takes: the open result as one update, cancelled and failed binds, unassigned triggers, the reason for a loss, and the portal appearing.PortalUpdate::into_shell()converts any variant for Task 34. The plan's "owner changing →Reconnecting" is thereforeSessionLost(PortalRestarted), which is whatinto_shellmapsReconnectingto, and "unregisteredreported" isOpened { registered: false }.ShortcutBackend:portal_bind()andportal_configure(). They are no-ops except on the portal. Shell 25's trait had no way to carryShortcutsCommand::{PortalBind, PortalConfigure}.FakeBackendkeeps the defaults, and Task 34 can record them there if it needs to.CreateSessionOptionscannot be set), so it is not the plan's fixed token. Nothing depends on it, because every open uses a new connection and so gets a new session path.OpenFailed, not as an error ofstart.startreturnsOkand sendsStarted(Portal), because core's portal machine decides what an open failure means. Astartwhile running reopens and does not sendStartedagain.Interfaceerror (noGlobalShortcutsinterface) isUnsupported, as the original'sunsupported:interface. Core's doc comment ofPortalOpenFailure::NoPortalmentions "no interface"; the original is followed here.Tests
tests/portal_shortcuts_bus.rs, modulebackend(17 tests on Task 3's fake portal on a privatedbus-daemon; the fake gainedSession.Closed):registers_then_creates_session,unregistered_is_reported_and_the_session_still_opens,listed_shortcuts_are_reported_on_open,no_portal_fails_to_open,bind_sends_all_actions_with_triggers,bound_reports_the_assigned_triggers,denied_bind_reported(empty → denied, cancel → cancelled),activated_deactivated_map_to_events,hold_release_debounced_and_cancelled_by_press,toggle_rearmed_after_repeat,repeated_hold_press_is_ignored,changed_triggers_reported_and_released,closed_session_is_lost_and_releases,portal_restart_reconnects,v1_has_no_configure,stop_releases_what_is_held,updates_print_no_trigger.portal.rs: theHoldstiming (debounce, cancel by press, toggle rearm, release all), the trigger-change rule,definitions, and the error classification.FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciis green locally. The base gate before any code of this task hit one flake inxtask/tests/package.rs("Text file busy" on spawning the AppImage, while another worktree ran its gate); it passed on its own when re-run. Opened as #903.PortalBackend::new(), and no test calls that. The hand checks on KDE Plasma 6 Wayland belong to Task 44: push-to-talk through the portal with another key tapped during the hold, a toggle, changing a trigger in System Settings, and restartingxdg-desktop-portal.Strings: the labels sent to the portal are core's
ShortcutAction::label(), which matches the original'sGLOBAL_SHORTCUT_DEFAULT_DESCRIPTIONS. No new strings.Keys: nothing is logged except the open failure's kind and the loss's reason.
Definition's andPortalUpdate::Shell'sDebugoutput prints no trigger, and a test checks this.Closes #820
🤖 Generated with Claude Code
https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Review: Shell 28 (portal back end), reviewed at
945fde70(diff 4a7f4a1c..945fde70)Gate:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask cirun in a separate review worktree: all steps passed.portal_shortcuts_buspassed 29/29, including the 17backend::*tests.Checked:
PortalBackend,system_backend(Portal)(Linux;Noneelsewhere under cfg),HOLD_RELEASE_DEBOUNCEandTOGGLE_REARMare named constants, and the module doc gives the reason for the debounce.tracing::calls are on?failureand?reason.Definition,PortalUpdate::Shelland core'sPortalShortcutall redact the trigger, and ashpd is built without itstracingfeature, which would log call bodies. Nothing from the bus can panic. No secrets.mod portaland thePortalarm arecfg(linux), with acfg(not(linux))Portal => None.PortalUpdate::Shellandinto_shellonly use core types, so they build on every OS.handleActivated(LinuxGlobalShortcutsPortal.ts:462-475): hold repeat ignored; toggle re-armed after 1500 ms, measured from the last activation. Matches.handleShortcutsChanged: a held action is released when its trigger is null or has changed. Matches.bind_step/listed_outcome(codes 1 → Cancelled, 2 → Denied, 0 with nothing listed → Denied). Match.classify_interface_error/classify_create_session_error, andSETUP_TIMEOUTof 30 s. Match.PortalUpdate::Shellwas appended at the end, andinto_shellmaps the older variants. Core's existingports.rsshape is the source of truth here. Note for Task 34: route throughinto_shell().portal_bind/portal_configureare an append-only change to the registration file.Findings
Portal::configurenever reportsConfigureUnsupportedon a v2 portal (shortcuts/portal.rs,fn configure).Proxy::call/call_versionedturn every D-Bus method error intoError::Portal(PortalError::…):org.freedesktop.portal.Error.FailedbecomesPortalError::Failed(_), and any other name, such asUnknownMethod, becomesPortalError::ZBus(MethodError). It never returnsashpd::Error::Zbus(seeashpd-0.14.0/src/proxy.rs:270-288anderror.rs:10-31).Err(ashpd::Error::Zbus(error)) => !matches!(…UNKNOWN_METHOD | portal.Error.Failed)can never match, and those errors fall into_ => true.classify_configure_errormapsUnknownMethod | portal.Error.Failedtounsupported:version. This goes against Review Focus 6 and against the original's behaviour.Error::Portal(PortalError::Failed(_))andError::Portal(PortalError::ZBus(e)), testingerror_name(e) == UNKNOWN_METHOD, and keep theZbusarm for safety.UnknownMethod, and one that answersorg.freedesktop.portal.Error.Failed, each expectingConfigureUnsupported.Registerdrops the original's retry and "already associated" handling.classify_register_error,portal.Error.Failedis retried overREGISTER_RETRY_DELAYS, and an error containing "already associated" counts as registered when it was registered before.registered: falseat once.ListShortcutsanswering with a non-zero response.global_shortcuts.rs~1456) treats it as an empty list..response()?givesError::Response. During the open,open_failurethen reportsOpenFailed(NoPortal). In bind's empty-answer fallback it givesFailedinstead of the original'sDenied. Consider mappingError::Response(_)fromlist()toOk(vec![]).backend::hold_release_debounced_and_cancelled_by_press.Deactivatedand the nextActivatedreaching the control thread within 60 ms of each other.Verdict: changes requested. One blocking finding (1); 2–4 can be fixed now or deferred as follow-ups. Gate green.
Review round 1 fixed in
adafda23(cargo xtask cigreen locally, withFLUXER_SCREENSHOT_TESTS=1).Blocking:
Portal::configurenever reportedConfigureUnsupportedon a v2 portal. Fixed. The newconfigure_offeredmatchesError::RequiresVersion,Error::Portal(PortalError::Failed(_)), andUnknownMethodorportal.Error.FailedinsideError::Portal(PortalError::ZBus(_))(orError::Zbus). Each of these means unsupported, as the original'sclassify_configure_errordoes. Tests: the unit testconfigure_unsupported_as_the_original, and the bus testbackend::v2_without_configure_is_unsupported, which runs a v2 fake that answersUnknownMethodand thenportal.Error.Failedand expectsConfigureUnsupported. Both failed on the old code. The fake'sConfigureShortcutsalso had a bug of its own: it sent itsUnknownMethodasorg.freedesktop.zbus.Errorbecause the error went through a#[zbus(error)]variant. It now uses an error type that sends the real names.Minor: Register retry and "already associated". Ported.
classify_register_error(name, message)now returns the original'sRegisterFailure.portal.Error.Failedis retried after each ofREGISTER_RETRY_DELAYS(250 ms, 750 ms, 2 s) and counts as refused after the last one. "already associated" counts as registered if an earlier connection of this back end registered. Tests:backend::register_failure_is_retried, plusunregistered_is_reported_and_the_session_still_opens, which now checks for 4Registercalls.Minor: a non-zero ListShortcuts response. Fixed.
Portal::listnow returns an empty list forError::Response(_), so opening reportsOpenedwith nothing listed and bind's fallback for an empty answer givesDenied. Test:backend::non_zero_list_answer_is_an_empty_list.Minor: the debounce test could flake. Two changes reduce the risk. The connection's thread now timestamps each signal when it reads it, so a busy control thread no longer adds time between the release and the press. The test now sends
DeactivatedandActivatedback to back with the fake's newrelease_and_press. The test passed 15 times in a row here. Delivery of the two signals over the bus within 60 ms is still assumed, but they are two consecutive messages from one sender to one receiver.🤖 Generated with Claude Code
Independent review, round 2 (Task 28, commit
adafda23)Reviewed
git diff 4a7f4a1c..origin/shell-28-platform-shortcuts-on-waylandcold.Gate:
FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciin a fresh review worktree: all steps passed, EXIT=0. All 32 tests inportal_shortcuts_busran and passed. None were skipped.What checks out
tests/portal_shortcuts_bus.rs(backend::registers_then_creates_session,bind_sends_all_actions_with_triggers,activated_deactivated_map_to_events,hold_release_debounced_and_cancelled_by_press,toggle_rearmed_after_repeat,changed_triggers_reported_and_released,denied_bind_reported,portal_restart_reconnects,v1_has_no_configure). Each asserts what the plan says. Round 1's fixes have tests too:v2_without_configure_is_unsupported,register_failure_is_retriedandnon_zero_list_answer_is_an_empty_list.shortcuts/mod.rs(portal_bind,portal_configure,PortalUpdate::Shell, thesystem_backendarm) only add to what is there. Existing variants keep their shape. Thecfg(not(linux))arm still covers the match exhaustively.TOGGLE_REARMis 1500 ms, asPORTAL_TOGGLE_REARM_MS.Holds::activatedishandleActivated(LinuxGlobalShortcutsPortal.ts:462-475) line for line.REGISTER_RETRY_DELAYS(250 / 750 / 2000 ms),OPEN_TIMEOUT(30 s,SETUP_TIMEOUT),classify_register_errorand the "already associated" handling matchlinux-portals/src/global_shortcuts.rsexactly.configure_offeredmatchesclassify_configure_error(UnknownMethod / portal Failed mean unsupported).changedrelease rule matcheshandleShortcutsChanged.BindShortcutsmatchGlobalShortcutActions.ts.Session.Closed, on the portal changing owner, on changed triggers and onstop. A pending debounced release is delivered beforeStopped.tracing::lines print onlyPortalOpenFailure/PortalLossor nothing.DefinitionandPortalUpdate::Shellhide their triggers, andupdates_print_no_triggertests this.Findings
CreateSessionOptionscannot setsession_handle_token, so every connection gets a random one. The module doc says "nothing depends on it". That is not true on KDE: when a session has no app id, xdg-desktop-portal-kde names the KGlobalAccel component after the session token ("token_" + token; the stringtoken_is in/usr/lib/xdg-desktop-portal-kdeon this machine).LINUX_PORTAL_SESSION_TOKENinDesktopIdentity.ts,DEFAULT_SESSION_TOKEN = "fluxer_global_shortcuts"inlinux-portals).Registeris refused, every launch and every reconnect creates a new component. That covers a portal older than 1.19.4, a missing desktop entry (Desktop shell 18) and a refusal after the retries. Each time, the user's assigned triggers are lost, "Set up" has to be done again, and stale entries pile up in System Settings.CreateSessionwithout ashpd's helper, throughzbuswithsession_handle_tokenset to a fixedflaxative_global_shortcuts, as the spike's rawRegistercall already does. Build the session proxy from the returned path. Add a bus test asserting the fake sees the fixed token.session-lostthat arrives duringbinding(pendingLoss). Here,lost()reports it at once while the bind call is still running. The loss is still reported and the holds are still released, so nothing gets stuck. Core may just seeSessionLostbeforeBind(...).Portal(Shell(SessionLost(PortalRestarted))), notPortalUpdate::Reconnecting, and "unregistered" is reported asOpened { registered: false }. This is documented, andPortalUpdate::into_shellmaps the old variants. The runtime's routing task should consumeinto_shell()/Shell(..).retire()can block the control thread. It callszbus::block_on(portal.session.close())on the control thread, under a 30 s method timeout. A hung (not gone) portal would stall that thread, and with it pending debounces of a new connection, for up to 30 s. Holds are already released before it, so push-to-talk cannot stick. A short teardown timeout, like the original'sTEARDOWN_TIMEOUTof 2 s, would match it.Verdict: changes requested. One blocking finding (1). Everything else is correct and CI is green.
Round 2 fixes, commit
f18fd7e1(localFLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen).Blocking: random session handle token (portal.rs). Fixed. ashpd 0.14 cannot set the token, and its
Sessioncannot be built from a path. So the session's calls (CreateSession,ListShortcuts,BindShortcuts,ConfigureShortcuts,Session.Close) now go through zbus directly. A smallrequesthelper subscribes to the request object'sResponsebefore each call, as ashpd does.CreateSessionsends the fixedsession_handle_tokenSESSION_HANDLE_TOKEN=flaxative_global_shortcuts. That is the original'sfluxer_global_shortcutspattern, keyed to our app id so it does not mix with the Electron app's KGlobalAccel component. ashpd is still used for the version and theActivated/Deactivated/ShortcutsChangedsignals. New bus testbackend::session_has_the_fixed_handle_token: registered and unregistered, the session path is.../session/<unique>/flaxative_global_shortcuts, and it stays so after a reopen on a new connection.Minor: session loss during an open bind dialog. Fixed in a form that gives the same visible result. Each link now has a separate
callsstop. OnSession.Closedor a portal owner change, the waiting bind or configure is given up, and an answer still queued for a session that is no longer open is dropped. Core getsSessionLostand never a staleBind(..)after it. That is what the original produces too: its native side ends the request withSessionLost, and the TSpendingLossthen reports only the loss. Holds are still released at once. New bus testbackend::session_lost_during_bind_gives_up_the_bind: (a) the portal closes the session and then answers the bind with response 2, givingSessionLost(Closed)and nothing after it. I checked that this case fails without the fix, whereBind(Denied)followed the loss. (b) The dialog stays open when the session is lost, givingSessionLost, a later bind givesFailedat once, and stop does not hang.Minor: owner change reported as
Shell(SessionLost(PortalRestarted))(mod.rs). No code change. This is intended: the back end reports core's ownPortalUpdate, andPortalUpdate::into_shellmaps the olderReconnecting/Opened{registered:false}forms. The runtime routing task has to consumePortalUpdate::Shell/into_shell, as the README's portal section says.Minor:
retire()closing with the 30 s method timeout. Fixed.Session.Closenow racesTEARDOWN_TIMEOUT(2 s, the original's constant), so a hung portal holds the control thread for at most 2 s. New bus testbackend::stop_does_not_wait_on_a_hung_close, against a fake whoseClosenever answers: stop takes between 2 s and 5 s and still reportsStopped.README portal section updated (fixed token, a lost bind given up, bounded close).
Independent review, round 3 (Task 28, commit
f18fd7e1)I read
git diff 4a7f4a1c..origin/shell-28-platform-shortcuts-on-waylandcold.Gate: I ran
FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciin a fresh review worktree (sh-review-28). All steps passed, EXIT=0.portal_shortcuts_bus: 35 passed, 0 failed, 0 ignored.What checks out
backend::*and assert what the plan says: Register → CreateSession → ListShortcuts in that order, the BindShortcuts payload (every global-capable action with its label and XDG trigger), the 60 ms debounce cancelled by a press, the 1.5 s re-arm, changed triggers released at once, denied/cancelled, restart →SessionLost(PortalRestarted)→Available→ reopen, and no configure on v1.CreateSessionnow sendssession_handle_token=SESSION_HANDLE_TOKEN(flaxative_global_shortcuts).session_has_the_fixed_handle_tokenchecks the path.../session/<unique>/flaxative_global_shortcuts, registered and unregistered, and after a reopen.lost()signalslink.calls, and aBoundorConfiguredthat arrives after the session closed is dropped (session_lost_during_bind_gives_up_the_bind, both cases).close()racesTEARDOWN_TIMEOUT(stop_does_not_wait_on_a_hung_close).requesthelper subscribes toResponsebefore it makes the call.PortalBackend::{new, on_bus}exists.system_backend(Portal)returns it on Linux, with acfg(not(linux))armPortal => None.portal_bindandportal_configureare appended to the trait as default no-ops, so other back ends are not broken.PortalUpdate::Shellis appended.into_shellmaps the older variants, so the Task 34 runtime can feedShellEvent::Portalfrom any of them.HOLD_RELEASE_DEBOUNCEandTOGGLE_REARMare named constants, and the module doc gives the reason for the debounce (KDE bug 484525).tracing::lines (thread spawn failure,?failure,?reason). None of them log a key or trigger.Definition,PortalUpdate::Shelland core'sPortalShortcutprint no trigger (updates_print_no_trigger).unwrap,expectorpanicoutside tests, and bus data cannot panic: unknown ids are dropped, a session handle that is neither a string nor a path falls back to the token's path, and a non-zero response is mapped to an outcome.unsafe.fluxer-coreis untouched./home/cdaoust/src/fluxer-soundboard.Holds::activatedmatcheshandleActivated(LinuxGlobalShortcutsPortal.ts:462-475): a hold's repeat is ignored, and a toggle re-arms 1500 ms after the last activation (PORTAL_TOGGLE_REARM_MS = 1500).changed()matcheshandleShortcutsChanged+applyBindings: the change is merged, then every held action whose trigger is null or differs is released.REGISTER_RETRY_DELAYSis 250/750/2000 ms,OPEN_TIMEOUT=SETUP_TIMEOUT= 30 s,TEARDOWN_TIMEOUT= 2 s, and "already associated" is handled as inN/linux-portals/src/global_shortcuts.rs:18-24,340.GLOBAL_SHORTCUT_DEFAULT_DESCRIPTIONS(GlobalShortcutActions.ts).Session.Closed, when the portal's owner changes, on stop (including a release still waiting out the debounce, delivered beforeStopped), and onShortcutsChanged.Findings
minor: the branch does not merge cleanly with current
origin/shell. Shell 27 and Shell 29 have since been merged intoshell.git merge-tree HEAD origin/shellconflicts incrates/fluxer-platform/{README.md, src/lib.rs, src/shortcuts/mod.rs}. All three are registration files, so keep both sides. Insystem_backend, combine the arms by hand:#[cfg(target_os = "linux")] BackendKind::Portal => Some(Box::new(portal::PortalBackend::new()));HookWindows/XRecord/Evdevarms;BackendKind::None | BackendKind::Portal => NoneintoBackendKind::None => Noneplus#[cfg(not(target_os = "linux"))] BackendKind::Portal => None;pub mod xrecord;and#[cfg(target_os = "linux")] pub mod portal;.Merge
origin/shelland re-run the gate before this PR is merged.minor:
start()on a back end that is already running does not sendStatus(Started(Portal))to the new sink. It goes straight toOpenedorOpenFailed.FakeBackend::startalways sendsStarted. If Task 34's runtime recovers by callingstartagain and expectsStartedfirst, the portal will differ from the fake. Either document this on the trait or sendStartedon reopen as well. This does not block this task.minor (process): the commit trailers read
Co-Authored-By: Claude Opus 5.5, while the repo contract asks forClaude Fable 5.2. This was left as is to avoid a force push. Noted for Charles; not a code issue.Verdict: APPROVED. No blocking findings and the gate is green. Finding 1 must be handled when
origin/shellis merged in.Merged into
shellby hand (the merge API returns 405); the commits are in the branch.Pull request closed