0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-09 21:45:25 +08:00
discourse/plugins/chat/spec/system/drawer
Régis Hanol 24bf2c4e72
UX: Hide "My Threads" when user has no threads (#36931)
Previously, "My Threads" would appear in the sidebar and drawer whenever
a user was a member of a channel with threading enabled, even if they
had no actual threads to view. This led to a confusing experience where
clicking "My Threads" would show an empty list.

The root cause was a mismatch between the visibility check (which only
looked at channel membership) and the data fetch (which applied stricter
filters like replies_count > 0, non-deleted messages, etc.).

This introduces a shared `viewable_by_user` scope on the Thread model
that both checks use, ensuring "My Threads" only appears when there are
actually threads to display. The scope requires:
- User has a non-muted thread membership
- User is following the channel
- Channel has threading enabled and is open
- Thread has at least one reply
- Original and last messages are not deleted

To maintain a responsive UX, a MessageBus notification is sent when a
user gets their first viewable thread, so "My Threads" appears in
real-time without requiring a page reload.

Ref - t/129094
2026-01-21 10:56:24 +01:00
..
browse_spec.rb DEV: add shortcut fab!(:variable, :fabricator) to specs (#33577) 2025-07-11 11:16:34 -03:00
direct_messages_spec.rb UX: moves chat search to its own tab (#36787) 2025-12-19 15:18:34 +01:00
index_spec.rb UX: moves chat search to its own tab (#36787) 2025-12-19 15:18:34 +01:00
starred_channels_spec.rb UX: Update sort order for starred channels on drawer/mobile (#36921) 2025-12-30 13:27:16 -08:00
threads_spec.rb UX: Hide "My Threads" when user has no threads (#36931) 2026-01-21 10:56:24 +01:00