[Mac] 'Sync Now' header button not rendered in SP toolbar #14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
The button registered via `PluginAPI.registerHeaderButton` does not appear in the Super Productivity toolbar on macOS.
The API call completes without throwing an error, but the button is never rendered. This is likely a version or platform difference in the macOS build of SP.
Proposed fix: add a 'Sync Now' button inside the configuration panel (`index.html`) as a reliable cross-platform alternative.
Resolved in v0.1.0.
Root cause: registration-timing race.
registerHeaderButtonwas called at the end of the background entry-pointasyncIIFE, after theloadSyncedData()/refreshProjectsCache()awaits had resolved. By that point SP had already built its header toolbar on macOS, so the late registration was never painted. On Linux (AppImage) the registration won the race, which is why the button appeared there but not on Mac.Fix:
registerMenuEntryandregisterHeaderButtonare now called synchronously at the top of the IIFE, before anyawait, so registration always completes before SP builds its toolbar. Both calls are wrapped intry/catchwith success/failure logging to distinguish "never registered" (silent API throw) from "registered but not painted" (SP-side rendering).While here, the button/menu icon was changed from
synctodifferenceso it no longer looks identical to SP's native sync icon.Verified on macOS 18.9.1 (Apple Silicon): the button now renders in the toolbar and the
Header button registeredlog line prints on load.Closing as fixed.