Commit Graph

3855 Commits (2e121310e4426a60b7d21446740b37e893051369)
 

Author SHA1 Message Date
Daniel Gasienica 2e121310e4 🎨 Fix lint error 7 years ago
Daniel Gasienica 4d04638358 Document changes for MVP 7 years ago
Daniel Gasienica c3e04ecf87 Remove use of `LoadingIndicator` 7 years ago
Daniel Gasienica 6d5d0df1c0 🎨 Fix TSLint errors 7 years ago
Daniel Gasienica 8b9516de72 Update test for attachment metadata 7 years ago
Daniel Gasienica 86a9923181 Remove TODOs 7 years ago
Daniel Gasienica 204de3aaea Lazily bind `Signal.Components.MediaGallery` 7 years ago
Daniel Gasienica 146178f977 Update schema documentation 7 years ago
Daniel Gasienica f240269d7b MVP: Only show images in media gallery 7 years ago
Daniel Gasienica b4e3749c88 MVP: Only show media tab
Until we support showing documents.
7 years ago
Daniel Gasienica 60ed82b728 Show all lightbox controls in style guide 7 years ago
Daniel Gasienica b4a4182613 Hide ‘Save As…’ button in media gallery
Wait until we support it.
7 years ago
Daniel Gasienica a7ed21a811 Add `shouldShowSaveAsButton` option 7 years ago
Daniel Gasienica 0d676a65b8 Open media gallery item in lightbox 7 years ago
Daniel Gasienica a9f7f18721 Add `ItemClickEvent` 7 years ago
Daniel Gasienica d634a414c3 Make visibility of previous/next buttons opt-in 7 years ago
Daniel Gasienica 142236640e Click lightbox to close 7 years ago
Daniel Gasienica ce825fbd66 Rename `save` to `onSave` 7 years ago
Daniel Gasienica 1b9e581e90 Show lightbox image as large as possible 7 years ago
Daniel Gasienica 2cb0b0aeb1 Add arrow controls 7 years ago
Daniel Gasienica f0895af6dc Add right arrow SVG 7 years ago
Daniel Gasienica 246e0ca87b Add note about inline styles 7 years ago
Daniel Gasienica b0e1cc49a5 Remove legacy Backbone lightbox 7 years ago
Daniel Gasienica d797ede791 Close lightbox on escape key press 7 years ago
Daniel Gasienica 86da80fd23 Wire up attachment saving 7 years ago
Daniel Gasienica 593976fe21 Extract Backbone Lightbox view module 7 years ago
Daniel Gasienica 8cfe12644a Add `Lightbox` to style guide 7 years ago
Daniel Gasienica 2474b42198 Port lightbox icon buttons 7 years ago
Daniel Gasienica 3acdeb90c3 Make `ReactWrapperView` globals explicit 7 years ago
Daniel Gasienica 4a5a2cb5c1 Replace Backbone with React lightbox 7 years ago
Daniel Gasienica cb94d09ef9 Rename media gallery items 7 years ago
Daniel Gasienica 5d0469adef Skip loading videos into memory for performance 7 years ago
Daniel Gasienica c6904476f4 Improve `IndexableBoolean` type 7 years ago
Daniel Gasienica 809e34b0f4 Load 50 attachments for media gallery 7 years ago
Daniel Gasienica 0a4be2e0f4 Remove unused `i18n` 7 years ago
Daniel Gasienica 4ce0472b9f Extract `Message.loadWithObjectURL` 7 years ago
Daniel Gasienica 45d89d1e44 Create `UserMessage` type
Describes user visible messages that can have attachments.
7 years ago
Daniel Gasienica 2dc3877fd4 Integrate visual media attachment gallery 7 years ago
Daniel Gasienica 27c4bf90e3 Add `Signal.Backbone` 7 years ago
Daniel Gasienica 825980fbd1 Add `Collection.fetchVisualMediaAttachments` 7 years ago
Daniel Gasienica cad5e417f3 Add `arrayBufferToObjectURL` module 7 years ago
Daniel Gasienica e5d90775d0 Add `MapAsync` type definition 7 years ago
Daniel Gasienica 648a7ab1bb Autoformat using Prettier 7 years ago
Daniel Gasienica 320a8d31c1 TSLint: Allow multiline JS in JSX for CSS-in-JS 7 years ago
Daniel Gasienica cd2a02a626 Add TSLint Prettier overrides 7 years ago
Daniel Gasienica 082ef98a56 Add type definition for `deferredToPromise` 7 years ago
Daniel Gasienica e07458d886 Add basic Backbone type definitions 7 years ago
Daniel Gasienica 9d84b2f420 Index messages with attachments using a boolean
When indexing message attachment metadata using numeric indexes such as:

```javascript
{
  conversationId: '+12223334455',
  received_at: 123,
  attachments: […],
  numAttachments: 2,
},
{
  conversationId: '+12223334455',
  received_at: 456,
  attachments: [],
  numAttachments: 0,
}
{
  conversationId: '+12223334455',
  received_at: 789,
  attachments: [],
  numAttachments: 1,
}
```

It creates an index as follows:

```
[conversationId, received_at, numAttachments]
['+12223334455', 123, 2]
['+12223334455', 456, 0]
['+12223334455', 789, 1]
```

This means a query such as…

```
lowerBound: ['+12223334455', 0,                1               ]
upperBound: ['+12223334455', Number.MAX_VALUE, Number.MAX_VALUE]
```

…will return all three original entries because they span the `received_at`
from `0` through `Number.MAX_VALUE`. One workaround is to index booleans using
`1 | undefined` where `1` is included in the index and `undefined` is not, but
that way we lose the ability to query for the `false` value. Instead, we flip
adjust the index to `[conversationId, hasAttachments, received_at]` and can
then query messages with attachments using

```
[conversationId, 1 /* hasAttachments */, 0                /* received_at */]
[conversationId, 1 /* hasAttachments */, Number.MAX_VALUE /* received_at */]
```
7 years ago
Daniel Gasienica c46e1a1519 Move top-level functions to `Signal.Util` 7 years ago
Daniel Gasienica 5ec8b1c6e1 Add `@types/jquery` 7 years ago