Commit Graph

171 Commits

Author SHA1 Message Date
Scott Nonnenberg 548586b934 Chrome export fixes: too-long names, redact group ids (#1402)
* On export, don't print out entire group id, just last three chars

FREEBIE

* Export: Limit conversation dirs to 30 characters of original name

FREEBIE

* Redact groups ids on import as well

FREEBIE

* InboxView: Protect against nonexistent loading screen

FREEBIE
2017-08-30 09:30:21 -07:00
Scott Nonnenberg c0cd733139 Full export, migration banner, and full migration workflow - behind flag (#1342)
* Add support for backup and restore

This first pass works for all stores except messages, pending some scaling
improvements.

// FREEBIE

* Import of messages and attachments

Properly sanitize filenames. Logging information that will help with
debugging but won't threaten privacy (no contact or group names),
where the on-disk directories have this information to make things
human-readable

FREEBIE

* First fully operational single-action export and import!

FREEBIE

* Add migration export flow

A banner alert leads to a blocking ui for the migration. We close the socket and
wait for incoming messages to drain before starting the export.

FREEBIE

* A number of updates for the export flow

1. We don't immediately pop the directory selection dialog box, instead
  showing an explicit 'choose directory' button after explaining what is
  about to happen
2. We show a 'submit debug log' button on most steps of the process
3. We handle export errors and encourage the user to double-check their
  filesystem then submit their log
4. We are resilient to restarts during the process
5. We handle the user cancelling out of the directory selection dialog
  differently from other errors.
6. The export process is now serialized: non-messages, then messages.
7. After successful export, show where the data is on disk

FREEBUE

* Put migration behind a flag

FREEBIE

* Shut down websocket before proceeding with export

FREEBIE

* Add MigrationView to test/index.html to fix test

FREEBIE

* Remove 'Submit Debug Log' button when the export process is complete

FREEBIE

* Create a 'Signal Export' directory below user-chosen dir

This cleans things up a bit so we don't litter the user's target
directory with lots of stuff.

FREEBIE

* Clarify MessageReceiver.drain() method comments

FREEBIE

* A couple updates for clarity - event names, else handling

Also the removal of wait(), which wasn't used anywhere.

FREEBIE

* A number of wording updates for the export flow

FREEBIE

* Export complete: put dir on its own line, make text selectable

FREEBIE
2017-08-28 13:06:10 -07:00
Scott Nonnenberg 31d7e652fe Dismiss the app loading screen if we failed to connect to socket
FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 305bd6b3b8 App loading screen: show messages processed so far
Also, show the same loading screen on index.js before we've bootstrapped
the app.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 39795170c1 Handle the 'extension loaded, reopen window' scenario
Not sure exactly how to think about Chrome app lifetimes, so we're
being conservative. We only show the full-application loading screen
once, on first display of the inbox.

FREEBIE
2017-08-04 12:03:25 -07:00
Scott Nonnenberg 53f2bfbb57 Animated loading screens on startup and first conversation load
FREEBIE
2017-08-04 12:03:25 -07:00
lilia a5a9118c5c Fix empty bubble on accepting a new key
// FREEBIE
2017-05-02 13:50:48 -07:00
Sam Vevang ed4991974b set up a new view for displaying the network status
// FREEBIE
2017-04-08 00:10:56 -07:00
alecglassford ef4b4da2a3 Make search clear button ("x") persist w/o hover
This makes the "x" in the search bar always visible when there is
text in the search box, even if the mouse is not hovering, hopefully
making for a clearer UI around search and resolving issue #741

The implementation adds the "x.svg" as a background image to the search
box when it is classed with .active, in addition to the
-webkit-search-cancel-button, which is still there for the actual
functionality but only appears on mouse hover (one tiny snag is that
coloring appears slightly different on hover, at least on my screen -
don't know if this is a problem).

I accounted for both ltr and rtl text-direction by using
getComputedStyle(...).direction to detect from the input's dir="auto"
- if there's a more elegant way to do this, please suggest. An ideal
solution would use the :dir pseudo-class but it's not implemented
in Chrome yet - https://developer.mozilla.org/en-US/docs/Web/CSS/:dir

For now, I added the direction-checking to inbox_view.js. I see that
input.search is also used in new_group_update_view.js and
recipient_input_view.js but neither of these views seem to be in use (?)
and they don't set the .active class anyway, so I ignored them.

Update: Amended version a few hours later - fixed and manually tested
color and spacing for iOS and Android Dark themes. Also made some new
SASS variables to make things DRYer and fixed my tab size.
2017-04-08 00:06:48 -07:00
Ikarulus 53cd3af78b Added a dark theme
I added a dark theme in order to solve #328.
This may fix #328 at least partially.
2016-12-02 00:41:42 +01:00
lilia 674eeb8313 Remove refs to appWindow
We only need the regular window, not the AppWindow interface, which is
specific to chrome apps.
2016-10-07 11:02:26 +09:00
lilia 9da4cdefd7 Style fix 2016-10-07 11:02:26 +09:00
Paolo Inglese 7cd45714a5 Font size should be adjustable
//FREEBIE
2016-10-07 11:02:26 +09:00
lilia b0c59233f3 Add test fixtures
Test page loads fixtures and renders the inbox view. This may be useful
for smoke testing style changes or generating screenshots with
pseudo-realistic data.

Includes a couple small changes to get rendering working outside the
app.
2016-09-23 19:51:42 -07:00
lilia 8fbb0d05f5 Add settings ui for theme
// FREEBIE
2016-08-30 18:31:02 -07:00
lilia 7b9894d688 Refactor css to support theming
Move away from inline style attributes for setting contact colors.
Apply colors by name via css classes instead. Also lays groundwork
for syncing contact colors.

// FREEBIE
2016-08-30 18:31:02 -07:00
lilia 3531667207 Fix closing recorder when clicking away
// FREEBIE
2016-08-25 11:40:40 -07:00
lilia 87f4029210 Fix lint
// FREEBIE
2016-08-24 16:56:24 -07:00
lilia 3aa72d2244 Address large font size edge cases
Fix some visual bugs occuring at large font size:
  * Contact names break onto the next line after their avatars in
    message detail screen
  * Settings menu font-size failed to scale
  * Handle Content overflow in modals.

// FREEBIE
2016-08-24 16:47:39 -07:00
lilia b330b80484 Change font size on ctrl+scroll
Fixes #864

// FREEBIE
2016-08-24 16:10:02 -07:00
lilia 4f46a164ba Add voice notes
// FREEBIE
2016-08-23 16:16:31 -07:00
lilia 5bff1d2cab Scope media pausing to the open conversation
// FREEBIE
2016-06-30 12:54:00 -07:00
Benedikt Radtke d5b003a15e Fixed media pausing behaviour when clicking the conversation list
This commit changes the inbox to stop video and audio elements when selecting a new conversation, and to not stop such elements when the same
conversation was selected (fixes #391).

// FREEBIE
2016-06-30 12:47:06 -07:00
lilia 9091233950 Open images in a lightbox
Adds file-write permission for saving to disk from lightbox.

Fixes #810

// FREEBIE
2016-06-20 11:55:23 -07:00
lilia 9aa429e18a Add frontend support for expiring releases
When a release expires, it gets a persistent banner notification to
upgrade, and an ephemeral toast warning when trying to send a message.

// FREEBIE
2016-04-03 21:11:50 -07:00
lilia 1aa975e199 Differentiate active vs selected conversation states
// FREEBIE
2016-04-01 11:37:25 -07:00
lilia 07a0463b65 Fix conversation list self-resorting
When deleting all messages in a conversation, the entry in the left pane
should be inserted into the alphabetical portion of the list. To keep it
in this collection, do not nullify active_at.

To ensure the list view is keeping itself correctly sorted, make sure
that resorting behavior is triggered any time a relevant attribute is
changed.

This fixes deleted conversations jumping to the top of the list, and
conversation order scrambling when getting a group or contact sync
message from our master device.

Fixes #734

// FREEBIE
2016-03-25 14:32:57 -07:00
lilia 08da29969c Fix menu behavior
Opening the global menu should close the conversation menu and vice
versa.

// FREEBIE
2016-03-22 11:01:37 -07:00
lilia b57f26bac4 Ignore clicks on the placeholder and its contents
// FREEBIE
2016-03-21 17:46:09 -07:00
lilia d391f07c1e Change right header color
// FREEBIE
2016-03-21 11:03:50 -07:00
lilia a925657c45 Fix global menu close handler
Previously, clicking on a conversation menu would not close the global
menu.

// FREEBIE
2016-03-20 23:34:56 -07:00
lilia 8bb8ed8151 Change left pane header color
// FREEBIE
2016-03-20 21:01:45 -07:00
lilia 647c2761e0 Move restart button into global menu
// FREEBIE
2016-03-18 16:21:55 -07:00
lilia 18a5ce8e54 Restyle conversation panel
// FREEBIE
2016-03-18 13:09:45 -07:00
lilia 760bfffb50 Show all contacts all the time
Contacts without conversation identity appear in alphabetical order at
the end of the inbox.

// FREEBIE
2016-03-18 11:21:11 -07:00
lilia 7fb4d3d8aa Load all inbox convos before rendering
This is a better alternative to the fix in 0434c4b, which causes
problems when creating a new conversation from entering a phone number.

// FREEBIE
2016-03-17 20:58:56 -07:00
lilia 0434c4bc53 Fixes #663 Conversation list loads in reverse order
The onChangeActiveAt listener promotes newly activated conversations to
the top of the inbox. By firing on an 'add' event, if the conversation
list happened to load after the inbox frontend was initialized, each new
entry would be incorrectly moved to the top, effectively reversing the
list.

// FREEBIE
2016-03-12 15:34:33 -08:00
lilia a3c6061480 Add Notification Settings
Fixes #471

// FREEBIE
2016-02-18 12:22:43 -08:00
lilia 4066223d72 i18n SocketView
// FREEBIE
2016-01-02 02:51:24 -08:00
lilia 836a7cb8c5 i18n InboxView
// FREEBIE
2016-01-02 02:51:24 -08:00
lilia 7dd0fb70b5 Remove unused code
Here lies the remains of the old compose flow, which must eventually be
restored for group creation flow, but will likely be rewritten entirely.

// FREEBIE
2015-12-09 18:58:51 -08:00
lilia ae52c047bf Clean up open-event logic with new convos and search results
Search view triggers an open event when a valid phone number is entered
and the 'Create new contact' card is clicked.

Inbox view should listen and respond to this event. It should also
disregard select events on the new contact element since those are fired
before phone number validation.

Finally, the search view can stop listening to select events because the
inbox view is already doing so.

// FREEBIE
2015-12-09 18:58:51 -08:00
lilia c1aada4f0f Don't request background page from background page
This file is loaded by the background page, which means it is already
bound to the background page's global context. This was not true at some
time in the distant past but is true now.

// FREEBIE
2015-12-07 12:36:30 -08:00
lilia 85285a1094 Inline a one-line function only used in one place
// FREEBIE
2015-12-05 19:33:11 -08:00
lilia db773dd8a7 Fix selected state transition on firstRun
// FREEBIE
2015-11-28 15:50:44 -08:00
lilia 8d214b73d9 Render conversation placeholder hint in place
// FREEBIE
2015-11-28 14:42:25 -08:00
lilia 891a5e54ad Add hint for users with no groups or contacts
If you have no contacts or groups, display a hint about phone numbers.

// FREEBIE
2015-11-27 22:26:56 -08:00
lilia 7bf94c33d5 Show all contacts when inbox is empty 2015-11-27 22:26:55 -08:00
lilia d4e0c11ebc Show a hint on startup if the inbox is empty
Fixes #403

// FREEBIE
2015-11-27 11:36:46 -08:00
lilia 50602fb8e5 Remove unnecessary jquery insertion
This element is rendered in place already.

// FREEBIE
2015-11-23 16:13:31 -08:00
lilia 2ee8cae8d4 Move some initial setup to the 'opened' event
Avoid inbox views digging too deep into conversation views.

// FREEBIE
2015-11-15 14:59:21 -08:00
lilia 2861fa26a7 Implement infinite scrolling message lists
Only load the most recent messages when initially rendering a
conversation. Scrolling to the top of a message list loads older
messages.

This required some slight refactoring of how we insert message elements
into the dom. If the message is added to the end of the collection,
append it at the end. Otherwise, assume it is an older message and
prepend it.

When adding elements to the top, reset the scrollPosition to its
previous distance from scrollHeight. This keeps the current set of
elements fixed in the viewport.

// FREEBIE
2015-11-15 14:56:58 -08:00
lilia f0dcf44b9f Use onClosed instead of onSuspend
Renames extension.windows.beforeUnload to onSuspend, to match the
underlying chrome api call. onClosed fires when the frontend app window
is closed, while onSuspend fires when the background page is closed or
refreshed (which amounts to an app restart).

Frontend views are initialized iff the inbox window is opened, and so
should always be listening to onClosed in order to know when they are no
longer needed.

// FREEBIE
2015-11-08 10:49:31 -08:00
lilia e842ade196 Slow your roll, socket status updates
Avoid a 1 sec flash of "Disconnected" if connection is dropped only
momentarily.

// FREEBIE
2015-10-22 10:12:34 -07:00
lilia 2f8d973366 Restore native window chrome
// FREEBIE
2015-10-16 12:52:10 -07:00
lilia f70c22f898 Add search field to inbox
Using the search field produces a filtered view of all contacts and
groups containing the input. To make this fast and scalable, add an
index on a 'tokens' array containing words from the conversation name
and different forms of phone number.

Closes #365

// FREEBIE
2015-10-15 13:33:07 -07:00
lilia 4a482243d0 Simplify event arguments
// FREEBIE
2015-09-21 10:32:35 -07:00
lilia 960754ef04 Restyle compose button
Move it to a tool bar at the top of the conversation list. This is also
where a search bar will live someday.

Fixes #357

// FREEBIE
2015-09-18 13:08:52 -07:00
lilia 90e9216e19 Add UI for submitting debug logs
Fixes #343

// FREEBIE
2015-09-16 11:28:37 -07:00
lilia fa0e2584f4 Fix new threads not appearing at top of inbox
When messages from someone not in your inbox arrived, that thread would
appear at the bottom of the inbox instead of the top.

// FREEBIE
2015-09-15 16:45:52 -07:00
lilia a390e37abc Fixup change:active_at handling when setting null
When a conversation goes from active to not active, it should be removed
the view rather than promoted.

// FREEBIE
2015-09-14 16:29:03 -07:00
lilia bd5f43bdb1 Avoid excessive re-rendering of the inbox list
This listener is doing way more work than necessary to update the dom by
removing all the list items and re-creating them. This also causes the
bug where selected state is cleared when new messages arrive, not to
mention binding new event listeners without unbinding the old ones.

Fix by simply promoting an element to the top of the list when it's
active_at value changes, rather than re-rendering the whole list. This
could backfire if the value gets changed to an earlier timestamp but for
now we assume that won't happen.

// FREEBIE
2015-09-14 13:49:20 -07:00
lilia 1a30d003f5 Fetch group contacts before fetching new messages
Messages must wait for sender info to arrive before rendering.

// FREEBIE
2015-09-14 13:49:09 -07:00
lilia 756875f235 Refactor inbox collection listeners
Create a new collection type for the inbox which listens to events on
the main conversation cache. Also don't reload conversation info from
the database as often or when unnecessary.

Fixes #345

// FREEBIE
2015-09-08 19:28:33 -07:00
lilia f764445c86 Remove erroneous license file and headers
We only use GPLV3 around here.

// FREEBIE
2015-09-07 14:58:42 -07:00
lilia 21aaf0fab5 Clean up notification and unread indicator behavior 2015-08-27 15:04:43 -07:00
lilia baa55c9018 Refactor for less model duplication 2015-08-27 12:38:51 -07:00
lilia c4eac76032 Fix for new contact button bug 2015-08-26 22:33:00 -07:00
lilia 17051cef9d Only add loading class from inbox 2015-08-26 17:48:02 -07:00
lilia d07357ce9a Retool various sub-screens to fit two-column layout 2015-08-26 15:15:14 -07:00
lilia bcec207674 Mark read when opening a conversation 2015-08-26 10:12:05 -07:00
lilia d6a4e6e496 Restore two column layout
Establishes basic functionality for viewing conversations in two column
mode, including message area and message list resizing, and maintaining
scroll position.

Various subviews need to be retooled but are more or less still
functional, i.e., new message, message detail, key verification, etc...
2015-08-25 17:01:22 -07:00
lilia 00dfcbb462 Change websocket closed message 2015-08-24 09:10:48 -07:00
lilia 82de8148d2 Reload harder
Refreshing the background page does re-open the socket, but the inbox
and other windows don't reattach correctly. Reload the whole runtime to
force close all windows, reload the background, and re open the inbox.
2015-07-08 17:53:47 -07:00
lilia ac401c78b3 Fix socket status indicator
It was not correctly reporting the status after a background page reload.
2015-06-09 11:30:45 -07:00
lilia cdb7fcfbad Pass windows around to let file inputs work 2015-06-04 13:39:52 -07:00
lilia 95f8e3921c Keep inbox window open, but allow it to be hidden
As a chrome packaged app, we have to keep at least one window open in
order to maintain our websocket connection in the background page.

This change replaces the system window frame with custom buttons in the
inbox header, such that the 'close' button merely hides the window
rather than unloading it.

Fixes #237
FREEBIE
2015-05-21 13:08:43 -07:00
lilia 7afd0a02e8 Convert beforeunload listeners 2015-05-15 11:39:23 -07:00
lilia 76e170686a Make getBackground async 2015-05-12 15:39:15 -07:00
lilia 5d4298697c Use view.$ shorthand for scoped jquery searches
Wish I'd noticed that one earlier. http://backbonejs.org/#View-dollar
2015-03-29 16:29:05 -07:00
lilia 5ffa265559 Revert "Popout inbox"
This reverts commit 31e7d285e3.

This seemed like a nice feature, but the popup bubble isn't very
conducive to nontrivial user inputs, e.g. file inputs.

Fixes #211
2015-03-23 12:19:32 -07:00
lilia 31e7d285e3 Popout inbox
Rather than opening the inbox in its own window, let it appear as a
browser action popup by default, but allow promotion to its own window
if requested.
2015-03-18 16:29:01 -07:00
lilia 019a9d1fbc Unread counts
Update unreadCounts per-conversation on incoming messages. Render unread
conversations with font-weigh: bold in the inbox view.

To ensure that the inbox and conversation views remain in sync, the
background page now ensures that the same models objects are used for
both views.
2015-03-11 15:13:36 -07:00
lilia c73f4d71a7 DRY up scrollable pattern
Switch to using gutter class instead of id since there is potentially
more than one usage on the page.
2015-03-09 16:05:06 -07:00
lilia a72ea7966d Clean up inbox/compose view rendering and swapping
Templatize the inbox view and use the same pattern for in-window view
switching as is now used with the conversation/message detail views.
This means doing more with markup and less jquery manipulation of
individual subelements of the inbox view.
2015-03-09 16:05:06 -07:00
lilia fd6e2954f7 Curtail over-zealous websocket reconnects
Closes #173

Previously, in the event of a failed websocket auth, we would attempt to
reconnect once a second ad infinitum. This changeset ensures that we
only reconnect automatically if the socket closed 'normally' as
indicated by the code on the socket's CloseEvent. Otherwise, show a
'Websocket closed' error on the inbox view.

Ideally we would show a more contextual error (ie, 'Unauthorized'), but
unfortunately the actual server response code is not available to our
code. It can be observed in the console output from the background page,
but programmatically, we only receive the WebSocket CloseEvent codes
listed here:
https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent#Status_codes

The websocket error message is displayed by a normally-hidden but ever
present socket status element. Clicking this element will immediately
refresh the background page, which will try again to open the websocket
connection.
2015-03-09 16:04:26 -07:00
lilia 368cd2f79a Refactor back button style
Make it easier to reuse these styles.
2015-02-23 12:52:15 -08:00
lilia 3292177a96 Remove resize logic in favor of pure css 2015-02-18 23:09:34 -08:00
lilia 955ef60292 Fix list_view-related error in background page
Background page conversations were trying to trigger events on the inbox
list view which had been destroyed, resulting in a background page
console error of "can't read innerHeight of null".

Avoid this by removing listeners when the inbox window is closed.
2015-02-18 11:26:18 -08:00
lilia 44b1e5c88e Move inbox collection to the background page
No more waiting, no more messy fetch logic. Background page
bootstraps the inbox and keeps it up to date.
2015-02-12 13:21:17 -08:00
lilia d5c85dfbd8 Resize inbox listview after it finishes loading
Ensures that scrollbars are properly setup on load.
2015-02-12 13:21:17 -08:00
lilia 3a099657e6 Untangle select vs open events 2015-02-12 13:21:17 -08:00
lilia 746e6530b9 WIP pill view for selected recipients 2015-02-12 13:21:16 -08:00
lilia 9e245e67e0 Fix double-opening exsisting conversations from typeahead 2015-02-12 13:21:15 -08:00
lilia aca3db97da New messages auto-update the inbox & conversation
When a new message arrives, if its conversation is not already opened,
the background page opens it. If it is alrady open the window is
focused. Finally, the 'message' event is triggered, resulting in
   1. the inbox refetches conversations
   2. all conversations fetch new messages

TODO: only send this event to the target window
2015-02-11 17:38:03 -08:00
lilia db5e7fd6b6 Fix list view scrolling
Resize handlers are ugly. But not as ugly as scroll handlers. :p
Normalized some whitespace along the way.
2015-02-11 17:38:03 -08:00
lilia a00632c728 Hook up group creation flow UI
Checkboxes add and remove members as well as exposing the group update
ui. The conversation window is opened after saving the group.
2015-02-11 17:38:01 -08:00
lilia 87cd3f5053 Save and open new contact on click 2015-02-11 17:38:00 -08:00
lilia 17f3263a21 Listen for escape key anywhere in the inbox 2015-02-11 17:38:00 -08:00
lilia 070393170c Auto-focus new conversation input field 2015-02-11 17:38:00 -08:00