Commit graph

98 commits

Author SHA1 Message Date
Eugen Rochko
ca78b1473e
Fix undefined error regression in status component in web UI ()
Regression from 
2019-12-30 03:55:11 +01:00
Matt Panaro
31f7c3fc5d Summary: fix slowness due to layout thrashing when reloading a large … ()
* Summary: fix slowness due to layout thrashing when reloading a large set of status updates

in order to limit the maximum size of a status in a list view (e.g. the home timeline), so as to avoid having to scroll all the way through an abnormally large status update (see https://github.com/tootsuite/mastodon/pull/8205), the following steps are taken:
•the element containing the status is rendered in the browser
•its height is calculated, to determine if it exceeds the maximum height threshold.
Unfortunately for performance, these steps are carried out in the componentDidMount(/Update) method, which also performs style modifications on the element.  The combination of  height request and style modification during javascript evaluation in the browser leads to layout-thrashing, where the elements are repeatedly re-laid-out (see https://developers.google.com/web/fundamentals/performance/rendering/avoid-large-complex-layouts-and-layout-thrashing & https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Performance_best_practices_for_Firefox_fe_engineers).
The solution implemented here is to memoize the collapsed state in Redux the first time the status is seen (e.g. when fetched as part of a small batch, to populate the home timeline) , so that on subsequent re-renders, the value can be queried, rather than recalculated.  This strategy is derived from https://github.com/tootsuite/mastodon/pull/4439 & https://github.com/tootsuite/mastodon/pull/4909, and should resolve https://github.com/tootsuite/mastodon/issues/12455.

Andrew Lin (https://github.com/onethreeseven) is thanked for his assistance in root cause analysis and solution brainstorming

* remove getSnapshotBeforeUpdate from status

* remove componentWillUnmount from status

* persist last-intersected status update and restore when ScrollableList is restored

e.g. when navigating from home-timeline to a status conversational  thread and <Back again

* cache currently-viewing status id to avoid calling redux with identical value

* refactor collapse toggle to pass explicit boolean
2019-12-29 05:39:48 +01:00
Jeong Arm
76adde4fe2 Fix media open hotkey () 2019-12-05 00:50:51 +01:00
ThibG
a690b3e470 Add hotkey for opening media files ()
* [WiP] Add hotkey to open media

* Give focus to play/pause button when opening video modal
2019-11-29 17:02:35 +01:00
BSKY
fccf83e1f2 Add noopener and/or noreferrer () 2019-10-24 22:44:42 +02:00
Eugen Rochko
2e99e3cab3
Fix more visual issues with the audio player ()
* Fix more visual issues with the audio player

- Add horizontal baseline in the middle of waveform
- Fix audio player colors in light theme
- Use audio element instead of web audio API
- Do not render any bars until the file is loaded
- Do not allow interactions with waveform until the file is loaded

* Fix code style issue
2019-08-25 15:09:19 +02:00
Eugen Rochko
4190e31626
Add audio player () 2019-08-23 22:38:02 +02:00
ThibG
0d13a9cd13 Fix hidden statuses losing focus ()
Fixes 
2019-08-19 19:00:33 +02:00
Eugen Rochko
f7f23b4a19
Add audio uploads ()
* Add audio uploads

Fix 

Accept uploads of OGG, WAV, FLAC, OPUS and MP3 files, and converts
them to OGG. Media attachments get a new `audio` type. In the UI,
audio uploads are displayed identically to video uploads.

* Improve code style
2019-06-19 23:42:38 +02:00
ThibG
5bcd98172c Fix clicking on the left side of a conversation not marking it as read () 2019-06-10 19:27:10 +02:00
ThibG
e9ddd5a159 Put poll options behind content warnings ()
* Put poll options behind CWs in WebUI

* Put polls behind CWs on public pages

* Add poll icon to public pages CWs

* Revert to not showing an icon in the CW button
2019-06-08 17:40:59 +02:00
ThibG
3333250ede Fix React warning about legacy lifecycle calls and sensitive status resetting () 2019-05-29 17:33:15 +03:00
Takeshi Umeda
3b9c02506d Fix poll visibility on public pages ()
* Fix poll visibility on public pages

* Revert "Fix poll visibility on public pages"

This reverts commit 54a9608add6f855bc6337fe3c65eaee7ba13db49.

* Revert "Change poll options to alphabetic letters when status text is hidden"

This reverts commit c53d67326201b2061990b1874a3547c3647f50d2.
2019-05-26 23:13:29 +02:00
Neil Moore
63483ee543 Create new click handler for status__expand area in status ()
This click handler only activates on left-click, resolving .
This matches behavior in status_content.js, as added in 
2019-05-26 13:48:45 +02:00
Eugen Rochko
988342a56c
Fix null error in status component when determining showMedia state ()
* Fix null error in status component when determining showMedia state

Also update the showMedia value if the status passed to the
component changes

* Refactor media visibility computation into a defaultMediaVisibility function

* Fix default media visibility with reblogs
2019-05-26 13:48:16 +02:00
ThibG
a472190729 Add a keyboard shortcut to hide/show media ()
* Move control of media visibility to parent component

* Add keyboard shortcut to toggle media visibility
2019-05-25 23:20:51 +02:00
Eugen Rochko
6fe474837c
Change poll options to alphabetic letters when status text is hidden ()
Fix 
2019-05-18 14:41:16 +02:00
Neil Moore
4ab094d35e Adds click-able div that expands status () ()
The clickable div is positioned under the account avatar and covers
all empty space below it to the end of the status.
2019-05-15 06:53:23 +02:00
Eugen Rochko
fba96c808d
Add blurhash ()
* Add blurhash

* Use fallback color for spoiler when blurhash missing

* Federate the blurhash and accept it as long as it's at most 5x5

* Display unknown media attachments as blurhash placeholders

* Improve style of embed actions and spoiler button

* Change blurhash resolution from 3x3 to 4x4

* Improve dependency definitions

* Fix code style issues
2019-04-27 03:24:09 +02:00
ashleyhull-versent
2b68fe5442 tinyfix 2: unrequired arguments ()
* unrequired argument

* unrequired argument
2019-04-06 12:02:03 +09:00
Eugen Rochko
230a012f00
Add polls ()
* Add polls

Fix 

* Add tests

* Fixes

* Change API for creating polls

* Use name instead of content for votes

* Remove poll validation for remote polls

* Add polls to public pages

* When updating the poll, update options just in case they were changed

* Fix public pages showing both poll and other media
2019-03-03 22:18:23 +01:00
ThibG
8e7fc7ec73 Fix crash when conversations have no valid participants ()
* Never return empty participants for conversations

Fixes 

* Fix client-side crash when conversations have no participants
2019-02-19 20:00:41 +01:00
rinsuki
f9a338b473 Fix breaks when opening a reply tree in WebUI ()
fix 
2019-02-14 17:03:01 +01:00
ThibG
aee93bfc9c Fix timeline jumps ()
* Avoid two-step rendering of statuses as much as possible

Cache width shared by Video player, MediaGallery and Cards at the
ScrollableList level, pass it down through StatusList and Notifications.

* Adjust scroll when new preview cards appear

* Adjust scroll when statuses above the current scroll position are deleted
2019-02-11 13:19:59 +01:00
Eugen Rochko
1f95190202
Refactor icons in web UI to use Icon component ()
* Refactor uses of icons to an Icon component in web UI

* Refactor options passed to the Icon component

* Make tests work with absolute component paths
2019-02-01 00:14:05 +01:00
Eugen Rochko
bc642ac24b
Redesign public hashtag page to use a masonry layout () 2019-01-16 19:47:46 +01:00
Eugen Rochko
5cbf6cf3ec
Add "Show thread" link to self-replies ()
Fix 
2018-11-08 21:08:57 +01:00
Eugen Rochko
795f0107d2
Include preview cards in status entity in REST API ()
* Include preview cards in status entity in REST API

* Display preview card in-stream

* Improve in-stream display of preview cards
2018-10-28 06:35:03 +01:00
Eugen Rochko
eb1b9903a6
Redesign direct messages column () 2018-10-20 02:23:58 +02:00
Eugen Rochko
3d7f68c273
Revert Font Awesome 5 upgrade ()
* Revert "Fix some icon names changed by the Font Awesome 5. ()"

This reverts commit 3f9ec3de82.

* Revert "Migrate to font-awesome 5.0. ()"

This reverts commit 8bae14591b.

* Revert "Fix some icons names, unavailable in fontawesome5 (free license). ()"

This reverts commit b9c727a945.

* Revert "Update the icon name changed by the Font Awesome 5. ()"

This reverts commit 17af4d27da.

* Revert "Add bot icon to bot avatars and migrate to newer version of Font Awesome ()"

This reverts commit 4b794e134d.
2018-09-28 02:11:14 +02:00
Naoki Kosaka
8bae14591b Migrate to font-awesome 5.0. () 2018-09-27 17:08:56 +02:00
Haelwenn Monnier
15fc2b76f9 Show "read more" link on overly long in-stream statuses ()
Show "read more" link on overly long in-stream statuses
2018-09-27 17:04:33 +02:00
Yamagishi Kazutoshi
0ddbccf7e6 Upgrade Babel to version 7.0.0 () 2018-09-14 17:59:48 +02:00
Maciek Baron
2bbec9f4da Add CSS class to replies () 2018-08-27 13:07:47 -04:00
Eugen Rochko
a791bac153
Add aria-label to notifications ()
Fix 
2018-08-26 17:53:26 +02:00
M Somerville
ac092d03e7 Add missing video descriptions ()
* Pass through video description as necessary.

* Add title to video, matching aria-label.
2018-08-24 23:55:41 +02:00
Eugen Rochko
248df68c36
Give focused status a sensible aria-label for screen readers ()
* Give focused status a sensible aria-label for screen readers

Fix 

* Use content warning in aria-label unless expanded
2018-08-23 20:56:57 +02:00
M Somerville
298ee84488 Fix - Do not override ctrl/cmd+click. ()
This includes clicks on hashtags, mentions, display names and media in the
timeline; and usernames in reply-indicator, detailed status, and the boost
modal.
2018-08-18 12:50:32 +02:00
Eugen Rochko
cdb101340a
Keyword/phrase filtering ()
* Add keyword filtering

    GET|POST       /api/v1/filters
    GET|PUT|DELETE /api/v1/filters/:id

- Irreversible filters can drop toots from home or notifications
- Other filters can hide toots through the client app
- Filters use a phrase valid in particular contexts, expiration

* Make sure expired filters don't get applied client-side

* Add missing API methods

* Remove "regex filter" from column settings

* Add tests

* Add test for FeedManager

* Add CustomFilter test

* Add UI for managing filters

* Add streaming API event to allow syncing filters

* Fix tests
2018-06-29 15:34:36 +02:00
Yamagishi Kazutoshi
d9b2f84c92 Open video modal on public UI () 2018-05-13 13:48:14 +02:00
Yamagishi Kazutoshi
e0b1e17bd0 Show media modal on public timeline () 2018-05-08 13:33:09 +02:00
TakesxiSximada
23106844a1 Fix the hot key (j, k) does not function correctly when there is a pinned toot in account timeline. ()
* Fix the hot key (j, k) does not function correctly when there is a pinned toot in account timeline.

* Fix typo

* Add custom attribute prefix
2018-04-20 18:14:21 +02:00
Neil Moore
fad7b9f5f2 Adds keyboard hotkey for revealing/hiding statuses ()
Resolves 
2018-04-18 03:33:59 +02:00
Emelia Smith
904a2479dd Feature: Direct message from Statuses ()
* Fix: Switching between composing direct message and mention from menus

Previously clicking "direct message" followed by "mention" resulted in the composed status staying as "direct", along with weird spacing of items in the text area. This attempts to fix that.

* Fix: Add missing proptype check for onMention in Status component

* Add the ability to send a direct message to a user from the menu on Statuses

* Add space between "Embed" and "Mention" on expanded statuses menu
2018-04-09 17:09:11 +02:00
Eugen Rochko
b6003afcdb
Add show more/less toggle for entire threads in web UI ()
Fix 
2018-03-11 09:52:59 +01:00
Eugen Rochko
77406d3a09
Display AttachmentList in notifications () 2018-03-08 08:22:04 +01:00
Eugen Rochko
86a9de6753
Display AttachmentList in timelines in compact style when media missing () 2018-03-08 04:54:26 +01:00
Eugen Rochko
9110db41c5
Federate pinned statuses over ActivityPub ()
* Federate pinned statuses over ActivityPub

* Display pinned toots in web UI

Fix 

* Fix migration

* Fix tests

* Update outbox_serializer.rb

* Update remove_serializer.rb

* Update add_serializer.rb

* Update fetch_featured_collection_service.rb
2018-03-04 09:19:11 +01:00
Eugen Rochko
036dd98abb
Responsively enforce 16:9 ratio on all media thumbnails in web UI ()
* Responsively enforce 16:9 ratio on all media thumbnails in web UI

Also change video player behaviour to "contain" rather than
"cover" videos that don't fit the ratio, unlike images and GIFs,
it's expected that a video is shown fully.

* Fix spacing issues and remove floor

* Remove floor
2018-03-02 07:00:04 +01:00
Yamagishi Kazutoshi
0a103c7749 Upgrade ESLint to version 4.x () 2018-01-17 16:57:15 +01:00