question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for pinning topics within a stream

See original GitHub issue

A popular feature of alternative chat products is being able to pin messages within a stream. We closed the original issue for this feature when we started displaying stream descriptions at the top of stream narrows. However, that implementation doesn’t cover all use cases for pinning messages, and in any case doesn’t presently let you display a large amount of content (though we do plan to change that). We should consider adding this a high priority given how many people were excited about #5200; we get additional requests about this from time to time.

Our current thinking is that the right model for this in Zulip is to allow pinning one or more topics within a stream, and then users can move messages into the pinned topic as needed. Here’s an implementation/design plan, in a reasonable commit merging order:

  • We create a new StreamTopic database table with columns (realm: Realm, stream_id: ForeignKey, topic_name: str, pinned: boolean=False). We will for now only be creating rows in this table when a topic is pinned, so pinned will always be True in real rows at first, but that will change as we add additional features associated with topics.
  • We add API code for sending StreamTopic data to clients in /register for the streams the user is subscribed to. We will want an “api design” thread for how this should work. It is probably a good idea to also implement stream_topic events to send to clients when a topic is pinned/unpinned for data synchronization; this will also allow the mobile and terminal apps to start an implementation.
  • We tweak populate_db to include pinned topics in what it generates. (Possibly just a random topic should be pinned in each of the 3 alphabetically first streams). This can happen at any time; it’s main purpose is to support testing the feature before we add API code (which we generally don’t want to do until we are happy with the UX if one were to create one).
  • We add UI code to sort pinned topics to the top. I expect this to involve modifying topic_list_data.js and in particular get_list_info to to show pinned topics at the top of the left sidebar. I believe the following is likely to be the correct implementation:
@@ -62,6 +62,10 @@ export function get_list_info(stream_id, zoomed) {
                     return false;
                 }
 
+                if (is_topic_pinned) {
+                    return true;
+                }
+
                 // We include the most recent max_topics topics,
                 // even if there are no unread messages.
                 if (idx < max_topics) {
  • Add display code to render the topic in the left sidebar with an fa-pin icon in the gutter where “resolved topic” checkboxes appear. A topic that is both resolved and pinned should show the pin in the gutter and the checkmark in the topic name.
  • We add a new organization permission pinned_topics_policy that controls who can pin topics within the organization by default. (Later we’ll do something per-stream, but that’s out of scope for this issue). This setting should support all the normal policy types (including nobody/everyone) and have “Moderators” as the default value. We can merge this commit early by having the settings UI element hidden behind a page_params.development_environment guard; so it can really happen at any time before the next bullet.
  • We add a new PATCH streams/<int:stream_id>/topics/{topic_name} API endpoint for changing the settings for a topic. At present, it should just let you pass pinned=true|false.
  • We add a new menu item to the left sidebar \vdots menu for a topic with “Pin topic”, in the administrative actions section that sends requests to that endpoint.
  • We add Help Center documentation for the feature.
  • We add the feature to marketing pages where we might want to advertise its existence.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:23
  • Comments:21 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
joannetsaiicommented, Dec 14, 2022

Our team is still working on it. We’re currently testing the changes and fixing some bugs in the backend.

4reactions
v3ss0ncommented, Jun 2, 2022

Looking forward to it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pin a stream | Zulip help center
Hover over a stream in the left sidebar. Click on the ellipsis (). Click Pin stream to top. ; Hover over a stream...
Read more >
can you pin an announcement to the top of the stream?
I would like to pin an announcement to the top of the stream wall so it remains at the top throughout the year....
Read more >
How to pin a comment in Facebook Live chat
You can pin comments to the top of the chat during your Facebook Live video ... Find the Preset pinned comment card in...
Read more >
Pinned Chat [Experiment] - Twitch
Pinned Chat is a tool for streamers and their moderators to amplify high value chat messages for a set duration in chat.
Read more >
Pin to Top and Add Engaging Call-to-Action Elements to Any ...
Essentially, the latest update of Boosts cloud service for the Flow-Flow Social Stream plugin is dedicated to promo tools. In other words, you ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found