fix(client): auto-close thread sidebar when parent message is unavail…#40238
fix(client): auto-close thread sidebar when parent message is unavail…#40238opaksbyron wants to merge 3 commits into
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
🦋 Changeset detectedLatest commit: d9f2f1d The changes in this PR will be included in the next version bump. This PR includes changesets to release 41 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughA Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
Proposed changes
Closes #40036
Bug
When clicking on a "Message removed" placeholder (or the thread indicator of a deleted parent message), the Threads sidebar opens and becomes stuck — the X button fails to close it, and clicking other thread indicators does not update the content. Only fixable by reloading the page.
Root cause
Thread.tsxonly handlesisLoadingandisSuccessstates fromuseThreadMainMessageQuery. When the query returnsisError: true(hard-deleted parent) or successfully fetches at: 'rm'placeholder (soft-deleted withMessage_KeepHistory: true), the component renders with no content and no way to close itself.Fix
Added a
useEffectthat detects when the main message is unavailable (either query error, or fetched data is a removed placeholder) and automatically callscloseTab(). Completes the fix attempted in #40042 which only importeduseEffectbut never actually used it.Issue(s)
How to test
Message_KeepHistory: trueandfalse)Summary by CodeRabbit
Bug Fixes
Chores