Commit graph

937 commits

Author SHA1 Message Date
RMidhunSuresh 2761789f45 Move theme code to separate file 2022-05-11 14:58:14 +05:30
RMidhunSuresh c39f0d2efb Don't show theme chooser on dev 2022-05-10 14:12:36 +05:30
RMidhunSuresh c611d3f85c Select current theme in dropdown 2022-05-10 14:12:36 +05:30
RMidhunSuresh ecb83bb277 Store and load theme from setting 2022-05-10 14:12:36 +05:30
RMidhunSuresh daae7442bb Create theme chooser 2022-05-10 14:12:36 +05:30
Bruno Windels e903d3a6a4 mark options as readonly 2022-05-09 14:12:31 +02:00
Bruno Windels 3888291758 updateOptions is unused,not the best idea since options is/can be shared 2022-05-09 14:10:50 +02:00
Bruno Windels 6beff7e552 override emitChange so no need to clone option object for all tiles
instead, we don't store the emitChange in the options but rather on
the tile itself.
2022-05-09 14:09:45 +02:00
RMidhunSuresh 139a87de99 Pass a copy of the options to the tiles 2022-05-08 19:14:51 +05:30
Bruno Windels 57f50cc416 fix lint warnings 2022-04-08 15:01:27 +02:00
Bruno Windels a913671f0c make tileClassForEntry optional, as otherwise it is a breaking change 2022-04-08 14:19:34 +02:00
Bruno Windels 5445db2a42 allow injecting the tilesCreator from the Root/Session/RoomViewModel
this changes the API slightly to be more future-proof,
as we'll expose it in the SDK now.

The function now returns a SimpleTile constructor, rather than an
instance. This allows us to test if an entry would render in the
timeline without creating a tile, which is something we might want in
the matrix layer later on.

The function is now called tileClassForEntry, analogue to what we
do in TimelineView.
2022-04-08 12:52:30 +02:00
Bruno Windels 88482292e1
Merge pull request #700 from vector-im/ajbura-patch-2
Add observeNavigation in ViewModel
2022-04-07 14:08:40 +02:00
Bruno Windels ca211f929b
Merge pull request #702 from vector-im/bwindels/observablemapts
convert (Base)ObservableMap to typescript
2022-03-09 11:53:59 +01:00
Bruno Windels 6d7c983e8e convert (Base)ObservableMap to typescript 2022-03-09 11:33:49 +01:00
Ajay Bura e07abfa02a
Add missing type 2022-03-07 11:33:51 +05:30
Ajay Bura 61ce2f9e3d
Add observeNavigation in ViewModel 2022-03-03 15:36:25 +05:30
Eric Eastwood c09964dc30
Add data-event-id="$xxx" attributes to timeline items for easy selecting in end-to-end tests (#690)
Split out from https://github.com/vector-im/hydrogen-web/pull/653

Example test assertions: db6d3797d7/test/e2e-tests.js (L248-L252)

```js
// Make sure the $abc event on the page has "foobarbaz" text in it
assert.match(
  dom.document.querySelector(`[data-event-id="$abc"]`).outerHTML,
  new RegExp(`.*foobarbaz.*`)
);
```
2022-03-01 18:36:14 -06:00
Tushar 17acda7741 typescriptify domain/LogoutViewModel.js 2022-02-25 16:45:07 +05:30
Tushar 7055f02f16 typescriptify domain/avatar.js 2022-02-25 15:52:54 +05:30
Bruno Windels 7f1fed6f8c always pass options to ViewModel constructor 2022-02-17 09:24:18 +01:00
RMidhunSuresh 498a43327f Check if options exist in emitChange 2022-02-17 11:30:04 +05:30
Bruno Windels 7179758c50 also here 2022-02-15 08:22:09 +01:00
Bruno Windels 1795f58ba5 rename imports 2022-02-14 17:53:59 +01:00
Bruno Windels 4d82dd22b6 convert ViewModel to typescript 2022-02-14 17:50:17 +01:00
Bruno Windels 57b1542688 use private topic field as public one got removed as not needed in view 2022-02-11 09:37:56 +01:00
Bruno Windels d2008a336b fix lint errors 2022-02-10 19:54:47 +01:00
Bruno Windels 8526461d3c split up create code into separate files 2022-02-10 16:43:32 +01:00
Bruno Windels 15eecbb463 cleanup 2022-02-10 16:28:44 +01:00
Bruno Windels 30c8ea29b2 fix bug where the wrong left panel tile is removed when accepting invite
because when comparing a tile to itself it wasn't returned 0
2022-02-10 16:27:32 +01:00
Bruno Windels b0d790543a push to navigation in SessionViewModel rather than RVO 2022-02-10 14:57:48 +01:00
Bruno Windels 2c1b29e637 remove logging 2022-02-10 14:39:41 +01:00
Bruno Windels 147810864f add support to set alias and federation flag in create room 2022-02-10 14:09:18 +01:00
Bruno Windels 4c0167ed74 don't show spinner in left panel when room creation fails 2022-02-10 11:19:43 +01:00
Bruno Windels 024a6c06aa handle offline error nicer 2022-02-10 11:11:15 +01:00
Bruno Windels b5536830d0 improve RoomBeingCreatedView, allow removing the roombeingcreated 2022-02-10 11:07:29 +01:00
Bruno Windels d6d1af13d0 rename RoomBeingCreated.localId to id 2022-02-10 11:03:52 +01:00
Bruno Windels 74f7879cb6 fix unrelated bug: invite sorting order wasn't stable in left panel
as the timestamp is the same when you receive the invite during your
first sync
2022-02-10 09:40:03 +01:00
Bruno Windels 5c085efc10 create room view and view model 2022-02-09 19:02:51 +01:00
Bruno Windels a1e14c4eec rename to not have conflict between method name and instance of CreateRoomViewModel 2022-02-09 19:02:18 +01:00
Bruno Windels 8523f6feaf setup navigation for create room form 2022-02-09 19:00:41 +01:00
Bruno Windels 83d2b58bad add avatar support to creating room 2022-02-09 19:00:00 +01:00
Bruno Windels 743f2270e5 have a single tile view that supports all 3 view models 2022-02-08 16:22:44 +01:00
Bruno Windels 5325b0b466 cleanup logging 2022-02-08 14:58:29 +01:00
Bruno Windels d7b024eac1 unrelated fix: encode user name in matrix.to link 2022-02-08 14:35:14 +01:00
Bruno Windels e04463c143 WIP for finding DM room 2022-02-07 18:58:53 +01:00
Bruno Windels e1fbd1242e WIP 4 2022-02-07 16:30:44 +01:00
Bruno Windels 0bb3cfcfad WIP3 2022-02-04 17:49:10 +01:00
Bruno Windels 0b04612d6c WIP2 2022-02-04 11:16:58 +01:00
Bruno Windels bc09ede09f WIP 2022-02-03 17:57:35 +01:00
Bruno Windels fd4eb6b50d distinguish between "waiting to go online" vs "backup not configured" 2022-02-01 11:08:13 +01:00
Bruno Windels 997666164c remove unused enum variants 2022-01-31 17:37:44 +01:00
Bruno Windels 06a1421e97 add backupWriteStatus so binding can take multiple fields into account 2022-01-31 16:26:06 +01:00
Bruno Windels dacaa86386 fix percentage calculation 2022-01-31 16:22:22 +01:00
Bruno Windels c9b5ce6508 clean up key backup vm using flatMap to avoid subscription handling 2022-01-28 16:36:13 +01:00
Bruno Windels bd2c70b923 adapt key backup view(model) to changes in session, show backup progress 2022-01-28 15:14:23 +01:00
Bruno Windels 86caa5f9b1 rename session backup to key backup to be consistent with RoomKey 2022-01-26 09:51:48 +01:00
Bruno Windels b0e8506cb5 ensure images load in reply preview in timeline 2022-01-17 16:48:36 +01:00
Bruno Windels f379bf2341 ensure images load in reply preview in composer 2022-01-17 16:48:17 +01:00
Bruno Windels 57bf730241 mention it's better to not close the app 2022-01-17 16:33:57 +01:00
Bruno Windels 4c5b884af7 create and hook up logout viewmodel, on /logout/<id> path 2022-01-17 16:30:22 +01:00
Bruno Windels 65929194b0 fix lint warnings 2022-01-14 16:23:55 +01:00
Bruno Windels 184a16a194 also define param 2022-01-14 16:23:12 +01:00
Bruno Windels 8201a85c47 ensure these have a fn for tilesCreator 2022-01-14 16:20:38 +01:00
Bruno Windels 2321228981 use this._entry here (once updated by super.updateEntry) 2022-01-14 16:20:14 +01:00
Bruno Windels 5f99c2360c also try to create replyTile from ctor just in case update doesn't come 2022-01-14 16:12:43 +01:00
Bruno Windels ad335d5088 pass in tilesCreator everywhere, although not needed right now 2022-01-14 16:06:29 +01:00
Bruno Windels 1ea4a347e2 encode url components 2022-01-14 15:53:17 +01:00
Bruno Windels 3c59004e72 Merge branch 'master' into threading-fallback-reply 2022-01-14 15:43:24 +01:00
Bruno Windels 17ebc8a066
Merge pull request #611 from vector-im/threading-fallback-relation
Threading fallback - PR 1 - Link events with their related event
2022-01-14 15:35:27 +01:00
Bruno Windels 18a76025c7 add location tile view so we don't throw when a location is shared 2022-01-14 15:27:46 +01:00
RMidhunSuresh dac2d5e685 Pass everything down into updateEntry 2022-01-14 19:26:23 +05:30
RMidhunSuresh 0af9f10166 don't store tilesCreator 2022-01-14 19:11:40 +05:30
Bruno Windels 1f9be978b7 load image in timeline from when it is partially visible 2022-01-14 13:57:11 +01:00
RMidhunSuresh 51215fda16 Rename tileCreator -> tilesCreator 2022-01-14 18:17:49 +05:30
RMidhunSuresh d639e169ec Move tileCreator to BaseMessageTile 2022-01-14 18:17:49 +05:30
RMidhunSuresh e1b9b1161d Split ifs and remove ?. abuse 2022-01-14 18:17:49 +05:30
RMidhunSuresh 846e637716 Remove stray newline 2022-01-14 18:17:49 +05:30
RMidhunSuresh 58dd25b58d track reply-tile 2022-01-14 18:17:49 +05:30
RMidhunSuresh a77b9d9027 Move update logic to BaseMessageTile 2022-01-14 18:17:49 +05:30
RMidhunSuresh 951af49e04 Emit change on reply tile 2022-01-14 18:17:49 +05:30
RMidhunSuresh 455b747a1c Don't check param for reply 2022-01-14 18:17:49 +05:30
RMidhunSuresh f9f7f6cc6f Fix test 2022-01-14 18:17:49 +05:30
RMidhunSuresh 7f91653208 Rename replyTextTile -> replyTile 2022-01-14 18:17:49 +05:30
RMidhunSuresh af5a008d0f Move links to vm 2022-01-14 18:17:49 +05:30
RMidhunSuresh 27a9f5dd02 Use DOMPurify to remove mx-reply 2022-01-14 18:17:49 +05:30
RMidhunSuresh e352867f5a Remove unnecessary ctor 2022-01-14 18:17:49 +05:30
RMidhunSuresh f645065db7 Remove unused getter 2022-01-14 18:17:49 +05:30
RMidhunSuresh 0c3f16e5f6 Use 's' flag with regex if available 2022-01-14 18:17:49 +05:30
RMidhunSuresh cba044eff1 Remove comment 2022-01-14 18:17:49 +05:30
RMidhunSuresh 46b69b3873 Render error 2022-01-14 18:17:49 +05:30
RMidhunSuresh bb45d0eae9 Render non-text messages as well 2022-01-14 18:17:49 +05:30
RMidhunSuresh df22db256b No need to pass tileCreator as argument 2022-01-14 18:17:49 +05:30
RMidhunSuresh e0dc853d74 Fill matrix.to links 2022-01-14 18:17:49 +05:30
RMidhunSuresh 91912bdb8d Create tile using tileCreator 2022-01-14 18:17:49 +05:30
RMidhunSuresh 54004eef4d Integrate into update mechanism 2022-01-14 18:17:49 +05:30
RMidhunSuresh aa3bb9c6ef Remove allowReplies 2022-01-14 18:17:49 +05:30
RMidhunSuresh 73c5562fd3 Remove code from BaseTextTile 2022-01-14 18:17:49 +05:30
RMidhunSuresh 4a12acf157 Improve error code 2022-01-14 18:17:49 +05:30
RMidhunSuresh 67da746b48 Render error 2022-01-14 18:17:49 +05:30