Skip to content

Conversation

@sacOO7
Copy link
Contributor

@sacOO7 sacOO7 commented Feb 12, 2026

Summary by CodeRabbit

Release Notes

  • Documentation

    • Updated chat documentation to target Android platform instead of Jetpack, with Android-specific code examples and language targeting throughout guides.
  • Chores

    • Updated language configuration to consolidate platform support, removing deprecated identifiers and updating syntax highlighting preferences.

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

Walkthrough

Replaces the "jetpack" language designation with "android" across language configuration and documentation. Updates include renaming keys in languageData, adjusting languageInfo entry (alias and syntaxHighlighterKey), removing entries from languageKeys, and swapping documentation language guards and code-fence labels to "android".

Changes

Cohort / File(s) Summary
Language configuration
src/data/languages/languageData.ts, src/data/languages/languageInfo.ts, src/data/languages/types.ts
Renamed jetpackandroid in languageData; updated android entry in languageInfo (added alias: "android-full", changed syntaxHighlighterKey to kotlin); removed jetpack (and typescript) from languageKeys in types.
Docs — chat core & setup
src/pages/docs/chat/connect.mdx, src/pages/docs/chat/setup.mdx, src/pages/docs/chat/getting-started/android.mdx
Replaced <If lang="jetpack"> guards with <If lang="android">; updated code-fence language tags (e.g., jetpack → android, some kotlin → android) and minor comment wording.
Docs — rooms & features
src/pages/docs/chat/rooms/..., src/pages/docs/chat/rooms/index.mdx, src/pages/docs/chat/rooms/history.mdx, src/pages/docs/chat/rooms/media.mdx, src/pages/docs/chat/rooms/message-reactions.mdx, src/pages/docs/chat/rooms/messages.mdx, src/pages/docs/chat/rooms/occupancy.mdx, src/pages/docs/chat/rooms/presence.mdx, src/pages/docs/chat/rooms/reactions.mdx, src/pages/docs/chat/rooms/replies.mdx, src/pages/docs/chat/rooms/typing.mdx
Systematically swapped jetpack language guards and code-fence tags for android; updated Compose/Kotlin examples to use Android-targeted labels and adjusted some imports/comments to match android designation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • AndyTWF
  • ttypic

Poem

🐰 I hopped through tags and gave a nudge,

swapped jetpack wings for android's hug.
Snippets now hum in Kotlin's song,
LLMs read clearer, hopping along. 🥕✨

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix android annotation for jetpack' accurately reflects the main change: migrating Jetpack language annotations to Android throughout the codebase and documentation.
Linked Issues check ✅ Passed The pull request successfully addresses DX-553 by replacing Jetpack annotations with Android annotations across code data files and documentation to improve LLM snippet interpretation.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the linked issue objective to migrate Jetpack annotations to Android annotations; no unrelated changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/android-annotation-for-jetpack

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sacOO7 sacOO7 force-pushed the fix/android-annotation-for-jetpack branch 3 times, most recently from 46f3dbc to 2e520e2 Compare February 12, 2026 07:28
@sacOO7 sacOO7 added the review-app Create a Heroku review app label Feb 12, 2026
@sacOO7 sacOO7 requested a review from Copilot February 12, 2026 07:31
@ably-ci ably-ci requested a deployment to ably-docs-fix-android-a-cndmol February 12, 2026 07:31 Abandoned
@sacOO7
Copy link
Contributor Author

sacOO7 commented Feb 12, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/pages/docs/chat/rooms/reactions.mdx (1)

60-73: ⚠️ Potential issue | 🟡 Minor

Missing asFlow import in the reactions subscribe example.

Line 68 calls room.reactions.asFlow(), but the imports on lines 61–63 don't include the asFlow extension. In messages.mdx (line 68), com.ably.chat.asFlow is explicitly imported. Add it here for consistency and correctness.

Proposed fix
 import androidx.compose.runtime.*
 import com.ably.chat.Room
 import com.ably.chat.RoomReactionEvent
+import com.ably.chat.asFlow
src/pages/docs/chat/rooms/presence.mdx (1)

213-242: ⚠️ Potential issue | 🟡 Minor

Empty DisposableEffect.onDispose block with a TODO-like comment is misleading in documentation.

Lines 234–239 show a DisposableEffect with an empty onDispose block and a comment suggesting the reader "consider using a coroutine scope for leave()." Documentation examples should either demonstrate the complete pattern or omit the incomplete pattern entirely. Leaving an empty cleanup block may confuse developers trying to implement presence lifecycle management.

Consider either implementing the cleanup (e.g., using rememberCoroutineScope to call room.presence.leave() in onDispose) or removing the DisposableEffect block and adding a prose note about cleanup considerations.

Option A: Implement the cleanup
+@Composable
+fun EnterPresenceComponent(room: Room) {
+  val coroutineScope = rememberCoroutineScope()
+
   LaunchedEffect(room) {
-    // Ensure room is attached before entering presence
-    if (room.status != RoomStatus.Attached) {
-      room.attach()
-    }
-
     room.presence.enter(
       jsonObject {
         put("status", "Online")
       }
     )
   }
 
-  // Leave presence when component is disposed
   DisposableEffect(room) {
     onDispose {
-      // Note: Consider using a coroutine scope for leave()
-      // as DisposableEffect doesn't support suspend functions directly
+      coroutineScope.launch {
+        room.presence.leave()
+      }
     }
   }
 }
Option B: Remove incomplete block
 `@Composable`
 fun EnterPresenceComponent(room: Room) {
   LaunchedEffect(room) {
-    // Ensure room is attached before entering presence
-    if (room.status != RoomStatus.Attached) {
-      room.attach()
-    }
-
     room.presence.enter(
       jsonObject {
         put("status", "Online")
       }
     )
   }
-
-  // Leave presence when component is disposed
-  DisposableEffect(room) {
-    onDispose {
-      // Note: Consider using a coroutine scope for leave()
-      // as DisposableEffect doesn't support suspend functions directly
-    }
-  }
 }
🧹 Nitpick comments (5)
src/pages/docs/chat/setup.mdx (1)

202-215: The android and kotlin instantiation snippets are identical.

The android code block (lines 202–215) is a verbatim copy of the kotlin block (lines 187–200). For setup/instantiation this is expected since there's no Compose-specific code, but consider whether showing an identical block under a separate tab adds value or could confuse users.

src/pages/docs/chat/rooms/media.mdx (1)

97-121: Several android blocks duplicate kotlin blocks verbatim.

For example, uploadMedia() (lines 97–121) and getValidMedia() (lines 451–472) are identical to their kotlin counterparts. The same applies to the removeMediaFromMessage logic. Where no Compose-specific code is involved, consider whether both tabs are needed or if the android tab could reference the kotlin block to reduce maintenance burden.

src/pages/docs/chat/rooms/message-reactions.mdx (1)

522-550: The android and kotlin Message/MessageReactionSummary interface blocks are identical.

Same observation as other files — this is a type definition block with no Compose-specific code. These identical tabs increase maintenance surface.

src/pages/docs/chat/rooms/messages.mdx (1)

272-274: Android get snippet is identical to the Kotlin snippet — consider whether a separate block is needed.

Lines 268–270 (kotlin) and 272–274 (android) contain the exact same code. If the intent is for the android block to demonstrate a Compose-specific pattern (as done in other sections like subscribe/send/update/delete), this block should be updated to show a Compose example. If the API call is the same regardless, this duplication is acceptable but may confuse readers expecting Compose-style examples.

src/pages/docs/chat/rooms/reactions.mdx (1)

97-99: Stale "Jetpack Compose" terminology in <If lang="android"> block.

The PR objective is to move from "Jetpack" to "Android" annotations to improve LLM comprehension. While "Jetpack Compose" is the official technology name, this text appears inside a block conditioned on lang="android". For consistency with the migration goals, consider rephrasing to "Android Compose" or simply describing the behavior without the framework name (e.g., "Lifecycle and cleanup are handled automatically when using LaunchedEffect with asFlow."). The same pattern occurs in typing.mdx (line 117), presence.mdx (line 119), and occupancy.mdx (line 150).

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Chat documentation and language configuration to replace the legacy jetpack language marker with android, ensuring Jetpack Compose-specific Kotlin snippets render under the Android language selection (DX-553).

Changes:

  • Replaced jetpack with android in Chat MDX <If lang="..."> conditions and code fence language tags across setup/rooms/connect/getting-started docs.
  • Removed the jetpack language entry from language metadata and updated Android language metadata (including syntax highlighting key).
  • Updated Chat product language-version mapping to use android instead of jetpack.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/pages/docs/chat/setup.mdx Switches Compose/Jetpack-specific blocks from jetpack to android for correct rendering under Android.
src/pages/docs/chat/connect.mdx Updates Compose-related sections/snippets to be keyed under android.
src/pages/docs/chat/getting-started/android.mdx Re-keys fenced snippets to android so the page consistently renders as Android-focused.
src/pages/docs/chat/rooms/index.mdx Replaces jetpack language targeting with android for rooms overview snippets/sections.
src/pages/docs/chat/rooms/history.mdx Updates jetpack sections/snippets to android for history-related Compose guidance.
src/pages/docs/chat/rooms/messages.mdx Re-keys Compose snippets and language-conditional prose from jetpack to android.
src/pages/docs/chat/rooms/message-reactions.mdx Re-keys Compose-specific reactions docs/snippets from jetpack to android.
src/pages/docs/chat/rooms/occupancy.mdx Re-keys Compose occupancy docs/snippets from jetpack to android.
src/pages/docs/chat/rooms/presence.mdx Re-keys Compose presence docs/snippets from jetpack to android.
src/pages/docs/chat/rooms/reactions.mdx Re-keys Compose room reactions docs/snippets from jetpack to android.
src/pages/docs/chat/rooms/replies.mdx Re-keys Compose reply snippets from jetpack to android.
src/pages/docs/chat/rooms/typing.mdx Re-keys Compose typing docs/snippets from jetpack to android.
src/pages/docs/chat/rooms/media.mdx Re-keys Compose media snippets from jetpack to android.
src/data/languages/types.ts Removes jetpack from supported language keys.
src/data/languages/languageInfo.ts Removes jetpack language info; updates android language metadata (syntax highlighting key + alias).
src/data/languages/languageData.ts Updates Chat product language mapping from jetpack to android.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sacOO7 sacOO7 marked this pull request as ready for review February 12, 2026 07:50
@sacOO7 sacOO7 requested review from GregHolmes and ttypic February 12, 2026 07:57
@sacOO7 sacOO7 force-pushed the fix/android-annotation-for-jetpack branch from 2e520e2 to 91b4ffd Compare February 12, 2026 08:01
@ably-ci ably-ci requested a deployment to ably-docs-fix-android-a-cndmol February 12, 2026 08:01 Abandoned
@ably-ci ably-ci requested a deployment to ably-docs-fix-android-a-cndmol February 12, 2026 08:41 Abandoned
@sacOO7 sacOO7 force-pushed the fix/android-annotation-for-jetpack branch from 3a37fa8 to 9ab8f36 Compare February 12, 2026 09:11
@ably-ci ably-ci requested a deployment to ably-docs-fix-android-a-cndmol February 12, 2026 09:11 Abandoned
'rest',
'css',
'laravel',
'typescript',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

typescript here is a duplicate entry

Copy link
Contributor

@ttypic ttypic left a comment

Choose a reason for hiding this comment

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

LGTM

- Replace 'jetpack' language annotation with 'android' across all Chat MDX files
- Update languageData.ts, languageInfo.ts, and types.ts for android language
- Change android syntaxHighlighterKey from 'java' to 'kotlin'
@sacOO7 sacOO7 force-pushed the fix/android-annotation-for-jetpack branch from 9ab8f36 to a09e172 Compare February 13, 2026 06:36
@ably-ci ably-ci temporarily deployed to ably-docs-fix-android-a-cndmol February 13, 2026 06:36 Inactive
@sacOO7
Copy link
Contributor Author

sacOO7 commented Feb 13, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/pages/docs/chat/rooms/presence.mdx (1)

213-242: ⚠️ Potential issue | 🟡 Minor

DisposableEffect cleanup is incomplete — leave() is not actually called on dispose.

Lines 234–239 show a DisposableEffect with an onDispose block that only contains a comment suggesting to "consider using a coroutine scope for leave()". This leaves presence cleanup unimplemented. Users following this example won't actually leave presence when the component is disposed.

Consider either implementing the cleanup (e.g., using rememberCoroutineScope at the composable level) or removing the DisposableEffect block and adding a note explaining that presence leave is handled via connection lifecycle.

Proposed fix: implement leave on dispose
 `@Composable`
 fun EnterPresenceComponent(room: Room) {
+  val coroutineScope = rememberCoroutineScope()
+
   LaunchedEffect(room) {
     // Ensure room is attached before entering presence
     if (room.status != RoomStatus.Attached) {
       room.attach()
     }
 
     room.presence.enter(
       jsonObject {
         put("status", "Online")
       }
     )
   }
 
   // Leave presence when component is disposed
   DisposableEffect(room) {
     onDispose {
-      // Note: Consider using a coroutine scope for leave()
-      // as DisposableEffect doesn't support suspend functions directly
+      coroutineScope.launch {
+        room.presence.leave()
+      }
     }
   }
 }
🧹 Nitpick comments (4)
src/pages/docs/chat/rooms/message-reactions.mdx (3)

62-68: Android code block is identical to the Kotlin block above — consider adding Compose context.

Lines 54–60 (kotlin) and 62–68 (android) contain the exact same snippet. Other android blocks in this file wrap the API call in a @Composable function with coroutine scope. For consistency, consider either adding a Compose wrapper here too, or adding a comment clarifying that the non-Compose usage is identical to Kotlin.


805-811: Same observation: android block duplicates the kotlin block verbatim.

Lines 797–803 (kotlin) and 805–811 (android) are identical. The other android snippets in this file provide Jetpack Compose context (e.g., @Composable, LaunchedEffect). Consider adding Compose-specific wrapping for consistency, or a brief comment noting the setup is identical.


522-550: Android and Kotlin blocks for message reaction summary structure are identical.

Lines 492–520 (kotlin) and 522–550 (android) show the same MessageReactionSummary interface and example. Since this is a data structure description rather than a usage example, duplication is more understandable, but worth noting for consistency with the rest of the file's approach.

src/pages/docs/chat/rooms/history.mdx (1)

75-86: Android code block duplicates the Kotlin block verbatim.

Both the kotlin (lines 62–73) and android (lines 75–86) code fences contain identical code. If these always stay in sync, consider whether a shared snippet or a combined language annotation could reduce maintenance burden. That said, if the intent is for them to diverge later (e.g., Compose-specific pagination), the duplication is acceptable.

@sacOO7 sacOO7 merged commit 4bc0c75 into main Feb 13, 2026
7 checks passed
@sacOO7 sacOO7 deleted the fix/android-annotation-for-jetpack branch February 13, 2026 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

4 participants