This replaces add_stream_to_sidebar(), which was kind of a misleading
name, and it also adds a couple lines of code that were always
called right after calling add_stream_to_sidebar().
Assigns hotkey 'w' to search streams.
Only show search box when active. Activate with hotkey or by clicking
STREAMS.
Filter matches at the beginning of words in stream name.
Behaviour is otherwise almost identical to user search.
Casper tests.
Like the Stream Subject lists, Private messages are now shown
when the user clicks on the "Private message" link. User can drill in
to get more than 5 conversations. Selecting PMs from the user or group
PM lists on the right sidebar also opens the list & highlights the
selected conversation.
[Edited by tabbott@mit.edu to fix some small bugs.]
Before this change, we were using sequentially generated ids
on the client side to identify streams. Now we just use
the ids from the server. The goal here is to reduce the
confusion of having two different ids attached to a stream.
Also, not that it matters a ton, but this also means that
the browser basically has an immutable id for each stream
that is future-proof to reloads, multiple create_sub calls, etc.
It also a bit easier to grep for ".stream_id" than ".id".
(imported from commit 057f9e50dfee127edfe3facd52da93108241666a)
This function can redraws the lock icon (or lack of lock icon)
for a stream in the stream sidebar. It can be called when
admins change the stream privacy.
(imported from commit 880133d02525137094c48ecad8cf2dfff59f3307)
The new name is more descriptive of what the function does, and it
also has the side benefit of cleaning up greps for the backend
function called build_narrow_filter().
(imported from commit 4b88fa863d7c1751946c78977f2ffaf19dd3ae5e)
The type parameter was always passed in as "stream", and we
only render the stream_sidebar_row template, so let's not
pretend like we support arbitrary message types here.
(imported from commit 8a852a68ddda336024793f6fdafa648883bb815e)
We now call add_stream_to_sidebar() instead. The old function was
only ever called for streams, so the newly named function is more
descriptive of what it does.
(imported from commit 7ae373279ea9987d3637cdbdc427680ac989fe86)
This is a node test that verifies that
stream_list.add_stream_to_sidebar() creates the right
DOM when it renders the stream_sidebar_row template.
The test also makes sure that the DOM gets put in the
correct place to be retrieved by stream_list.get_stream_li()
calls.
(imported from commit ed4c0148da2261870e3db5a9b553913788b4eccd)
In the first cut at topic zoom, I was re-rendering the
streams list, but this created glitches with orphaned
list items. The reproducible bug was that unread counts
on unshown streams weren't updating.
In the new approach, I keep the elements more permanent, and
I just hide and show them as needed, either through jQuery
show/hide or permanent CSS selectors.
I got rid of toggle_zoom(), so that we just explicitly zoom
in and zoom out in all situations. In particular, when we
narrow, it's more clear now that only stay zoomed in when
we're narrowing to the same stream as before (including topic
narrows within that stream).
When you zoom in, the number of topics is no longer limited
to 30, since that was kind of arbitrary anyway. (In practice,
the number of topics is usually well under 30, anyway, due to
the way we track them on the client.)
(imported from commit 5b6c143dee9ba9fe557d8cc36335ff28efb4b0de)
This link lets you zoom in to more topics. We only show it if
there are topics that we had to hide to respect the max-5 limit
along with other rules of when you show topics.
This is feature flagged to staging only.
(imported from commit 9915004ec2eb3df7416fe45c0e60cebcd7fecfea)
When your left sidebar is zoomed to show just one stream,
there is a link to to show all streams again.
(imported from commit 92f39b042168c443cbb9f524bf892557ef492551)
If you double-click on a stream that you've narrowed to, it
will either zoom in or zoom out the left sidebar view. Zooming
in shows just that stream; zooming out shows all streams.
This is feature flagged to staging only.
(imported from commit 6fdb3cacd68635f313f2a8a81edf2d6101cce2cb)
This commit doesn't actually add the final UI to zoom/unzoom
topics, because I want to keep those in separate commits, in
case we change how to enable the feature. But this commit
adds a toggle_zoom() function that zooms/unzooms topics.
Zooming is minimally invasive, because we don't really introduce
many extra elements to the UI; instead, we just make the list of
streams be a list of length one (i.e. the active stream). This
gives us a lot of stuff for free, basically, like unread counts, etc.
(imported from commit 814c1361b6210d1591b4174bed1d6e0c98a3f255)
Show up to 10 of your recent group PM conversations in the right
sidebar. Clicking on the links narrows to the huddle and opens the
compose box for the huddle. The green circles have opacity
proportional to the number of users present in the huddle.
This is feature flagged to staging only.
Some of this code was written by Allen before commits were squashed.
Known issue: unread counts disappear on certain refresh events.
(imported from commit 3b44665150ba20594d8b0295cb30df03601c1d52)
We want to deprecate reload_subscriptions(), which was kind
of a big hammer to use when only a single stream is being
renamed. Now we call stream_list.rename_stream() to update
the sidebar.
(imported from commit a77d09c0433d9b605b7baa7d7c61183bc8c37ba9)
Before this change, you could narrow to an old topic, and it would
not show up in the sidebar unless it had unread messages.
(imported from commit f177a7378dac064e46a6417357cc86ada4475936)
The old code was looping through recent_subjects to find the
original subject name, but we already have logic in get_subject_filter_li()
to be case-insensitive. I tried this with various casings of topics,
narrowing to topics, as well as narrowing to a stream (so no active topic)
and narrowing to an old topic.
(imported from commit 1decde13477cb742fd4bc82798f1afb282182bdf)
Create our own objects for handlebars, so that we can add transient
flags like is_zero without worrying about side effects to other
code.
(imported from commit b351a369cb3f36233e108e270c7abdd4ab8c5860)
The first menu option supported is to narrow to the topic.
The chevron only shows up if you turn on feature_flags.muting.
(imported from commit 17482f538a6d3e4ff96a36c042bad972d34f4b11)