Skip to content

Encode todo add/tag actions as URL-safe base64 JSON payloads#802

Open
multiplex55 wants to merge 3 commits intomasterfrom
codex/update-todo-action-payload-handling
Open

Encode todo add/tag actions as URL-safe base64 JSON payloads#802
multiplex55 wants to merge 3 commits intomasterfrom
codex/update-todo-action-payload-handling

Conversation

@multiplex55
Copy link
Owner

Motivation

  • Ensure todo:add: and todo:tag: actions can carry arbitrary text and tags (including |, ,, and whitespace) without ambiguous delimiter parsing.
  • Make action construction/parsing more robust and future-proof by using a structured payload format.

Description

  • Added payload structs TodoAddActionPayload and TodoTagActionPayload and shared encode/decode helpers that serialize to JSON and encode using URL-safe base64. (src/plugins/todo.rs)
  • Updated TodoPlugin to serialize add/tag arguments into todo:add:<encoded> and todo:tag:<encoded> when building Action.action. (src/plugins/todo.rs)
  • Updated launcher parse_action_kind to decode those payloads and return ActionKind::TodoAdd / ActionKind::TodoSetTags from the deserialized values. (src/launcher.rs)
  • Changed ActionKind::TodoAdd.text to own a String so decoded payload text can be carried safely, and adjusted the launch path to call todo::add(&text, priority, &tags). (src/launcher.rs)
  • Added unit tests to verify round-trip behavior for texts and tags containing |, ,, and whitespace in both the plugin and launcher parser. (src/plugins/todo.rs, src/launcher.rs)

Testing

  • Ran cargo fmt --all which completed successfully.
  • Ran cargo test --all-targets but the full test run failed in this environment due to a missing system dependency required by alsa-sys (pkg-config / alsa.pc), so tests could not complete; the added unit tests are included in the tree and will run in CI or on a machine with the ALSA dev package available.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant