pending.nvim/lua/pending
Barrett Ruth e0e3af6787
Google Tasks sync + shared OAuth module (#60)
* feat(gtasks): add Google Tasks bidirectional sync

Problem: pending.nvim only supported one-way push to Google Calendar.
Users who use Google Tasks had no way to sync tasks bidirectionally.

Solution: add `lua/pending/sync/gtasks.lua` backend with OAuth PKCE
auth, push/pull/sync actions, and field mapping between pending tasks
and Google Tasks (category↔tasklist, `priority`/`recur` via notes).

* refactor(cli): promote sync backends to top-level subcommands

Problem: `:Pending sync gtasks auth` required an extra `sync` keyword
that added no value and made the command unnecessarily verbose.

Solution: route `gtasks` and `gcal` as top-level `:Pending` subcommands
via `SYNC_BACKEND_SET` lookup. Tab completion introspects backend
modules for available actions instead of hardcoding `{ 'auth', 'sync' }`.

* docs(gtasks): document Google Tasks backend and CLI changes

Problem: vimdoc had no coverage for the gtasks backend and still
referenced the old `:Pending sync <backend>` command form.

Solution: add `:Pending-gtasks` and `:Pending-gcal` command sections
with per-action docs, update sync backend interface, and add gtasks
config example.

* ci: format

* refactor(sync): extract shared OAuth into `oauth.lua`

Problem: `gcal.lua` and `gtasks.lua` duplicated ~250 lines of identical
OAuth code (token management, PKCE flow, credential loading, curl
helpers, url encoding).

Solution: Extract a shared `OAuthClient` metatable in `oauth.lua` with
module-level utilities and instance methods. Both backends now delegate
all OAuth to `oauth.new()`. Skip `oauth` in `health.lua` backend
discovery by checking for a `name` field.

* feat(sync): ship bundled OAuth credentials

Problem: Users must manually create a Google Cloud project and place a
credentials JSON file before sync works — terrible onboarding.

Solution: Add `client_id`/`client_secret` fields to `GcalConfig` and
`GtasksConfig`. `oauth.lua` resolves credentials in three tiers: config
fields, credentials file, then bundled defaults (placeholders for now).

* docs(sync): document bundled credentials and config fields

* ci: format
2026-03-05 01:21:18 -05:00
..
sync Google Tasks sync + shared OAuth module (#60) 2026-03-05 01:21:18 -05:00
buffer.lua refactor(icons): ascii defaults, checkbox overlays, and cleanup (#57) 2026-03-04 18:44:41 -05:00
complete.lua refactor: remove file token feature (#50) 2026-02-26 22:41:38 -05:00
config.lua Google Tasks sync + shared OAuth module (#60) 2026-03-05 01:21:18 -05:00
diff.lua refactor(icons): ascii defaults, checkbox overlays, and cleanup (#57) 2026-03-04 18:44:41 -05:00
health.lua Google Tasks sync + shared OAuth module (#60) 2026-03-05 01:21:18 -05:00
init.lua feat: Google Tasks bidirectional sync and CLI refactor (#59) 2026-03-05 01:01:29 -05:00
parse.lua refactor: remove file token feature (#50) 2026-02-26 22:41:38 -05:00
recur.lua feat: time-aware due dates, persistent undo, @return audit (#33) 2026-02-25 20:37:50 -05:00
store.lua refactor: organize tests and dry (#49) 2026-02-26 20:03:42 -05:00
textobj.lua feat: text objects and motions for the pending buffer (#39) 2026-02-26 16:28:58 -05:00
views.lua refactor(icons): ascii defaults, checkbox overlays, and cleanup (#57) 2026-03-04 18:44:41 -05:00