[Mac] 'Sync Now' header button not rendered in SP toolbar #14

Closed
opened 2026-06-10 18:25:11 +02:00 by fpindado · 1 comment
Owner

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.

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.
Author
Owner

Resolved in v0.1.0.

Root cause: registration-timing race. registerHeaderButton was called at the end of the background entry-point async IIFE, after the loadSyncedData() / 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: registerMenuEntry and registerHeaderButton are now called synchronously at the top of the IIFE, before any await, so registration always completes before SP builds its toolbar. Both calls are wrapped in try/catch with 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 sync to difference so 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 registered log line prints on load.

Closing as fixed.

**Resolved in v0.1.0.** **Root cause:** registration-timing race. `registerHeaderButton` was called at the end of the background entry-point `async` IIFE, *after* the `loadSyncedData()` / `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:** `registerMenuEntry` and `registerHeaderButton` are now called **synchronously at the top of the IIFE, before any `await`**, so registration always completes before SP builds its toolbar. Both calls are wrapped in `try/catch` with 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 `sync` to `difference` so 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 registered` log line prints on load. Closing as fixed.
Sign in to join this conversation.
No milestone
No project
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
fpindado/sync-md-multi#14
No description provided.