Commit Graph

62 Commits

Author SHA1 Message Date
Kartik Maji f8bb7503e6 Add ability to pin streams to top of the streams sidebar list.
Based on work by Lauren Long, with some tweaks by tabbott.
2016-06-30 22:26:09 -07:00
Michael Cordover a51ec44005 Search streams from left sidebar (resolves #565).
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.
2016-06-23 17:21:57 -07:00
Tim Abbott 584887e588 lint: Require folding of } on same line in else if statements. 2016-06-09 14:05:34 -07:00
Tim Abbott c35781d505 lint: Require folding of } on same line as else statements. 2016-06-09 14:02:49 -07:00
Vishnu Ks d30ea0bc44 Move recent_subjects to stream_data. 2016-06-07 17:50:16 -07:00
Kara McNair fd66d9f703 Show 5 most recent "Private messages" when clicked.
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.]
2015-12-15 07:52:54 -08:00
Tim Abbott 29fa601328 Rename active-subject-filter to active-sub-filter.
This makes the name more generic so we can reuse it for private
message filters as well.
2015-12-15 07:52:54 -08:00
Tim Abbott 87acb2be09 stream_list: Factor out reset_to_unnarrowed helper. 2015-12-15 07:52:54 -08:00
Tim Abbott c404f3189c stream_list: move remove_expanded_subjects earlier in file. 2015-12-15 07:52:54 -08:00
Tim Abbott 7bb11fe09a topic zoom: Clean up unnecessary jquery selectors. 2015-12-15 07:52:54 -08:00
Allen Rabinovich 7822be5cd9 Fix failing stream sidebar node test
(imported from commit 3187a8f34389bf1f0b37e80edec9fb56f7281306)
2014-02-18 12:50:32 -07:00
Steve Howell 10b24f77b6 Fix misc. uses of search tuples.
(imported from commit c7dc47c1396eb0d9f6821cafcb3dc90d283b4764)
2014-02-10 15:11:43 -05:00
Steve Howell bb0608b55a Use real stream ids in our stream-related UI widgets.
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)
2014-02-10 13:23:27 -05:00
Tim Abbott 004fd0eab8 Move unread-related functions from zulip.js to unread.js.
(imported from commit efc0dd84c2cd30b0203b906af6991475d8a63985)
2014-01-31 14:59:03 -05:00
Steve Howell bca0311b53 Created stream_list.redraw_stream_privacy().
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)
2014-01-17 16:38:06 -05:00
Steve Howell 137a1b7799 Rename stream_list.build_narrow_filter() to build_stream_sidebar_row.
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)
2014-01-17 16:37:46 -05:00
Steve Howell 84ea28ae25 Remove type parameter from build_narrow_filter().
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)
2014-01-17 16:37:46 -05:00
Steve Howell c7bf349e70 Deprecate stream_list.add_narrow_filter().
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)
2014-01-17 16:37:45 -05:00
Steve Howell 56dc4e0b8e Add test_add_stream_to_sidebar().
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)
2014-01-17 16:37:43 -05:00
Steve Howell fb0c78b946 Remove transitional topic_zooming flag.
(imported from commit 62722f49a2f9db262c63c56826b8446333c86389)
2014-01-02 08:31:36 -05:00
Steve Howell c53845a69c Add unit tests for stream_list.
(imported from commit 1d04a2e6115f29b7949466260ec2ba3126b882e6)
2013-11-27 15:09:20 -05:00
Steve Howell eb9f7a04b7 Rewrite topic zoom to fix bugs and make cleaner.
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)
2013-11-26 18:19:49 -05:00
Steve Howell 90bb398784 Revert "[staging] Double-clicking on stream row toggles its zoom level."
This reverts commit 6fdb3cacd68635f313f2a8a81edf2d6101cce2cb.

(imported from commit 6e95bd8caa1b7e327f91a8b7aded72b787d1420a)
2013-11-26 18:19:48 -05:00
Steve Howell c710a54a99 Avoid flicker when narrowing to non-stream view.
(imported from commit a69fd4fe582d56e89990f97a3d3099ea1225315c)
2013-11-26 11:09:38 -05:00
Steve Howell b3e0c93ca6 Zoom out topics when going to Home view.
(imported from commit 04c5ae70d28bd3b41f2311d22f80f95c458f06a2)
2013-11-26 11:09:37 -05:00
Steve Howell 78e936fc36 [staging] Add "Show more topics..." link to topic lists.
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)
2013-11-26 10:34:09 -05:00
Steve Howell 41eded47d2 Add link to show all streams when you are zoomed in.
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)
2013-11-26 10:34:09 -05:00
Steve Howell fd9d48f6df [staging] Double-clicking on stream row toggles its zoom level.
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)
2013-11-26 10:34:09 -05:00
Steve Howell 44f575c812 Add topic-zooming hooks.
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)
2013-11-26 10:34:08 -05:00
Steve Howell 1080b4239d Move sidebar click handlers into stream_list.js.
(imported from commit b284508b3abd2edc3fa4edf432307eee8f034b58)
2013-11-26 10:34:08 -05:00
Steve Howell 688cc4963c Rename sort_narrow_list() to build_stream_list().
(imported from commit 533dbe4171b859077c496f656f8c2476107b318c)
2013-11-22 14:52:04 -05:00
Steve Howell 9a68022516 Extract build_subject_list().
(imported from commit 7ce2ec353c465e05e3e4dea3ce9be1651db2d86c)
2013-11-22 14:52:03 -05:00
Steve Howell 52ec258122 [staging only] Show Recent Group PMs in right sidebar.
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)
2013-11-07 16:54:13 -05:00
Steve Howell ac7eace8fb Remove subs.reload_subscriptions().
(imported from commit 72d831101033fb7db4b024781bf597f63345be79)
2013-10-22 15:51:19 -04:00
Steve Howell f34b2e4f75 Don't repopulate subscriptions on a stream rename.
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)
2013-10-22 15:51:19 -04:00
Steve Howell 36690ee6f6 Remove transitional feature_flags.muting flag.
(imported from commit 98a6cc4f340489b7817084e5ca5dcbcb75021813)
2013-10-15 09:57:19 -04:00
Steve Howell d437f6602f Add muted_topic style to the topics stylebar.
If you mute a topic, it will show with opacity 0.25.

(imported from commit 72517550cc9f1daa779b3aac6cacd39831d5aa20)
2013-09-30 16:52:19 -04:00
Steve Howell d94d2d71c5 Always show narrowed topic in the topic sidebar.
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)
2013-09-30 16:52:19 -04:00
Steve Howell fcb6a9b572 Use "topic_name" var/field in rebuild_recent_subjects().
This is part of nibbling away at deprecating "subject."

(imported from commit fbd26b5f1386a174de76e04298a68b3a7b18606e)
2013-09-30 16:52:18 -04:00
Steve Howell 10145c0e83 Simplified setting active topic.
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)
2013-09-30 16:52:18 -04:00
Steve Howell 6b8013c631 Don't mutate global recent_subjects when creating subject sidebar.
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)
2013-09-30 16:52:18 -04:00
Steve Howell fd81e04e16 Remove topic popovers when redrawing topics
(imported from commit 5350e5026dcfc9542c44b576ee967423adaf2c91)
2013-09-18 12:25:19 -04:00
Steve Howell 8429105c24 Add chevron menu for topics in left sidebar.
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)
2013-09-17 18:53:27 -04:00
Allen Rabinovich a6dc890686 Standardize unread counts for user list
(imported from commit 2b82fbb6cbf89b8590a3319ce5e30dadf18cc87b)
2013-09-06 09:05:40 -07:00
acrefoot 0cb72c6259 Unread counts on the toggle buttons when in skinny mode
(imported from commit 99102d1bf752c077ee4c23bf1aa0b095a9f739d7)
2013-09-04 12:35:48 -04:00
Waseem Daher dd6ddc0e1e Revert "Prevent unread counts from overflowing."
This reverts commit 728a5415c8aa2ee18405c77746a0ea9543a20d98.

(imported from commit 7d91b564549e4e444fe656c2d8b811e2fcbff2d3)
2013-08-28 18:02:09 -04:00
Allen Rabinovich 98f7870150 Prevent unread counts from overflowing.
(imported from commit 728a5415c8aa2ee18405c77746a0ea9543a20d98)
2013-08-28 13:54:47 -07:00
Allen Rabinovich f6ec501505 Modify lock icon styles to display it in the stream list swatch or to the right of the stream name in the list
(imported from commit b70ed2520b38229ccaed62ed84786cb9152e50a9)
2013-08-27 12:20:08 -07:00
Allen Rabinovich 7f807f7c8d Make unread counts appear as lozenges to the right of stream/subject names
In particular:
   * Pull the count containers out of the containers that cut off overflow text
   * Make them lozenge-like
   * Add logic for shortening the overflow container when a count container is
     present

(imported from commit a2b3d237cbfe4fadfbbc3a931d2de85dfba10d04)
2013-08-27 09:15:16 -07:00
Steve Howell e4699d6a25 Use new stream_list.set_presence_list_count().
The old API took a dictionary; the new function works for one
person at a time, which allowed us to clean up the calling code
in ui.set_presence_list.

(imported from commit 0ae9d01491238d32915572c7efebf476d05fed4b)
2013-08-22 15:32:30 -04:00