Skip to content

feat(super-productivity): sync task notes to Super Productivity - #296

Open
BigWebstas wants to merge 2 commits into
johannesjo:mainfrom
BigWebstas:feat/super-productivity-note-sync
Open

BigWebstas wants to merge 2 commits into
johannesjo:mainfrom
BigWebstas:feat/super-productivity-note-sync

Conversation

@BigWebstas

Copy link
Copy Markdown
Contributor

Description

Syncs task notes between Parallel Code and Super Productivity for tasks linked to a Super Productivity task. Until now only the title was synced.

  • Parallel Code to Super Productivity: editing a linked task's notes sends them to Super Productivity after a 500 ms debounce. A new SuperProductivityUpdateTaskNotes IPC channel handles the send.
  • Super Productivity to Parallel Code: when a linked task is focused, the notes are read alongside the title and merged.
  • Merge rule: a three-way merge against the last notes both sides agreed on (syncedNotes, persisted with the link).
    • Whichever side changed wins.
    • If both changed, Parallel Code wins.
    • On a freshly linked task with no base, Super Productivity's notes are pulled only when Parallel Code's are empty.
  • New tasks from Super Productivity start with that task's notes.
  • Notes longer than 100,000 characters are shortened before sending, without splitting a surrogate pair.

Issues Resolved

None filed.

Check List

  • New functionality includes testing. (Merge rules, client and store sync tests.)
  • New functionality has been documented in the README if applicable. (Not applicable: the existing Super Productivity integration has no notes section.)

🤖 Generated with Claude Code

@johannesjo

Copy link
Copy Markdown
Owner

🔧 Needs changes – labelled needs work; ping me once the items below are addressed and I'll re-review.

Thanks for the PR! This adds two-way task notes sync for linked Super Productivity tasks: a debounced push on edit, a three-way merge on focus, and notes carried over when a task is created on either side. Notes sync is welcome as an optional, opt-in feature, so two things need to change before it can merge.

Blocking

  • src/store/superProductivity.ts:371 – Notes sync is always on for every connected user. The only check on the notes paths is isEnabled(), which is true as soon as a Super Productivity token is configured, so a user who connected only for focus tracking and title sync gets notes pushed and pulled after upgrading, with no way to turn it off. Please add a persisted setting, off by default, with a toggle in SuperProductivitySettings.tsx. Check it on every notes path: onTaskNotesChanged/pushNotes, applyNotesSync in evaluateFocus (superProductivity.ts:330), the notes sent by createSpTaskFor (superProductivity.ts:213), and the notes seeded by openNewTaskFromSp (superProductivityOpen.ts:104) and linkNewTaskToSp. Add a store test that nothing is pushed or pulled while the setting is off, and mention the option in the Super Productivity entry of README.md.
  • electron/shared/super-productivity.ts:184-186 – Without a syncedNotes base, non-empty Parallel Code notes silently replace different non-empty Super Productivity notes. Every link created before this PR has no base, and once the toggle exists, every link has none at the moment the user opts in. For example, PC notes my plan and SP notes call notes: resolveSpNotesSync(undefined, 'my plan', 'call notes') returns push, and the SP notes are gone (the new unit test asserts this). It also happens without any read. The task restored as active on launch gets no focus evaluation, so one keystroke in its notes makes onTaskNotesChanged (superProductivity.ts:371; undefined !== notes) PATCH Parallel Code's notes over Super Productivity's after 500 ms. When there is no base and both sides hold different non-empty notes, don't overwrite either side. For example, write both combined (Parallel Code's notes, a separator, then Super Productivity's) to both sides and record that as the base, or leave notes unsynced for that link. Also make onTaskNotesChanged/pushNotes skip links with no syncedNotes until a focus sync has set one, and add a store test for an existing link without syncedNotes.

Automated review pass (Claude Code). Anything unclear or wrong – say so and I'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants