Skip to content

Conversation

@VelikovPetar
Copy link
Contributor

@VelikovPetar VelikovPetar commented Dec 17, 2025

🎯 Goal

Fixes 2 bugs:

  1. Compose: Allow opening threads whose parent message was deleted
  2. XML: Show the X Thread Replies footer for deleted messages, and allow opening those threads

Resolves: https://linear.app/stream/issue/AND-273/chatcompose-the-thread-is-locked-after-deleting-a-parent-message

🛠 Implementation details

  1. Compose: Update the clickModifier in MessageItem to always handle clicks if the message belongs to a thread
  2. XML: Add the missing thread_guideline to the deleted_message_item. Render the thread footer, and bind it to the click listeners

🎨 UI Changes

SDK Before After
Compose
compose_before.mp4
compose_after.mp4
XML
xml_before.mp4
xml_after.mp4

🧪 Testing

  1. Open a channel
  2. Create a thread
  3. Delete the parent message
  4. The thread should still be accessible when clicking the thread root

Summary by CodeRabbit

  • Bug Fixes

    • Fixed inability to open threads when the root message was deleted. Users can now access and interact with threads regardless of the root message's deletion status.
  • Tests

    • Activated tests to verify thread functionality with deleted parent messages.

✏️ Tip: You can customize this high-level summary in your review settings.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 17, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.25 MB 0.00 MB 🟢
stream-chat-android-offline 5.48 MB 5.48 MB 0.00 MB 🟢
stream-chat-android-ui-components 10.60 MB 10.60 MB 0.00 MB 🟢
stream-chat-android-compose 12.81 MB 12.81 MB 0.00 MB 🟢

@coderabbitai
Copy link

coderabbitai bot commented Dec 17, 2025

Walkthrough

This pull request enables opening threads when the root message has been deleted. The fix updates message deletion handling across the Android UI framework by wiring click listeners to deleted messages, enhancing the deleted message layout with a thread footnote reference, and enabling previously blocked tests that verify this functionality.

Changes

Cohort / File(s) Summary
Tests
stream-chat-android-compose-sample/src/androidTestE2eDebug/kotlin/io/getstream/chat/android/compose/tests/MessageListTests.kt
Removed @Ignore annotations from two thread-deletion tests, activating test_threadIsNotLocked_afterParentMessageDeletedByUser and test_threadIsNotLocked_afterParentMessageDeletedByParticipant.
Documentation
CHANGELOG.md
Added fixed entries in stream-chat-android-ui-components and stream-chat-android-compose: "Fix unable to open threads whose root message was deleted. [#6046]"
Compose UI
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageItem.kt
Replaced conditional click modifier with a single combinedClickable modifier; onLongClick now enforces both notDeleted and notUploading guards instead of only notUploading.
Android UI Components — ViewHolder
stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/viewholder/impl/MessageDeletedViewHolder.kt
Added optional listeners: MessageListListeners? parameter to constructor; added init block wiring messageContainer click and footnote thread click to listener callbacks.
Android UI Components — Factory
stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/MessageListItemViewHolderFactory.kt
Updated MessageDeletedViewHolder instantiation to pass listeners parameter alongside decorators and style.
Android UI Components — Decorator
stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/adapter/viewholder/decorator/internal/FootnoteDecorator.kt
Changed decorateDeletedMessage to delegate to comprehensive setupFootnote logic instead of setupSimpleFootnote, aligning deleted message footnote handling with other message types.
Android UI Components — Layout
stream-chat-android-ui-components/src/main/res/layout/stream_ui_item_message_deleted.xml
Added threadGuideline Space view (0dp × 0dp) constrained to messageContainer bottom and centered horizontally, providing layout alignment reference for thread footnotes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

  • MessageDeletedViewHolder.kt — Verify listener wiring logic and null-safety handling of the optional listeners parameter
  • FootnoteDecorator.kt — Confirm that delegating from setupSimpleFootnote to setupFootnote maintains visual consistency and does not introduce unintended side effects
  • MessageItem.kt — Ensure the combined click modifier refactor and addition of notDeleted guard in onLongClick does not break existing non-deleted message interactions
  • Layout XML — Verify that the new threadGuideline Space view integrates correctly with existing constraints and does not cause layout inflation issues

Poem

🐰 A thread was lost when messages went away,
But now through deleted posts we find our way!
Click-listeners dance where silence reigned,
Guidelines guide us—threads unchained! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: enabling thread access for deleted messages, which is the primary objective of the PR.
Description check ✅ Passed The PR description covers all critical sections: goal, implementation details, UI changes with videos, and testing steps. All required checklist items are documented.
✨ 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 bug/fix_unable_to_open_threads_for_deleted_messages

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.

@sonarqubecloud
Copy link

@VelikovPetar VelikovPetar marked this pull request as ready for review December 17, 2025 14:35
@VelikovPetar VelikovPetar requested a review from a team as a code owner December 17, 2025 14:35
@VelikovPetar VelikovPetar merged commit 59ae0b6 into develop Dec 17, 2025
14 checks passed
@VelikovPetar VelikovPetar deleted the bug/fix_unable_to_open_threads_for_deleted_messages branch December 17, 2025 14:59
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.

4 participants