Commit graph

18 commits

Author SHA1 Message Date
Claude
0c25564337
Normalize redirect URI to fix OAuth invalid_grant (1.2.3)
TickTick's OAuth server requires byte-exact match between the redirect_uri
the plugin sends and the value registered in the developer portal. Users
who register the URI with a trailing slash (common on iOS paste, or by
hand) get rejected with:

  error="invalid_grant"
  error_description="Invalid redirect: ...vercel.app does not match one
  of the registered values: [...vercel.app/]"

(Reported in issue #2.)

Normalize the redirect URI by stripping trailing slashes and whitespace at
all four use/save sites:

- main.ts: startAuthFlow() and exchangeAuthCodeForToken() clean the URI
  before sending — protects existing users with a slash already saved
- settings.ts: both Redirect URI inputs strip on save so the persisted
  value matches what's displayed
- settings.ts: both descriptions now warn against trailing slashes
- README: new Troubleshooting entry for the invalid_grant error

https://claude.ai/code/session_01V2fsiatACzjUCNwSEhwER9
2026-06-05 16:16:26 +00:00
Claude
c036f5ab67
Strip Markdown from TickTick task titles (1.2.2)
The task title was built verbatim from the source line, so list/checkbox
markers (- [ ]), bold/italic, links, headings, etc. leaked into TickTick.
Add a stripMarkdown() helper that cleans the title to plain text before
truncation:

- Removes leading list/checkbox/heading/blockquote/ordered markers
- Unwraps links and wiki links to their text
- Strips asterisk emphasis, ~~strike~~, ==highlight==, `code` (matched or
  dangling, e.g. a leading ** with no closing pair)
- Leaves single/snake_case underscores intact

The task description still includes the original text and the Open in
Obsidian link unchanged.

https://claude.ai/code/session_01V2fsiatACzjUCNwSEhwER9
2026-06-04 20:48:21 +00:00
Claude
0f98a56552
Release 1.2.1: address Obsidian directory review warnings
- manifest: drop "Obsidian" from description (directory rule), remove unknown
  `main` field, bump to 1.2.1
- README: title now matches plugin name in manifest
- Remove unused base64UrlEncode helper
- Remove dead express dependency and server.js (clears qs / path-to-regexp
  vulnerability warnings)
- package.json: real name + author + description, drop sample-plugin template
  metadata
- versions.json: add 1.2.1 → 1.4.0

https://claude.ai/code/session_01V2fsiatACzjUCNwSEhwER9
2026-06-04 20:30:07 +00:00
Claude
74d86badd2
Add 'Create TickTick task' to the three-dot file menu
Register on workspace 'file-menu' (the event that drives the ⋯ menu
in the upper right of a note view on mobile, and the same menu on
desktop). This is the hook Advanced URI uses for its 'Copy Advanced
URI' item — testing confirmed the mobile screenshot shows file-menu
items, not editor-menu items, which is why the previous editor-menu
registration was invisible on mobile.

Guard the handler so the item only appears when:
- The file is a markdown file
- The active view is a MarkdownView with that exact file open

This keeps it out of file-explorer right-click menus where there'd be
no cursor context.

Update the README to call out the three-dot menu as the first mobile
option (no setup required) above the toolbar-customization paths.
2026-05-11 02:53:27 +00:00
Claude
809ebaff4f
Remove unreliable editor-menu integration; clarify mobile access
Long-pressing in the editor on iOS surfaces iOS's native selection menu
(Cut/Copy/Paste/Look Up), not Obsidian's editor-menu — so the
'Create TickTick task' item registered on editor-menu was effectively
invisible on mobile, the platform that needed it most. Remove the
handler rather than ship a feature that only works on desktop and
gives mobile users false hope.

Update the README accordingly: split usage into mobile and desktop
sections, drop the editor context menu bullet, and explicitly call
out that the command palette is not the three-dot menu — users have
to add it to the mobile toolbar themselves.
2026-05-11 02:49:00 +00:00
Claude
ed74e2c102
Set command icon and rewrite README
- Replace the question-mark fallback icon on the command and editor
  menu item with lucide-circle-check-big — visually distinct from the
  square-checkbox toolbar icon that's already taken, while still
  reading as a task/check action.

- Rewrite README to reflect the current architecture and surface the
  setup flow clearly. The old README still described the long-removed
  port-3000 local server and the deprecated 'Create TickTick Task from
  Paragraph' command name; replace with mobile and desktop install
  paths (BRAT + manual), step-by-step OAuth setup using the new
  Vercel-redirected deep link, all four invocation methods (command
  palette, hotkey, mobile toolbar, editor context menu), an updated
  settings reference matching the new two-view UI, and troubleshooting
  for the failure modes users actually hit.
2026-05-11 02:43:09 +00:00
Claude
285c61299a
Add 'Create TickTick task' to the editor context menu
On mobile, hotkeys are not the primary input. Long-pressing text brings
up the editor context menu — the most natural place to act on the
text under the cursor. Register an editor-menu handler that adds the
'Create TickTick task' item alongside Cut/Copy/Paste, calling the same
task-creation logic as the command palette entry.

Refactor the command's body into createTaskFromEditor() so both the
command palette and the context menu share one code path.
2026-05-11 02:30:48 +00:00
Claude
1e919808ea
Fix OAuth launch on iOS by presenting auth URL as tappable link
iOS WebKit only allows window.open() to escape to the system browser
when called inside the synchronous portion of a user gesture. The
existing startAuthFlow awaits PKCE hashing and saveSettings before
calling window.open, so by the time it fires iOS has lost the gesture
context and silently blocks the popup — Connect appeared to do nothing.

Replace the programmatic window.open with an AuthLinkModal that
displays the auth URL as a real <a> element. The user's tap on the
link is itself a synchronous gesture, so WebKit hands off to Safari
as expected. Works the same on desktop (Electron treats the link the
same way).
2026-05-11 01:59:16 +00:00
Claude
23eba63ff7
Enable mobile compatibility with seamless OAuth deep-link
- Flip isDesktopOnly to false in manifest.json; the runtime code uses
  only platform-safe APIs (requestUrl, crypto.subtle, URLSearchParams).
- Register obsidian://ticktick-callback protocol handler so the OAuth
  redirect returns directly into Obsidian on desktop and mobile,
  removing the manual copy-paste step.
- Verify state parameter against tempState to mitigate CSRF, and clear
  tempCodeVerifier/tempState after a successful exchange.
- Update Vercel callback pages (callback.html, index.html) to redirect
  to the obsidian:// deep link instead of displaying the code as text.
  Note: the deployed Vercel page must be redeployed for users to see
  the new behavior.
- Drop the now-vestigial "Authorization code" paste field from the
  settings UI.
2026-05-10 23:41:32 +00:00
muxinli
0d650629fe Add selection mode and tag position settings
Support single-line or paragraph selection via a setting, and allow
the #ticktick tag to be appended or prepended. Defaults to single-line
+ append to fix list formatting issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-11 18:41:17 -05:00
muxinli
96f437edaf Sentence-case plugin name 2025-05-28 19:58:21 -05:00
muxinli
6929fe484a Use arrayBufferToBase64, remove H2, switch to sentence case, fix encoder 2025-05-19 14:16:42 -05:00
muxinli
fe1394d7ab Updated URI defaults 2025-04-13 15:30:26 -05:00
muxinli
d3c3bc76ed Updated Vercel URL 2025-04-13 15:08:32 -05:00
muxinli
6405ba649b Added Vercel callback page 2025-04-13 14:57:44 -05:00
muxinli
3e4035fb54 Patch - Server settings, PR file name, compiled code
Updated server settings to use temporary local server

Pull request file name updated for PCs

Remove compiled main.js files
2025-03-30 19:45:19 -05:00
muxinli
e2f44146c0 Updated license
Corrected License and updated README. Removed temporary token expiration test from main file.
2025-03-23 22:03:06 -05:00
muxinli
3ce1d513f8 Initial commit
Initial commit of TickTick quick add plugin for Obsidian notebook
2025-03-23 21:38:44 -05:00