Skip to content

Add thread posting support across social media platforms#157

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/update-crosspost-to-support-threads
Draft

Add thread posting support across social media platforms#157
Copilot wants to merge 6 commits intomainfrom
copilot/update-crosspost-to-support-threads

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

Implementation Complete ✅

Summary

Successfully implemented thread posting support for Crosspost, allowing users to post multi-message threads across social media platforms.

Latest Changes (API Consistency Improvements)

  • Maintained public API consistency - The public post() method signature remains unchanged
  • Twitter: Created private #postTweet() helper method that accepts reply info; post() and postThread() both delegate to this helper
  • Mastodon: Created private #postStatus() helper method that accepts reply info; post() and postThread() both delegate to this helper
  • Bluesky: Already uses helper function pattern with postMessage() accepting optional reply info

Result: Clean separation between public API and internal implementation, no breaking changes to existing post() method signature

Changes Made

Type Definitions (src/types.js)

  • ✅ Added PostThreadEntry type with message and optional images
  • ✅ Added PostThreadOptions type with optional AbortSignal
  • ✅ Updated Strategy type to include optional postThread() method

Client Implementation (src/client.js)

  • ✅ Added Client.postThread() method
    • Accepts array of thread entries and optional options
    • Automatically detects if strategy has native postThread() support
    • Falls back to sequential post() calls for strategies without native support
    • Returns consistent response format using SuccessResponse/FailureResponse

Strategy Implementations - Clean Architecture

  • Twitter/X (src/strategies/twitter.js)

    • Private #createClient() method for client creation
    • Private #uploadImages() method for image uploading
    • Private #postTweet() method for posting with optional reply info
    • Public post() method maintains original signature
    • postThread() uses shared helpers for code reuse
  • Bluesky (src/strategies/bluesky.js)

    • Extended postMessage() helper to accept optional replyInfo parameter
    • post() and postThread() both delegate to postMessage()
    • Clean separation of concerns with no code duplication
  • Mastodon (src/strategies/mastodon.js)

    • Private #postStatus() method for posting with optional reply info
    • Public post() method maintains original signature
    • postThread() uses shared helper for code reuse

Testing (tests/client.test.js)

  • ✅ Comprehensive test coverage for Client.postThread()
    • All 309 tests passing

Quality Assurance

  • ✅ All 309 unit tests passing
  • ✅ ESLint: No issues
  • ✅ Prettier: Code formatted
  • ✅ TypeScript: Builds successfully
  • ✅ Public API unchanged - no breaking changes
  • ✅ Code duplication eliminated
  • ✅ 97 lines of code removed

Strategy Support

Platforms with native thread support:

  • Twitter/X ✅
  • Bluesky ✅
  • Mastodon ✅

Platforms using fallback (sequential posts):

  • Discord Bot, Discord Webhook, Slack, Telegram, LinkedIn, Dev.to, Nostr
Original prompt

Update Crosspost to support posting to threads.

Each strategy may optionally have a postThread() method that accepts an array of objects containing a message (string) and an images array (ImageEmbed[]).

The postThread() method should be added to all strategies that natively support threads (such as X, Bluesky, etc.). It should not be added to strategies with no native concept of threads.

The Client class should get a new postThread() method that should call underlying postThread() methods on strategies or just the post() method multiple times if no postThread() method exists.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits January 19, 2026 19:32
…stodon)

Co-authored-by: nzakas <38546+nzakas@users.noreply.github.com>
Co-authored-by: nzakas <38546+nzakas@users.noreply.github.com>
Co-authored-by: nzakas <38546+nzakas@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Crosspost to support posting to threads Add thread posting support across social media platforms Jan 19, 2026
Copilot AI requested a review from nzakas January 19, 2026 19:37
Copy link
Contributor

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot there's some duplication between the postThread and post methods on strategies. Clean it up so we're not duplicating logic.

Copilot AI and others added 2 commits January 23, 2026 00:00
Co-authored-by: nzakas <38546+nzakas@users.noreply.github.com>
Co-authored-by: nzakas <38546+nzakas@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 23, 2026

@copilot there's some duplication between the postThread and post methods on strategies. Clean it up so we're not duplicating logic.

Refactored all three strategies to eliminate duplication. Each strategy now uses private helper methods that contain the shared logic:

  • Twitter: #postTweet() helper handles posting with optional reply info
  • Mastodon: #postStatus() helper handles posting with optional reply info
  • Bluesky: postMessage() helper extended to accept optional reply info

The public post() API remains unchanged. Both post() and postThread() delegate to these helpers, eliminating all code duplication (97 lines removed).

Commit: 52ae9fc

Copilot AI requested a review from nzakas January 23, 2026 00:04
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