Commit Graph

145 Commits

Author SHA1 Message Date
Tim Abbott 82da2bec10 Add trailing bookend with current subscribed status in some narrows.
This is basically just the logical extension of the previous commit
for the case where the last thing we did was subscribe or unsubscribe.

This even magically updates when you subscribe or unsubscribe from
another window :).

(imported from commit 2399329d11bf66aa0b614a21d2b3cf4035452279)
2013-04-12 15:43:41 -04:00
Tim Abbott 738ed84b5d Call load_old_messages on all narrows, empty or not.
This is required to get historical messages that might be within the
message ID range of your home view.

I think we could avoid calling load_old_messages on every narrow by
tracking when the user last subscribed to each stream, and if the user
subscribed before the first message in the current home view message
window (aka the messages used for the fast-path narrowing), don't call
load_old_messages.  This would happen almost every time.  But it would
require a schema change to do this.

We also remove the load_more_messages call from hashchange.initialize.
It is no longer required now that we're calling load_old_messages on
each narrow anyway.

(imported from commit 1c78c183e61392429592ae89d566315be7be8999)
2013-04-12 15:43:41 -04:00
Tim Abbott c56b0074e4 Fix visiting the app via a narrowed URL.
(imported from commit 1946f2b8f3ffba0729e4ad975aeac1887a0ed437)
2013-04-12 15:43:41 -04:00
Tim Abbott ca4baa01e0 load_old_messages: Clean up for_narrow parameter.
(imported from commit 1be9959ec3998371f24f9d11a9aa87e59d85aabf)
2013-04-12 15:43:41 -04:00
Leo Franchi 9130f6722f Show latest 5 subjects in sidebar when narrowed to a stream
This is a V1 of this feature. For now, the only way to expand is by narrowing
to the stream---future revisions may add a manual toggle if it is found to be
useful.

Additionally, showing per-subject unread counts will be coming in a future revision
as well.

(imported from commit fb5df0d27e928fa3b0f32b9ff2c1c508202cf7e5)
2013-04-12 11:51:09 -04:00
Zev Benjamin 9d1548fe08 Add empty feed notices for private messages
(imported from commit e4067336f6b2e9e82b794599d30dfc3825852652)
2013-04-04 11:36:51 -04:00
Zev Benjamin 0e4aa6727b Convert to string before using string methods on search operators
Previously, narrowing to a stream name that only contained digits
would throw an exception.

(imported from commit dc76877427078d70e3d5625622c665be3302c976)
2013-04-04 11:34:05 -04:00
Jessica McKellar 33a9bae5d1 Tailor empty narrow messages to what you were narrowing for.
(imported from commit 876afce2a63d4d6a522ac5300349b2be8805405f)
2013-04-01 14:26:50 -04:00
Keegan McAllister b7bb598e02 Trim search operand from the end until URI decoding succeeds
Fixes #1137.

(imported from commit a23219d2cefdc2b739a165c88780fba409d4d878)
2013-03-29 10:37:02 -04:00
Jessica McKellar 07967e7257 Add the ability to narrow to starred messages with `is:starred`.
(imported from commit f1eb552ddd90a1822fa988b60dc13f88f04cfc79)
2013-03-28 16:59:59 -04:00
Keegan McAllister 38ebefe68f Remove unused variables
(imported from commit c18d43165c1dbdee28107ef21e26e474b819c653)
2013-03-26 13:50:03 -04:00
Keegan McAllister e97c6f52ce Don't save narrow operators to the URL fragment if that's where they came from
In Firefox, prevents e.g. a slash in a stream name, which we wanted to store as
%2F, from converting back to a literal slash.

There is some appeal to normalizing the URL fragment after parsing, but in
general this way seems better.  It may decrease page load time on narrowed
views.

Doesn't yet fix #826; the URL is correct but the narrow is still wrong.

(imported from commit 32e3fa9e968139863f34b9698f1c8b39d06f0c14)
2013-03-20 12:07:53 -04:00
Keegan McAllister ae27deb30f Encode search operands using a cleaner-looking variant of URI encoding
Fixes #1098.

(imported from commit 1ed05248f3c6b69a48b9c74c0ce344621fe637b5)
2013-03-20 12:07:52 -04:00
Tim Abbott a46eb8a36c Clean up excessive positional arguments to load_old_messages.
(imported from commit 072c0fcbd59256d55364a0fc6be42d5df8ab99e2)
2013-03-15 16:30:03 -04:00
Leo Franchi 7510f87eac Select first unread when narrowing by clicking on stream in sidebar
(imported from commit 557751f44e3fee61b6a55f8f8328e2f97e6adc04)
2013-03-14 15:01:13 -04:00
Leo Franchi ff42774551 Refactor unread client handling to use 'read' flags per message
(imported from commit ca48745396e7fbac456e5eb2e7dbe4adc62b3492)
2013-03-13 14:14:45 -04:00
Waseem Daher 52b3da6668 Make clicking gravatar or "Humbug" take you home.
Looks like this was broken in 546063f88d58fb988363e5c89a13507deeb20afd.

(imported from commit 077186e60bf7a48742e71bbcb4e705c02f1ddc0a)
2013-03-13 11:16:09 -04:00
Tim Abbott 6c6a005920 Update recipient on renarrow when compose box is open but empty.
(imported from commit ff50b3b38833e7467ca77714acb1d81c22aeed0c)
2013-03-13 11:12:25 -04:00
Tim Abbott 10be8d2a12 compose: Fix loss of message fading on renarrow.
Previously, if you renarrowed, all message fading would be cleared
until you close and then reopen the compose box.

Fixes #1024.

(imported from commit 57981ba29ab597c4c84ca6e4e9d04a8284f49117)
2013-03-13 11:10:51 -04:00
Zev Benjamin c50abd1c76 Fix jQuery selector exception from single quotes in stream names
Fixes #1065

(imported from commit 67f74e41f16c01d0d307bd8edf48dd70dde4edf4)
2013-03-11 12:38:15 -04:00
Tim Abbott b1d1863604 Fix narrowing to pm-with lists not in alphabetical order.
Previously if you narrowed to
"pm-with:wdaher@humbughq.com,jbarnold@humbughq.com", you'd always get
no results because our filter was comparing your query against
message.reply_to, which is sorted in alphabetical order.

(imported from commit 40dc78640f3b010f11312176cfcf3c331fdf3337)
2013-03-05 15:06:31 -05:00
Tim Abbott 1d37238a89 Prettify display of narrowing in our search box.
(imported from commit ccb7f4798a949751a396845baf399591b5d83fb3)
2013-03-05 15:06:31 -05:00
Zev Benjamin 134fc469ad Re-disable collapsing when narrowed by a search term
This seems to have been broken for a while.

(imported from commit a0bcbffaec53b30e9099befc59e7171d2b96aa68)
2013-03-05 12:48:32 -05:00
Zev Benjamin 5daf327f9d Add a function for narrowing by time travel
(imported from commit 1f8871309a34b0bfef79b671d308d6219f4377b4)
2013-03-05 12:48:32 -05:00
Zev Benjamin bc8bc8567b Make the decision of whether to collapse messages on a per-MessageList basis
This also renames the option to 'collapse_messages'.

(imported from commit 95307ee72b761b72e43d9c7a66f5ba76f7134d9e)
2013-03-05 12:48:32 -05:00
Zev Benjamin d05ac105fe Move clear_table into MessageList
(imported from commit 138c3103920413580f86fede115843ecfddc0691)
2013-03-05 12:48:32 -05:00
Tim Abbott a92f2a5229 Rename 'Narrow to messages containing' to 'Search for'.
(imported from commit 147164bb96bb4fdb451454956ac56f5d3b2424b6)
2013-03-05 09:32:59 -05:00
Tim Abbott ee3662d1da Move 'Narrow to' to text inside narrow.describe().
(imported from commit a5ccce0034f4c70b71958b26b60521b779837377)
2013-03-05 09:32:59 -05:00
Tim Abbott d5a185dca8 Add highlighting of search terms in "messages containing" narrows.
(imported from commit 47fca2f20650c32e976ab01e213463d4fb4ed655)
2013-03-04 17:57:20 -05:00
Luke Faraone d88107567a Remove "find in page" functionality.
This was a source of user confusion and didn't provide that much value.

(imported from commit fbe9405d8bc4cb6661baa7fe7583eab5ed73d886)
2013-03-04 10:59:41 -05:00
Leo Franchi 7374fe53f1 Only show the "More messages below" if unread messages are in the home view
(imported from commit 6b1ded10519305bca935b093a74b59d7ab814c55)
2013-03-01 14:35:39 -05:00
Keegan McAllister ac1c111489 Fill in default recipient when composing while narrowed
Fixes #977.

(imported from commit 1abe26d94d5179a3dd1e970224a36c63bba9ff48)
2013-03-01 14:10:51 -05:00
Tim Abbott cad295b9d9 narrow: Fix incorrect default then_select_id.
Previously we defaulted to current_msg_list.selected_id, which was
fine if you were narrowing from the home view, but if you navigated to
a narrow with no messages in it and then clicked something in the left
panel or used the search bar, it wouldn't work.

Fixes trac: #870.

(imported from commit 5ee480d8d2b1fb300fccbe75e04135d977a1fc07)
2013-02-28 17:49:57 -05:00
Tim Abbott 49af19aa71 Add support for narrowing by a message's sender.
Fixes #972.

(imported from commit 2514d14c94a071f2b3e6149a2bdaeaa00e0c847f)
2013-02-28 17:49:57 -05:00
Jessica McKellar e3e5a0656d Wait until after reset_load_more_status to select a message upon narrow.
This is the fix for https://trac.humbughq.com/ticket/958 (Narrowing
moves the pointer) proposed by jhurwitz. Currently on master,
narrowing can cause you to end up wildly out of place.

This branch is not a perfect fix -- you do end up with the pointer on
the expected message after the narrow, but that message is centered on
the screen; better would be for that message to not move at all.

(imported from commit b89e4e2c896add20eceb609db46c46dc025fdce2)
2013-02-28 11:31:58 -05:00
Jessica McKellar 4e193377dd Fade out messages surrounding a reply message, to make mixing harder.
(imported from commit da150ad2f0877d058e1a60deb7a7632e52bd3533)
2013-02-27 15:02:47 -05:00
Waseem Daher 801723b45c Recenter your message in view after you unnarrow.
In Safari only, if you narrow to something and scroll all the way back
up to the top and then unnarrow, your position actually remains all
the way at the top!

We explicitly call a "scroll_to_selected" as the final step of
deactivating a narrow, which brings this message into view.

This doesn't seem to be an issue on Chrome and Firefox, but I'm not
quite sure why; something about the sequence of events.

(imported from commit fc73640351be03c02eb2f3c8a23de3327723f002)
2013-02-27 09:14:54 -05:00
Leo Franchi 19d107e42b Add a home_msg_list that contains all messages shown in the home view
By splitting up all_msg_list and home_msg_list, we can properly add/remove
streams from the home view without having to jump through hoops.

(imported from commit 92767197759f7519197dfc58be951b60fa823fbb)
2013-02-26 14:13:35 -05:00
Jessica McKellar 11a01dac6c When a narrow would have no messages and just be grey, show a notice instead.
(imported from commit 2b2b653805cb1ebdb545f83b20c01f1d6cbde9b7)
2013-02-23 14:38:25 -05:00
Zev Benjamin 06d69f10d9 Remove superfluous call to MessageList.closest_id
(imported from commit 11d4f096517df4b9ed89f184a1d383c8a55697bc)
2013-02-22 11:46:05 -05:00
Leo Franchi ca0f414b60 Fix narrowing not marking as unread when backfilling messages
(imported from commit 91b164251b0c2f97bf70c0051216347e2a4616eb)
2013-02-22 11:41:35 -05:00
Leo Franchi 9fb5487473 Add a select_closest option to MessageList.select_id()
If we have removed a stream from the home view, and our pointer
that we load from the server refers to a message that is no longer
visible, we don't want to error out but rather select the nearest
message to our previously selected one.

(imported from commit d212f1fba7b06836d1d916b43042991625b6f41e)
2013-02-22 11:39:22 -05:00
Zev Benjamin 48e7fed00f Fix the selected message when narrowing to a stream that has no messages loaded
We would previously scroll you to the top of the just-loaded block of
messages

(imported from commit 520e5588aa078313649677663c7feea4ca1d7145)
2013-02-21 13:29:17 -05:00
Zev Benjamin ed51bd0432 Select messages on the MessageList instead of calling a global function
(imported from commit 0ea1c2695cda5ec415c42a450103e768cf2ff5db)
2013-02-21 13:29:17 -05:00
Zev Benjamin 9e9b4c8541 Make MessageList.selected_id an accessor method
(imported from commit 144d12ba8be2de02900ef06c3413f660144de8bf)
2013-02-21 13:29:17 -05:00
Zev Benjamin 36798c8d67 Select the closest message to the target after narrowing
(imported from commit e41fcb032af5a8653b7573cb87bbc879a2008343)
2013-02-21 13:29:17 -05:00
Zev Benjamin e9b915c2b9 Remove global selected_message_id and persistent_message_id variables
Each message list now has a selected message id.

(imported from commit 041abc54ea42c636c30e39df4a2e838bb830e1aa)
2013-02-21 13:29:17 -05:00
Zev Benjamin 97160d79d4 Use the new MessageList for storing messages
(imported from commit 38a04d2ff504aa49189997b972318af7c944d528)
2013-02-21 13:28:23 -05:00
Leo Franchi 36d953e2af Show messages to streams we were just subscribed to
(imported from commit f852be239da1f3385f9fc9861a3ed07a7f47a6da)
2013-02-21 12:10:53 -05:00
Reid Barton 8b8f2707e7 Fix bolding of "Home", "All messages", "All private messages" when active
(imported from commit 759729b4b2c0ebac3e3f1c9f74617a2dbea50223)
2013-02-20 17:50:26 -05:00