Commit Graph

504 Commits

Author SHA1 Message Date
Jessica McKellar cf72ca441f Add the feedback bot to the people autocomplete list.
(imported from commit d32724ca647da5053677dbb7bc720465823d79f1)
2013-02-23 14:38:21 -05:00
Jessica McKellar c1d4bc58e8 Un-break get_updates when you have no messages.
(imported from commit 5221682c8dacdb8d57b4f65749a28f39f2875f3d)
2013-02-23 12:33:58 -05:00
Zev Benjamin 296d7d89a3 Disallow replying when there are no messages
(imported from commit b2fb2d9508afcf0470665bd9d42bb50826d838e4)
2013-02-22 13:07:26 -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
Keegan McAllister 56d183ea06 Remove lurk mode from web client and API examples
See #796.

(imported from commit e238ce571c3f30d8312b630df7048ad1d9cad6d2)
2013-02-21 15:11:10 -05:00
Leo Franchi 982a3fda9a Only ignore website messages from user when calculating unread counts
(imported from commit 95bd6f8c2ce0ad1f5d59e311107f81e4b07b33dc)
2013-02-21 15:05:59 -05:00
Zev Benjamin 4c9e3a167e Move message selection to an event-based system
Messages are now selected on a MessageList, which triggers a
message_selected event that other parts of the code can listen for.

(imported from commit 1da9e4121425c0ac4461b41b7aea169072e1512b)
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 a91aa7f8f5 Move message filtering from add_to_table to add_messages_helper
(imported from commit 45b1149771a0d96af4c6267fc8457e49c3d10799)
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
Zev Benjamin b2eb4530d3 Fix comment spelling error
(imported from commit 347a860dfb0de2c49c2810f3aa041bc5c4f427d0)
2013-02-21 13:25:29 -05:00
Keegan McAllister c7b88cc708 Disable backfilling 1,000 messages on idle
Right now the MIT realm has pretty bad UI lag with 1,200 messages loaded.  We
need to fix the root problem, but this commit at least makes reloading the page
a satisfactory remedy.

(imported from commit 93d47710891cfc4db9fa00beaa5ccd10113aa1c3)
2013-02-20 18:50:20 -05:00
Reid Barton 59dab21fcd Render recent dates as weekdays, part 1.
This commit just moves time rendering logic to its own file, and does
not make any functionality changes.

(imported from commit d111d03c6abc8d9550fcf65e4f89eab8056d1ed4)
2013-02-19 15:58:25 -05:00
Leo Franchi 5d79bb6a20 Add a 'show in home view' toggle to the stream settings
(imported from commit af8bcc4df6fcd9f6ffed4ccb1b9be5261ffe619d)
2013-02-19 15:43:27 -05:00
Keegan McAllister bb5f59d310 Use white text for recipient labels on streams set to dark colors
Fixes #577.

(imported from commit 0518e33b96bc0028fc80d533f6b8ec35fd5cdc04)
2013-02-19 15:33:35 -05:00
Reid Barton 37b5a84af4 Track total number of unread messages
(imported from commit 0a6f270b8a4debf0cbb7e869ecbff59f39f22049)
2013-02-19 13:43:34 -05:00
Reid Barton bec83b2bc3 Minor style changes to process_unread_counts
(imported from commit 1cf468e4c2d6237772b3424e4941ee2481dc9bfd)
2013-02-19 13:43:34 -05:00
Luke Faraone 32a406a5cf Display a total count of the number of PMs you have pending.
This is accomplished by continuning to have per-conversation PM counts
but then summing them up into a global count.

We may split this off into per-conversation counts in the future.

(imported from commit 311e3b74715c3a01c0b75837e397a386ab65505c)
2013-02-14 17:32:22 -05:00
Luke Faraone a9e602c1bb Implement label counts for stream messages.
(imported from commit 45d3d5ba8c2be3ebed8385fb714044ac9419f3c2)
2013-02-14 13:44:06 -05:00
Waseem Daher 94ceac9980 Add an initial message to greet you.
(And to let you know that it's OK that you have no messages.)

This fixes Trac #850 for the case where you first log in.

(imported from commit 47741856e34f67bfc2cc91bdc21def75ab6fe09d)
2013-02-12 15:21:28 -05:00
Leo Franchi 6f18f4465d Don't add a person more than once to our people_list
The full name may have changed

(imported from commit 44cf37b3f5e17c28f0a6b0a4c75a5c22470a9516)
2013-02-11 17:58:46 -05:00
Keegan McAllister 16d62fe5de Combine the actions popover with the timeinfo popover
The message timestamp is now always clickable, and the popover contains the
full long-form date and time.  This addresses one problem from usability
testing (see #470).

(imported from commit ad502dff128ad1c934fc0d3faaf5e2931c91c37e)
2013-02-11 13:59:18 -05:00
Keegan McAllister aa644ab757 Remove direct use of x.attr('zid')
See https://wiki.humbughq.com/Code%20style#x.attrzid-vs.rows.idx
for why this is bad.

(imported from commit b341146704af3bb1b477b12d226096ab72b5e269)
2013-02-09 13:52:16 -05:00
Tim Abbott 000b02c068 Clean up code duplication in add_messages.
The interface is a little messy because so many of the inputs change
-- we need to better organize all these variables under centralized
'zfilt' and 'zhome' headings.

(imported from commit b247e86bf63ea2ea2c0d42ef23e8af0ce288d5dd)
2013-02-08 14:43:21 -05:00
Tim Abbott 2d9a21654b Fix messages being added to the home view out of order.
So here's the reproduction recipe:
(1) Find a narrow that doesn't have any messages since 4 days ago

(2) Directly visit that narrow in your browser (or wait for someone to
do a deploy and thus auto-reload)

(3) Wait until load_old_messages has been called at least once

(4) Un-narrow

(5) Scroll up, and notice that the 400 most recent messages are above
sets of older messages.

The cause is that the code in add_messages assumed that
selected_message_id was within the range of message already in the
home view.  This is true in most cases where add_message is being
called, but it is not true in the case that the user was in a narrowed
view containing only very old messages (And thus selected_message_id
would be older than everything in the home view).

We can fix this by tracking persistent_message_id separately and using
that for the relevant test in add_messages.

(imported from commit f0da2561ba68f729343b260adc398029fae6acf7)
2013-02-08 14:43:13 -05:00
Waseem Daher 4da5c83f64 Optionally draw a lock icon by the stream name in the main view.
If it's an invite-only stream.

(imported from commit 02bb80fee6df2cd32ded0c6f2c2b918b8aa8ac05)
2013-02-05 17:24:29 -05:00
Luke Faraone 914aa336c7 Don't send "in" operators to the server, as this is a client-side filter.
(imported from commit 1f3d3c09e24093e038d83985003af0b1c87d4ed8)
2013-02-05 15:34:37 -05:00
Luke Faraone 77d0a07e4f Don't add messages to zhome if the message's Stream has in_home_view=false.
We also introduce support narrowing to "home" and "all".

(imported from commit 53b8dea9c6045a0cde368b3163f6fd6ecde1c649)
2013-02-05 15:34:37 -05:00
Jacob Hurwitz 61acc58947 Add a notifications bar when there are additional messages out of view
(imported from commit 38fa78f63fd520d0b1f09921ba064cba010a6f99)
2013-02-02 01:16:25 -05:00
Zev Benjamin 72ebecf801 Do initial stream color fetch in subs.js instead of zephyr.js
(imported from commit e819e04951be037241b43c8c7061c7979038b7b8)
2013-01-24 17:59:03 -05:00
Jessica McKellar f53e31e118 If a web client is requesting message that are too old, force a reload.
If get_updates requests a message ID that is too old, Tornado will
return a 400, and currently the only way to start caring about newer
message IDs is to reload.

(imported from commit 1638d71868475ffd793162afc7a2731cab14bd75)
2013-01-23 11:33:07 -05:00
Zev Benjamin e6c5b309ce Use consistent terminology for loading indicators and spinners
(imported from commit 54d14c7176e8feb125de253d1bf6205013d53760)
2013-01-16 14:45:23 -05:00
Zev Benjamin 9d27878abf Destroy spinners with a new abstraction instead of hiding them
If you create a spinner in a hidden element and then show the
element, the spinner is placed differently than if you had created
the spinner while the element was visible.  This commit makes it so
that we never create spinners while their parent is hidden.

(imported from commit a21e68976d70fcceece30ee35f5e7cf6f9490497)
2013-01-16 14:45:23 -05:00
Zev Benjamin beea0f747e Rename loading_{indicator,spinner} to page_loading_{indicator,spinner}
(imported from commit e1222569f62ac693d45d2f057ef6b05c883c900e)
2013-01-16 14:45:23 -05:00
Reid Barton 169fb36674 Don't move the pointer when in lurk mode
(imported from commit 6acda4b6d924d605e8ade945e1e4f10ce1e2864e)
2013-01-16 14:19:06 -05:00
Reid Barton 9e23907259 Add "Lurk" mode
/?lurk=foo will show all messages to the stream "foo", regardless of
whether you're subscribed.

(imported from commit 049d98b3ee8df19ef0a9dc392ae941dd463f8dd5)
2013-01-16 14:19:06 -05:00
Zev Benjamin cb8c67b325 Keep a dictionary of user email address to person object
(imported from commit 16d63fefff3bda33cfc2f90398539b5e2d9bb499)
2013-01-15 17:02:39 -05:00
Reid Barton 389a52de6e Fix test for adding to top or bottom of zhome/zfilt
It's possible for selected_message_id to not exist in zhome. For
instance, when you open the page to a narrowed URL, there is a race
between loading the narrowed messages and loading all your
messages. If the narrowed message request completes first, it will
update selected_message_id to your initial_pointer if the latter
happens to be among the narrowed messages. Even if it is not, you can
select a message by clicking on it before the zhome request finishes.

Then the old code would never add that selected_message_id to the
zhome table, so it wouldn't show up in the Home view or if you
re-narrowed.

I'm pretty sure there are still cases where the selected_message_id
might be outside the range of messages in zhome, in which case adding
to zhome might put old messages at the bottom. I observed this twice
on staging but was unable to reproduce it consistently.

(imported from commit 162feff3090f8806cc67140db0cfabb6e965aece)
2013-01-14 10:33:51 -05:00
Waseem Daher 66af2da9ed Cause update_floating_recipient_bar to get called less frequently.
Putting update_floating_recipient_bar in the old location caused it to
be called on every single keypress, which is unnecessarily
expensive. Instead, just call it once when we think we might actually
need it: after initiating a narrow.

(imported from commit a6c1518c4001a2dde44d7b512236795da3ccd351)
2013-01-10 14:19:29 -05:00
Waseem Daher 1141bfa888 Properly update floating subject bar when you are at top of page.
There's this very edge-case issue which is: if you go to the top of
the page and narrow to something other than the top message, the
floating subject bar does not update.

Why? Well, the way that the narrowing code works is that it sets up
narrowing and then calls
  select_message_by_id(target_id, {then_scroll: true});
so that our selected message is in the view.

This in turn calls select_message, which calls recenter_view as
appropriate. This usually causes a scroll action, which in turn causes
the floating recipient bar to be updated.

But when we're at the top of the page, recenter_view doesn't need
to scroll at all! So the bar remains un-updated. Here we explicitly
update it to guard against that case.

This fixes Trac #651.

(imported from commit 6633cc8a81aedcbb31b30d7c1f27816f8808c700)
2013-01-10 10:59:03 -05:00
Waseem Daher 3a585505a4 Remove the narrow-view 'shadow' pointer.
And change the color to a more thematically appropriate blue.

The shadow pointer is sort of confusing; we should really provide some
different sort of indication that your pointer is potentially moving
on narrow-and-unnarrow. (I think my fade-in-fade-out later in this
commit series is a not-bad first crack at this.)

Resolves Trac #472 - Dual pointers in narrowed view can be confusing

(imported from commit 2450517d99de85ade1c0e98c5510b59e70282451)
2013-01-09 21:46:08 -05:00
Keegan McAllister 83a0d82d8f Don't retry or display connection error if we send bad narrow operators
Alternatively the server could return a successful result with an empty list of
messages.  But I prefer the solution in this commit, because it would allow us
in the future to warn the user about the problem.  It does allow users to
determine if a given stream exists, but we haven't tried to hide that
information so far.

(imported from commit a91e12c90b12d3c870c0b637c3f1d6d3cef88491)
2013-01-08 12:18:31 -05:00
Keegan McAllister 3af2bf345a Reinstate server-side narrow filtering
(imported from commit 40f63324a8dff404b504b06bddf303b8c1ad5780)
2013-01-08 12:18:31 -05:00
Keegan McAllister 38ff2d9993 Use operators to express narrowing internally
This breaks server-side filtering, for the time being.

(imported from commit 58ec2d7aa593e1c71f835b186535a038faa63239)
2013-01-08 12:18:29 -05:00
Waseem Daher 5501558fa7 Only request background color for stream messages.
subs.get_color is expecting a string, and so if you do this on
a PM, it breaks.

(imported from commit acf6d51b84d7bbbe643466f1f72f90a8f6cf16f6)
2013-01-07 17:34:27 -05:00
Zev Benjamin aad09fc267 Merge stream_set and stream_color into a single data structure
(imported from commit 88324e0d296f192feac4f5ecf45f347712cc5914)
2013-01-04 18:11:07 -05:00
Jeff Arnold 8b56de22e0 Make #narrowing to a stream with no recent messages not error
(imported from commit b8f0ff9b81876927a59139385d52a9ace96f7559)
2012-12-21 12:12:08 -05:00
Tim Abbott 0dda71fb54 Fix website improperly submitting a last value of -1.
We were submitting a 'last' value of -1 to the server at startup,
which is invalid but normally ended up being OK because the user
usually had no messages whatsoever or had last be updated via
get_old_messages before the get_updates call went through.

(imported from commit df55ac1cdac443721c06ebed94a1c4b3ec7af2d1)
2012-12-14 17:15:32 -05:00