Skip to content

docs(flutter): thread subscriptions, pin & save, composer trailing to… - #461

Open
anshuman-cometchat wants to merge 8 commits into
cometchat:mainfrom
anshuman-cometchat:feature/thread-pin-save
Open

docs(flutter): thread subscriptions, pin & save, composer trailing to…#461
anshuman-cometchat wants to merge 8 commits into
cometchat:mainfrom
anshuman-cometchat:feature/thread-pin-save

Conversation

@anshuman-cometchat

@anshuman-cometchat anshuman-cometchat commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

Adds Flutter documentation for three newly shipped feature sets across the SDK (v5) and UI Kit (v6):

SDK (v5) — new pages, registered in the Messaging nav group:

  • Pin Messages (sdk/flutter/pin-messages) — pin/unpin APIs, permission model, real-time onMessagePinned/onMessageUnpinned events, fetching a conversation's pinned list via MessagesRequestBuilder, feature availability (isPinMessageEnabled()), limits and cap-error handling with errorParams.
  • Save Messages (sdk/flutter/save-messages) — private per-user bookmarks: save/unsave, own-device sync events, fetching saved messages, feature flag and limits.
  • Pin Conversations (sdk/flutter/pin-conversations) — pin/unpin, ConversationListener events, app_system (admin) pins, list-ordering contract, feature flag and limits.

SDK (v5) — extended:

  • Threaded Messages — new Thread Subscriptions section: subscribeToThread()/unsubscribeFromThread(), reading per-viewer state from BaseMessage.threadSubscribed, re-reading it for one message with getMessageDetails(), handling replies on the standard MessageListener, and fetching participated threads with ThreadsRequest.

UI Kit (v6) — extended:

  • Message Composer — new Trailing toolbar actions section documenting richTextToolbarActions and CometChatMessageComposerAction.onToolbarTap, including the web selection-blur caveat, plus RichTextEditingController.getMentionRanges.
  • Conversations — new Pin Conversations section (long-press option, pinned-shelf ordering, live sync) and the pinConversationOptionVisibility property.
  • Message List — pin/save entries in the SDK-events and option-visibility tables, plus a Pin or save a message pattern.
  • Threaded Messages guide — new Thread Subscriptions section covering the UIKitSettings.enableThreadSubscription gate, the action-menu options, and the header notification bell.

All snippets follow the existing house conventions (<Tabs> Dart blocks, cascade builders, debugPrint callbacks) and API names were verified against the source of both packages.

Related Issue(s)

N/A — tracked internally (ENG-37600 / ENG-37601).

Type of Change

  • Documentation correction/update
  • New documentation
  • Improvement to existing documentation
  • Typo fix
  • Other (please specify)

Checklist

  • I have read the CONTRIBUTING document
  • My branch name follows the naming convention
  • My changes follow the documentation style guide
  • I have checked for spelling and grammar errors
  • All links in my changes are valid and working
  • My changes are accurately described in this pull request

Additional Information

  • The three new SDK pages are registered in docs.json under SDKs → Flutter → Messaging (pin/save after Delete a Message, pin-conversations after Delete a Conversation).
  • These are the first docs for these features on any platform; other platforms can mirror this structure.
  • The conversation-pin cap error is described generically (no error code named) pending confirmation of the code the backend returns.
  • Verified locally with mint dev — all eight touched pages render.

Re-verified against the combined SDK release branch

The Thread Subscriptions section was re-checked against release-2026-v5.0.7-combined, the branch that carries the thread work together with the notification changes for the release. Two corrections came out of it:

  • ThreadsRequest.fetchNext() takes required onSuccess/onError callbacks, like every other request builder in the SDK. The page awaited a bare fetchNext(), which does not compile. Fixed, plus setUid()/setGuid() scoping and the single-use-request contract are now documented.
  • getMessageDetails() is documented as the supported way to re-read threadSubscribed for a single message, since the flag is absent on socket-delivered messages.

Every CometChat.* method, listener callback, model field and builder method on the four SDK pages was checked against lib/ on that branch.

Notification changes from the same release branch

The release branch also carries the quoted-replies preference and the FCM_WEB push provider, so the notifications/ pages were checked against it too. Flutter tabs only — the JavaScript, Android and iOS tabs are untouched.

  • notifications/preferences.mdx — the Flutter tabs typed the quoted-replies preference as RepliesOptions, but the Flutter SDK declares QuotedRepliesOptions? quotedReplies on both GroupPreferences and OneOnOnePreferences, so those four snippets did not compile. The type is deliberately distinct: values 1-3 coincide with RepliesOptions, but keeping them separate turns a cross-assignment into a compile error rather than a silently wrong setting.
  • notifications/push-overview.mdx — a note under the platform cards pointing Flutter web builds at PushPlatforms.FCM_WEB (fcm_web) and the fcmToken argument. There is no Flutter web guide: the existing Flutter push pages are walkthroughs of the UI Kit sample app, which has no web variant, so a full guide is left until there is a sample to base it on.

Deliberately not covered here

  • RepliesOptions.SUBSCRIBE_TO_SUBSCRIBED_THREADS ships in the SDK as a forward-compatibility placeholder — the backend has not rolled out the value yet, so documenting it now would describe a preference users cannot set.

Screenshots (if applicable)

N/A — text and code-snippet changes only.

🤖 Generated with Claude Code

…olbar actions

- New SDK v5 pages: Pin Messages, Save Messages, Pin Conversations
  (events, fetching, feature flags, limits and cap error handling)
- Thread Subscriptions section on the SDK Threaded Messages page
  (subscribe/unsubscribe, cached state, ThreadListener, ThreadsRequest)
- UI Kit v6: trailing toolbar actions on Message Composer
  (richTextToolbarActions + onToolbarTap), Pin Conversations section
  and option visibility on Conversations, pin/save options + events on
  Message List, thread-subscription gate and bell on the Threaded
  Messages guide
- Register the three new SDK pages in the Messaging nav group

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
anshuman-cometchat and others added 6 commits August 12, 2026 20:07
…esign

Subscription state now lives on the message (threadSubscribed boolean,
served on every fetch), the resolved subscribe/unsubscribe call is the
acknowledgement, and replies arrive on the standard MessageListener —
no ThreadListener, no getThreadSubscriptionState, no SDK-side events.
Documents the two consumer rules: an un-asked false means "the server
did not tell me", and a fetched false on the author's own message is an
explicit unsubscribe.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The option table and example implied one flag per feature. The kit has
four: the menu renders Pin or Unpin (Save or Unsave) depending on the
message, and each rendered state has its own flag —
message_template_utils picks hideUnpinMessageOption when the message is
pinned and hidePinMessageOption when it is not.

As written, hidePinMessageOption: true still left "Unpin" on the menu for
already-pinned messages, which is the opposite of what the example
suggests it does.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…sing

New pages for CometChatPinnedMessages and CometChatSavedMessages — both
are publicly exported in 6.1.1 and had no documentation at all — added to
the Components nav.

Also documents, against the shipped source rather than the design docs:

- The five new Kit events (ccMessagePinned/Unpinned/Saved/Unsaved and
  ccThreadSubscriptionChanged) in events.mdx, noting they are default
  no-ops so existing listeners keep compiling.
- CometChatMessageListController.jumpToMessage in message-list.mdx, with a
  warning that v5 had a different class of the same name which the upgrade
  guide maps to MessageListBloc.
- hideThreadSubscriptionOption in the message-list option table.
- The header's pinned-messages entry point and thread-subscription bell.
  Documented as an item in the overflow menu, which is where
  _overflowEntries actually puts it — the prop's own doc comment still
  says "pin icon in the trailing area" and is stale.
- onThreadSubscriptionChange and threadSubscriptionVisibility on
  CometChatThreadedHeader.

Every internal link resolves and docs.json still parses.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The last undocumented piece of 6.1.1's public surface. It came back with
the trailing-toolbar restore and is genuinely public: the controller is
exported through the rich_text_toolbar barrel, which cometchat_chat_uikit
re-exports.

Documented where it is actually useful — a trailing toolbar action that
restyles a range and should leave mentions with the styling the mentions
formatter gives them. Notes that the ranges come from the attached
CometChatMentionsFormatter, are sorted by start offset, and are empty when
no mentions formatter is attached; the example guards the cast, since a
plain TextEditingController has no such method.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…tails

Checked the Flutter thread-subscription page against the SDK's combined
5.0.7 branch, where the thread work now sits alongside the notification
changes.

- fetchNext() takes required onSuccess/onError callbacks, matching every
  other request builder in the SDK. The snippet awaited a bare
  fetchNext(), which does not compile.
- Document setUid()/setGuid() for scoping a thread list to one
  conversation, and note that setting both fails validation at fetch time.
- Note that a ThreadsRequest is single-use, so a refresh means building a
  new request rather than re-running an exhausted one.
- Add getMessageDetails(), which carries the subscription opt-in and is
  the supported way to re-read threadSubscribed for a single message —
  the flag is absent on socket-delivered messages.

Every identifier on the page verified against lib/ on the SDK branch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Flutter tabs typed the quoted-replies preference as RepliesOptions.
The Flutter SDK declares it as its own type:

  QuotedRepliesOptions? quotedReplies;

on both GroupPreferences and OneOnOnePreferences, so the snippets did not
compile. The type is deliberately separate from RepliesOptions — values
1-3 coincide, but an option is only meaningful within its own preference,
and the distinct type makes a cross-assignment a compile error rather
than a silently wrong setting.

Fixes the two read snippets and the two constructor snippets. Only the
Flutter tabs change; the JavaScript, Android and iOS tabs keep
RepliesOptions, which is correct for those SDKs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Flutter SDK gained PushPlatforms.FCM_WEB ('fcm_web') for registering
an FCM token from a web build, but the push guides cover only Flutter on
Android and iOS.

Adds a note under the platform cards pointing web builds at the right
provider and the fcmToken argument, and says the dashboard setup is
unchanged from the Flutter (Android) guide. A full Flutter web walkthrough
is left for when there is a sample app to base it on — the existing
Flutter guides are walkthroughs of the UI Kit sample, which has no web
variant.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jitvarpatil

Copy link
Copy Markdown
Contributor

Docs review — ✅ Approve (one should-fix)

Six new Flutter pages + UI Kit updates for thread subscriptions, pin/save messages, and pin conversations. Structurally clean, and every documented API verifies against the published pub.dev packages. One gap worth fixing before this ships.

✅ API verified against published packages

cometchat_sdk — all 12 documented APIs exist and are static on CometChat, matching the docs' CometChat.x() usage:
pinMessage · unpinMessage · saveMessage · unsaveMessage · pinConversation · unpinConversation · subscribeToThread · unsubscribeFromThread · isPinMessageEnabled · isPinConversationEnabled · getPinnedMessagesLimit · MessageThread / ThreadsRequest / threadSubscribed

cometchat_chat_uikitCometChatPinnedMessages, CometChatSavedMessages, CometChatThreadedHeader + all three *Style classes, and the ccMessagePinned / ccMessageSaved events all exist.

Structure: all 7 new pages wired into nav; 0 nav breaks, 0 orphans, 0 broken links, redirects +0; no placeholders/TODOs across 956 new lines.

🟡 Should-fix — no minimum SDK / UI Kit version stated anywhere

I traced exactly when each API landed:

Package Feature Present in Absent in
cometchat_sdk pin / save / thread APIs 5.0.7 only 5.0.4, 5.0.5, 5.0.6
cometchat_chat_uikit CometChatPinnedMessages / CometChatSavedMessages 6.1.1 only 6.0.5, 6.1.0

A developer on cometchat_sdk 5.0.6 or cometchat_chat_uikit 6.1.0 — both of which were the latest until very recently — will follow these pages and hit "method doesn't exist" compile errors, with nothing in the docs explaining why.

Suggested fix, matching the precedent from the transcription PR (#487), which added per-platform availability callouts:

<Note>
**Available since v5.0.7** — pin, save, and thread subscriptions require
`cometchat_sdk` v5.0.7 or later. See [Setup](/sdk/flutter/setup) to upgrade.
</Note>

…and the equivalent on the UI Kit pages for cometchat_chat_uikit 6.1.1+.

(CometChatThreadedHeader is the exception — it predates 6.1.1, so the threaded-header page doesn't need the UI Kit note.)

Content is accurate and well-structured; it just needs the version guardrail so integrators aren't debugging phantom compile errors. Approving on the assumption that lands here or in a quick follow-up. 🚀

🤖 Automated docs review (Mintlify link/redirect/nav checks + API verification against published cometchat_sdk / cometchat_chat_uikit dartdocs).

@jitvarpatil jitvarpatil left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Docs review — ✅ Approve (one should-fix)

Six new Flutter pages + UI Kit updates for thread subscriptions, pin/save messages, and pin conversations. Structurally clean, and every documented API verifies against the published pub.dev packages. One gap worth fixing before this ships.

✅ API verified against published packages

cometchat_sdk — all 12 documented APIs exist and are static on CometChat, matching the docs' CometChat.x() usage:
pinMessage · unpinMessage · saveMessage · unsaveMessage · pinConversation · unpinConversation · subscribeToThread · unsubscribeFromThread · isPinMessageEnabled · isPinConversationEnabled · getPinnedMessagesLimit · MessageThread / ThreadsRequest / threadSubscribed

cometchat_chat_uikitCometChatPinnedMessages, CometChatSavedMessages, CometChatThreadedHeader + all three *Style classes, and the ccMessagePinned / ccMessageSaved events all exist.

Structure: all 7 new pages wired into nav; 0 nav breaks, 0 orphans, 0 broken links, redirects +0; no placeholders/TODOs across 956 new lines.

🟡 Should-fix — no minimum SDK / UI Kit version stated anywhere

I traced exactly when each API landed:

Package Feature Present in Absent in
cometchat_sdk pin / save / thread APIs 5.0.7 only 5.0.4, 5.0.5, 5.0.6
cometchat_chat_uikit CometChatPinnedMessages / CometChatSavedMessages 6.1.1 only 6.0.5, 6.1.0

A developer on cometchat_sdk 5.0.6 or cometchat_chat_uikit 6.1.0 — both of which were the latest until very recently — will follow these pages and hit "method doesn't exist" compile errors, with nothing in the docs explaining why.

Suggested fix, matching the precedent from the transcription PR (#487), which added per-platform availability callouts:

<Note>
**Available since v5.0.7** — pin, save, and thread subscriptions require
`cometchat_sdk` v5.0.7 or later. See [Setup](/sdk/flutter/setup) to upgrade.
</Note>

…and the equivalent on the UI Kit pages for cometchat_chat_uikit 6.1.1+.

(CometChatThreadedHeader is the exception — it predates 6.1.1, so the threaded-header page doesn't need the UI Kit note.)

Content is accurate and well-structured; it just needs the version guardrail so integrators aren't debugging phantom compile errors. Approving on the assumption that lands here or in a quick follow-up. 🚀

🤖 Automated docs review (Mintlify link/redirect/nav checks + API verification against published cometchat_sdk / cometchat_chat_uikit dartdocs).

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants