Skip to content

docs(ios-uikit): pin/save, pin conversations and thread subscription parity - #519

Open
shreeyajoshi-cometchat wants to merge 8 commits into
mainfrom
docs/ios-pin-save-threads-parity
Open

shreeyajoshi-cometchat wants to merge 8 commits into
mainfrom
docs/ios-pin-save-threads-parity

Conversation

@shreeyajoshi-cometchat

@shreeyajoshi-cometchat shreeyajoshi-cometchat commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

1. Restructure, and remove an API that does not exist (f2312791)

Core features now match the other platforms: Pin Message and Save Message merge into one Pin & Save Messages section (iOS was the only platform splitting them), Pin Conversations is added, and Thread Subscription becomes a subsection of Threaded Conversations rather than a top-level section.

Every component-level enableThreadSubscription the docs described did not exist. It was removed from the message list, both headers, the pinned-messages page (invented wholesale there) and the guide, folding each described behaviour into the flag that does exist. hideThreadSubscriptionOption is likewise not a CometChatMessageList property — it lives on AdditionalConfiguration, and the sample now sets it there.

2. Document the opt-out (cd990e9a)

The feature ships on by default with no dashboard flag, so CometChatThreadSubscriptionConfig.setEnabled(false) is the only way to remove it — and nothing in the iOS docs said so. Adds a Turning the Feature Off section covering the call, how it ANDs with the per-instance hideThreadSubscription* flags (gate = whole app, hide flags = one screen), and that it can be flipped at any time rather than only before CometChatUIKit.init.

…ThreadSubscription

Core features now match the other platforms:

- Pin Message and Save Message merge into one "Pin & Save Messages"
  section. iOS was the only platform splitting them.
- Add "Pin Conversations", which iOS shipped in 5.1.22 undocumented.
- Thread Subscription becomes a subsection of Threaded Conversations
  rather than a top-level section.

Every component-level `enableThreadSubscription` the docs described does
not exist. The only real gate is on UIKitSettings, and the components
expose the `hideThreadSubscription*` half — which is what the other
platforms document too. Removed from the message list, both headers, the
pinned-messages page (invented wholesale there) and the guide, folding
the behaviour each section described into the flag that does exist.

`hideThreadSubscriptionOption` is likewise not a CometChatMessageList
property; it lives on AdditionalConfiguration, so the sample now sets it
there.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The feature ships on by default and has no dashboard flag, so
CometChatThreadSubscriptionConfig.setEnabled(false) is the only way to remove it
from an app — and nothing in the iOS docs said so. Integrators had no way to find
the switch short of reading the kit source.

Adds a "Turning the Feature Off" section to the guide covering the call itself,
how it ANDs with the per-instance hideThreadSubscription* flags (gate = whole
app, hide flags = one screen), and that it can be flipped at any point rather
than only before CometChatUIKit.init. A note records that this is the only
control that will ever exist, and names the Android and React Native equivalents
so a reader arriving from another kit lands in the right place. A warning ported
from the RN guide records that closing the gate hides the controls but does NOT
stop subscriptions or their notifications — users are still auto-subscribed by
replying or being @-mentioned.

Also corrects the reference gate snippet, which listed two of its three clauses
and omitted the gate itself, and cross-references the new section from the four
places a reader meets the feature: core-features, the message list's
hideThreadSubscriptionOption, and hideThreadSubscriptionButton on both headers.
The two header pages already said "while leaving the feature on" without ever
naming what turned it off.

Signatures verified against the kit source: setEnabled takes an unlabelled Bool,
isEnabled() returns Bool.

Documents an API that is committed but not yet built or merged — if the type is
renamed in review, these five files need the same rename.

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

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Verified the bell's on-screen placement against the Android and React kit
sources rather than component names. Every CometChat platform renders the
subscription bell in the thread screen's top bar: Android's CometChatThreadScreen
puts it in CometChatToolbar(actions:) and hides the reply-count bell, and React's
CometChatThreadHeaderTopBar mounts SubscriptionToggle inside __top-bar. On iOS
CometChatMessageHeader in thread mode is what lands it there.

- Document CometChatMessageHeader as the bell to use, with a hosting example
  pinning it to the safe-area top.
- Reframe the CometChatThreadedMessageHeader bell as a fallback for a thread
  screen with no top bar, matching how Android coordinates the two, rather than
  as a co-equal choice.
- Drop the claim that this matches "where the React and React Native kits place
  theirs" — true of the placement, false of the component. React's bell is on
  CometChatThreadHeader and React Native trunk ships no header bell.
- core-features: threadSubscription is enabled by default and spans both
  surfaces (the opt-in gate was removed with UIKitSettings.enableThreadSubscription).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@mintlify

mintlify Bot commented Sep 11, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
cometchat 🟢 Ready View Preview Sep 15, 2026, 10:47 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

The conversations page had zero pin coverage across all 1,592 lines, while
core-features linked to it as the component reference that "provides the
pin/unpin option, the row indicator, and pinned-first ordering" — a promise the
destination page did not keep. `enablePinConversation` was documented nowhere
except one code sample. Every other platform documents this on its own
conversations page: React Native, Android, React and Angular all do.

Adds, modelled on the React Native section:

- `enablePinConversation` and `hidePinConversationOption` prop sections.
- A "Pinning Conversations" section covering pinned-first ordering, the
  private-to-user semantic, and confirm-on-unpin.
- The two gates, which is the part that bites: the swipe action needs the
  `features.ux.conversations.pinned.enabled` app setting mapped AND
  `enablePinConversation`. The kit reads the app setting via
  `CometChat.isPinConversationEnabled()`, restored to the guard in
  uikit-ios 51a047c6c now that the backend has shipped the flag.
- Admin pins, with the `pinnedAt` / `pinnedBy` reads an integrator needs to
  detect one. Both are @objc public on the SDK's Conversation; the kit's own
  `systemPinner` constant is internal, so the "app_system" sentinel has to be
  compared directly — noted as a gap against RN's
  `isSystemPinnedConversation()`.
- The `PinConversationErrorCodes` table.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…guide

Matches the structure Android (#521) and React Native
(#516) landed on: thread subscription is a behaviour of
threads, not a separate feature, so it reads better in one place.

- Delete guide-thread-subscription.mdx, merging it into
  guide-threaded-messages.mdx as a "Thread Subscription" section with
  its subsections demoted a level.
- Drop the nav entry and add a docs.json redirect to the new anchor.
- Repoint the 8 inbound links; the three deep links keep their
  #turning-the-feature-off anchor.
- Remove the "Copy and Localization" string table for parity — no
  other platform documents per-feature localization keys in a guide,
  and ios/localize.mdx already points at the repo as the key list.
  The VoiceOver-only label it documented is kept as a Behavior bullet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ntrols

Drops the app-wide CometChatThreadSubscriptionConfig gate from the docs,
matching React Native (#516, which removes its equivalent
ThreadSubscriptionConfig) and Android (#521, which removes
setEnableThreadSubscription without documenting the replacement). The
per-surface hide flags are the documented control surface on every kit.

- Remove the "Turning the Feature Off" section.
- State on-by-default and the not-a-dashboard-flag caveat under
  "The Surfaces", where the hide flags are introduced.
- Drop the gate line from the kit's-gate code comment, keeping the
  parentMessageId == 0 rule the snippet exists to explain.
- Repoint core-features, message-list and message-header at the
  per-surface flags.

The app-wide path was never documented for iOS, so no published
integration relies on it; UIKitSettings.enable(threadSubscription:) and
CometChatUIKit.isThreadSubscriptionEnabled() appear nowhere on main.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@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.

Review: iOS UI Kit pin/save, pin conversations and thread subscription

Requesting changes. The restructure is good, and removing the component-level enableThreadSubscription properties is correct — none of them exist in the source. But parts of the new text describe thread subscription and pin conversations as they work on an unmerged UI Kit branch, not as they work in the published v5.1.22. Everything below was checked against release-v5-5.1.22 (identical to master-v5 for these files).

🔴 Blockers

1. "On by default" is wrong for 5.1.22

In 5.1.22 the feature is off unless the app opts in through UIKitSettings (UIKitSettings.swift:27, CometChatUIKit.swift:69):

var enableThreadSubscription = false
public func enable(threadSubscription: Bool) -> Self

The message-list option, the CometChatMessageHeader bell and the CometChatThreadedMessageHeader bell all check CometChatUIKit.isThreadSubscriptionEnabled() first. The sample app and master app both call .enable(threadSubscription: true).

"On by default" comes from feat/eng-37574-remove-threadsubscription-opt-in (uikit-ios PR #983), which is still open and based on ashfaq/eng-38638/merge-aditya, not dev-v5. A 5.1.22 customer following these docs will never see the bell or the action-sheet option, and no page tells them about enable(threadSubscription:).

Affected: core-features.mdx (enabledByDefault: true + "not gated" prose), guide-threaded-messages.mdx ("Both are shown by default"), message-header.mdx.

Fix, either: document the opt-in for now —

let uikitSettings = UIKitSettings()
    // ...
    .enable(threadSubscription: true)

or hold this PR until #983 ships and add the version it lands in.

2. The hideThreadSubscriptionOption snippet does nothing (message-list.mdx)

The snippet sets the flag on CometChatMessageHeader.additionalConfiguration. The header only uses that configuration for its own auxiliary menu (CometChatMessageHeader.swift:288); the action-sheet option reads the message list's configuration (MessagesDataSource.swift:192 / :778). The list exposes it via getAdditionalConfiguration(), and AdditionalConfiguration is a class, so this works:

messageList.getAdditionalConfiguration().hideThreadSubscriptionOption = true

Also, guide-threaded-messages.mdx and core-features.mdx use messageListView.hideThreadSubscriptionOption = true — that property doesn't exist on CometChatMessageList, so it won't compile.

3. The pin-conversation gate is described wrong (conversations.mdx Warning)

The Warning says two gates are required: the app setting via CometChat.isPinConversationEnabled() and enablePinConversation. In 5.1.22 the app-setting check is removed (CometChatConversations.swift:614, marked TEMPORARY — REVERT BEFORE MERGE); only enablePinConversation && !hidePinConversationOption is checked. It's restored in 51a047c6c, which is on the same unmerged branch. Either scope the Warning to the release that restores the check, or say 5.1.22 only needs enablePinConversation.

🟠 Should fix

  • Broken anchor /ui-kit/ios/message-header#thread-subscription — used twice in threaded-messages-header.mdx, both added in this PR. message-header.mdx has no such heading; the closest is #hidethreadsubscriptionbutton.
  • Stale PR description — it describes a "Turning the Feature Off" section using CometChatThreadSubscriptionConfig.setEnabled(false). Neither is on the branch any more (later commits removed them), and that class doesn't exist in 5.1.22. Please update the description.

✅ Verified correct

  • Deleted guide redirects to guide-threaded-messages#thread-subscription; the anchor exists and no iOS links to the old URL remain.
  • enablePinConversation / hidePinConversationOption (Bool, default false), PinConversationErrorCodes, the "app_system" system-pin value, and the pinnedAt 0-sentinel note all match 5.1.22. Unpin does confirm first (PinSaveConfirmation.present(.unpinConversation…)).
  • hideThreadSubscriptionButton exists on both headers (property + set(...)); the parent-message-only rule (parentMessageId == 0) is correct; the master app hides the reply-count-bar bell, matching the new navigation-bar guidance.
  • The Pin & Save merge and the new Pin Conversations section match the other platforms.

The snippet set the flag on a new AdditionalConfiguration and assigned it
to CometChatMessageHeader. That cannot work: CometChatMessageList has no
additionalConfiguration setter (the view model's is internal), and the
header's own copy only feeds getAuxiliaryHeaderMenu, never the message
actions.

Use getAdditionalConfiguration() instead, which returns the list's own
configuration object. AdditionalConfiguration is a class and the message
template's options closure reads it when the actions are built, so a
mutation through the getter is picked up on the next presentation.

Also restores the props-table row. The flag was never a CometChatMessageList
property, so removing the row left the only reference to a flag that still
exists; it is back with a note saying where it actually lives.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The guide mentioned the two hide flags in passing but never gathered them,
so an integrator asking "how do I turn this off" had to piece it together
from three separate sections. Adds a "Hiding the Controls" subsection with
a table covering all three surfaces — the action-sheet option, the
navigation-bar bell and the reply-count-bar bell — matching how the React
Native guide presents the same choice.

States plainly that there is no single switch: the feature is removed on
each instance that renders it.

Also corrects the hide snippet lower in the same section, which set
hideThreadSubscriptionOption directly on the message list. That flag lives
on AdditionalConfiguration and is reached through
getAdditionalConfiguration(), as message-list.mdx now says.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

2 participants