Skip to content

feat(instagram): comment-to-DM automation with Instagram Login - #874

Merged
sung17 merged 3 commits into
mainfrom
feat/instagram-comment-to-dm
Jul 31, 2026
Merged

sung17 merged 3 commits into
mainfrom
feat/instagram-comment-to-dm

Conversation

@sung17

@sung17 sung17 commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds Instagram comment-to-DM automation (Instagram Login based), split out from Facebook comment automation into its own ig-comments tool/feature with dedicated pages, actions, queries, and components.
  • Continues and builds on the ideas from feat(instagram): add comment-to-DM automation for Instagram Login #809 (community contribution) — thank you to @AlanSyue for the original PR. This supersedes it with a fuller implementation: separate Instagram tool UI/routes, shared dialog components between fb-comments/ig-comments, folder support for both automation types, and several correctness fixes found during review.

Changes

  • New apps/builder/src/features/ig-comments/ feature: actions (create/update/delete/bulk-delete), API (authenticated.ts), queries, schema, components (form, table, posts/connection-type dialogs), and Zustand store.
  • New pages under apps/builder/src/app/space/[workspaceId]/ig-comments/ and the has-folder @folders slot, mirroring the existing fb-comments folder UX.
  • packages/business/src/folder/service.ts: resolveResourceModel now handles fbComment/igComment folder types — fixes "Move to folder" throwing Invalid folder type for all Facebook/Instagram comment automations.
  • fb-comments and ig-comments list queries: fixed root-folder filtering so an automation moved into a folder no longer also shows up in the unfiled/root view.
  • Shared dialog components (apps/builder/src/features/shared/comment-automation/) extracted from the previously duplicated fb-comments/ig-comments delete/rename/schedule/bulk-delete/bulk-move dialogs.
  • fb-comment-posts-store.ts + facebookPostsAPI: consolidated 3 separate post-type fetches into a single API call/store initialization.
  • Shared collectSettled helper (apps/builder/src/lib/collect-settled.ts) for Promise.allSettled + logging, reused by both Instagram media collection and the Facebook posts API.
  • packages/database: new igCommentAutomationTypes partial (single source of truth, replacing the ad-hoc enum in ig-comments/schema/action.ts), new folder migration for igComment folder type.
  • Legacy /fb-comments/[id] URLs for migrated Instagram automations now redirect to /ig-comments/[id] instead of 404ing.
  • integrations/instagram and integrations/instagram-facebook: comment/post APIs and webhook handling to support the comment-automation flow.
  • apps/worker: comment-automation job handler updates for Instagram.

Test plan

  • pnpm lint
  • pnpm --filter builder check-types
  • Manual verification: move a Facebook/Instagram comment automation into a folder and confirm it only appears in that folder, not in the root list
  • Manual verification: rename/delete/bulk-delete/schedule for both fb-comments and ig-comments automations
  • Manual verification: visiting an old /fb-comments/[id] URL for a migrated Instagram automation redirects to /ig-comments/[id]

AlanSyue and others added 3 commits July 24, 2026 02:44
Extend the existing fb-comments comment automation so an Instagram Login
channel can reply to matching comments with a public reply plus a private
DM. Adds the me/messages private reply and me/media listing on
graph.instagram.com, an Instagram post picker in the builder, a platform
selector with Instagram gating (no comment likes), and the worker text-DM
branch. No database migration is required as the type column already exists.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01JVD52t9bnQFDPemU5HEwAC
Splits Instagram comment automation out of fb-comments into a
standalone ig-comments feature, with a connection-type picker
(Instagram Business vs Instagram Login via Facebook), full DM/media
parity for the Facebook-connected variant, and correct per-variant
like-comment gating (previously disabled for both Instagram types).

Also fixes several issues found during review:
- folderService.changeFolder had no case for fbComment/igComment,
  so "move to folder" threw for every comment automation
- the folder-scoped list queries didn't filter at all when no
  folderId was present, so moved items still showed at root
- fb-comment-posts-store made 3 redundant API calls per page load
- de-duplicated 5 pairs of near-identical dialogs between
  fb-comments/ig-comments into features/shared/comment-automation
@github-actions github-actions Bot added the feature New feature or request label Jul 31, 2026
@sung17
sung17 merged commit 196593e into main Jul 31, 2026
7 checks passed
sung17 added a commit that referenced this pull request Aug 17, 2026
…hannels (#961)

processCommentAIReply only dispatched private DMs when channelType was
"messenger" (stale "no private_replies API" comment, predating the
Instagram private-reply support added in #874). instagram and
instagramFacebook silently no-op'd: no send, no throw, no log line
(issue #863). Wires up the already-working
sendInstagramLoginPrivateReply/sendInstagramFacebookPrivateReply
instead, mirroring executePrivateReply's existing three-channel
dispatch.

Also splits the ~830-line comment-automation/index.ts into focused
files (automation-matching, hide-comments, public-reply, private-reply)
and extracts a shared CommentAutomationChannelType, since the
private-reply dispatch table would otherwise need to be duplicated
between index.ts and ai-reply.ts. Adds test coverage for the
instagram/instagramFacebook AI-reply private-DM paths and corrects a
comment-attachment.ts docstring that wrongly implied parity with
executePrivateReply's channel support.

Refs #863

Co-authored-by: Deathgiver <[email protected]>
realcodesiman pushed a commit that referenced this pull request Aug 23, 2026
Both `docs/fb-comment-automation.md` and the `fb-comment-automation` skill still
claimed Instagram comment automation was unimplemented ("the builder always stores
`type = "messenger"`", "IG private-DM text is out of scope"), which has been wrong
since #874 shipped the `ig-comments` builder feature and the `instagram` /
`instagramFacebook` channel types. #831 and #1018 then moved flow-based private
replies onto Meta's comment_id-anchored Send API. None of those PRs touched the
docs, so the guidance actively told readers (and AI agents) not to work on IG.

Rewrite the scope banner, the `type` option row, the reply-type table, the known-gap
bullet and skill trap 6 to describe the three `CommentAutomationChannelType` values,
and record the real per-channel limits: comment liking is messenger +
instagramFacebook only, and the hide image/video attachment lookup is messenger only.


Claude-Session: https://claude.ai/code/session_01Jr3BRqH3woCzbcePEBPira

Co-authored-by: Claude Opus 5 <[email protected]>
viethung0o0 pushed a commit that referenced this pull request Sep 7, 2026
* feat(instagram): add comment-to-DM automation for Instagram Login

Extend the existing fb-comments comment automation so an Instagram Login
channel can reply to matching comments with a public reply plus a private
DM. Adds the me/messages private reply and me/media listing on
graph.instagram.com, an Instagram post picker in the builder, a platform
selector with Instagram gating (no comment likes), and the worker text-DM
branch. No database migration is required as the type column already exists.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01JVD52t9bnQFDPemU5HEwAC

* feat(ig-comments): split instagram comment automation into its own tool

Splits Instagram comment automation out of fb-comments into a
standalone ig-comments feature, with a connection-type picker
(Instagram Business vs Instagram Login via Facebook), full DM/media
parity for the Facebook-connected variant, and correct per-variant
like-comment gating (previously disabled for both Instagram types).

Also fixes several issues found during review:
- folderService.changeFolder had no case for fbComment/igComment,
  so "move to folder" threw for every comment automation
- the folder-scoped list queries didn't filter at all when no
  folderId was present, so moved items still showed at root
- fb-comment-posts-store made 3 redundant API calls per page load
- de-duplicated 5 pairs of near-identical dialogs between
  fb-comments/ig-comments into features/shared/comment-automation

---------

Co-authored-by: alansyue <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Deathgiver <[email protected]>
viethung0o0 pushed a commit that referenced this pull request Sep 7, 2026
…hannels (#961)

processCommentAIReply only dispatched private DMs when channelType was
"messenger" (stale "no private_replies API" comment, predating the
Instagram private-reply support added in #874). instagram and
instagramFacebook silently no-op'd: no send, no throw, no log line
(issue #863). Wires up the already-working
sendInstagramLoginPrivateReply/sendInstagramFacebookPrivateReply
instead, mirroring executePrivateReply's existing three-channel
dispatch.

Also splits the ~830-line comment-automation/index.ts into focused
files (automation-matching, hide-comments, public-reply, private-reply)
and extracts a shared CommentAutomationChannelType, since the
private-reply dispatch table would otherwise need to be duplicated
between index.ts and ai-reply.ts. Adds test coverage for the
instagram/instagramFacebook AI-reply private-DM paths and corrects a
comment-attachment.ts docstring that wrongly implied parity with
executePrivateReply's channel support.

Refs #863

Co-authored-by: Deathgiver <[email protected]>
viethung0o0 pushed a commit that referenced this pull request Sep 7, 2026
Both `docs/fb-comment-automation.md` and the `fb-comment-automation` skill still
claimed Instagram comment automation was unimplemented ("the builder always stores
`type = "messenger"`", "IG private-DM text is out of scope"), which has been wrong
since #874 shipped the `ig-comments` builder feature and the `instagram` /
`instagramFacebook` channel types. #831 and #1018 then moved flow-based private
replies onto Meta's comment_id-anchored Send API. None of those PRs touched the
docs, so the guidance actively told readers (and AI agents) not to work on IG.

Rewrite the scope banner, the `type` option row, the reply-type table, the known-gap
bullet and skill trap 6 to describe the three `CommentAutomationChannelType` values,
and record the real per-channel limits: comment liking is messenger +
instagramFacebook only, and the hide image/video attachment lookup is messenger only.


Claude-Session: https://claude.ai/code/session_01Jr3BRqH3woCzbcePEBPira

Co-authored-by: Claude Opus 5 <[email protected]>

This branch was previously deployed

1 inactive deployment
dev — e5c1157f Deployed Jul 31, 2026 by sung17 via Build mcp-server #2198
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants