You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

495 lines
18 KiB

Summary: fix slowness due to layout thrashing when reloading a large … (#12661) * 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
4 years ago
Change IDs to strings rather than numbers in API JSON output (#5019) * Fix JavaScript interface with long IDs Somewhat predictably, the JS interface handled IDs as numbers, which in JS are IEEE double-precision floats. This loses some precision when working with numbers as large as those generated by the new ID scheme, so we instead handle them here as strings. This is relatively simple, and doesn't appear to have caused any problems, but should definitely be tested more thoroughly than the built-in tests. Several days of use appear to support this working properly. BREAKING CHANGE: The major(!) change here is that IDs are now returned as strings by the REST endpoints, rather than as integers. In practice, relatively few changes were required to make the existing JS UI work with this change, but it will likely hit API clients pretty hard: it's an entirely different type to consume. (The one API client I tested, Tusky, handles this with no problems, however.) Twitter ran into this issue when introducing Snowflake IDs, and decided to instead introduce an `id_str` field in JSON responses. I have opted to *not* do that, and instead force all IDs to 64-bit integers represented by strings in one go. (I believe Twitter exacerbated their problem by rolling out the changes three times: once for statuses, once for DMs, and once for user IDs, as well as by leaving an integer ID value in JSON. As they said, "If you’re using the `id` field with JSON in a Javascript-related language, there is a very high likelihood that the integers will be silently munged by Javascript interpreters. In most cases, this will result in behavior such as being unable to load or delete a specific direct message, because the ID you're sending to the API is different than the actual identifier associated with the message." [1]) However, given that this is a significant change for API users, alternatives or a transition time may be appropriate. 1: https://blog.twitter.com/developer/en_us/a/2011/direct-messages-going-snowflake-on-sep-30-2011.html * Additional fixes for stringified IDs in JSON These should be the last two. These were identified using eslint to try to identify any plain casts to JavaScript numbers. (Some such casts are legitimate, but these were not.) Adding the following to .eslintrc.yml will identify casts to numbers: ~~~ no-restricted-syntax: - warn - selector: UnaryExpression[operator='+'] > :not(Literal) message: Avoid the use of unary + - selector: CallExpression[callee.name='Number'] message: Casting with Number() may coerce string IDs to numbers ~~~ The remaining three casts appear legitimate: two casts to array indices, one in a server to turn an environment variable into a number. * Back out RelationshipsController Change This was made to make a test a bit less flakey, but has nothing to do with this branch. * Change internal streaming payloads to stringified IDs as well Per https://github.com/tootsuite/mastodon/pull/5019#issuecomment-330736452 we need these changes to send deleted status IDs as strings, not integers.
6 years ago
Summary: fix slowness due to layout thrashing when reloading a large … (#12661) * 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
4 years ago
7 years ago
7 years ago
  1. import React from 'react';
  2. import ImmutablePropTypes from 'react-immutable-proptypes';
  3. import PropTypes from 'prop-types';
  4. import Avatar from './avatar';
  5. import AvatarOverlay from './avatar_overlay';
  6. import AvatarComposite from './avatar_composite';
  7. import RelativeTimestamp from './relative_timestamp';
  8. import DisplayName from './display_name';
  9. import StatusContent from './status_content';
  10. import StatusActionBar from './status_action_bar';
  11. import AttachmentList from './attachment_list';
  12. import Card from '../features/status/components/card';
  13. import { injectIntl, defineMessages, FormattedMessage } from 'react-intl';
  14. import ImmutablePureComponent from 'react-immutable-pure-component';
  15. import { MediaGallery, Video, Audio } from '../features/ui/util/async-components';
  16. import { HotKeys } from 'react-hotkeys';
  17. import classNames from 'classnames';
  18. import Icon from 'mastodon/components/icon';
  19. import { displayMedia } from '../initial_state';
  20. import PictureInPicturePlaceholder from 'mastodon/components/picture_in_picture_placeholder';
  21. // We use the component (and not the container) since we do not want
  22. // to use the progress bar to show download progress
  23. import Bundle from '../features/ui/components/bundle';
  24. export const textForScreenReader = (intl, status, rebloggedByText = false) => {
  25. const displayName = status.getIn(['account', 'display_name']);
  26. const values = [
  27. displayName.length === 0 ? status.getIn(['account', 'acct']).split('@')[0] : displayName,
  28. status.get('spoiler_text') && status.get('hidden') ? status.get('spoiler_text') : status.get('search_index').slice(status.get('spoiler_text').length),
  29. intl.formatDate(status.get('created_at'), { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' }),
  30. status.getIn(['account', 'acct']),
  31. ];
  32. if (rebloggedByText) {
  33. values.push(rebloggedByText);
  34. }
  35. return values.join(', ');
  36. };
  37. export const defaultMediaVisibility = (status) => {
  38. if (!status) {
  39. return undefined;
  40. }
  41. if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') {
  42. status = status.get('reblog');
  43. }
  44. return (displayMedia !== 'hide_all' && !status.get('sensitive') || displayMedia === 'show_all');
  45. };
  46. const messages = defineMessages({
  47. public_short: { id: 'privacy.public.short', defaultMessage: 'Public' },
  48. unlisted_short: { id: 'privacy.unlisted.short', defaultMessage: 'Unlisted' },
  49. private_short: { id: 'privacy.private.short', defaultMessage: 'Followers-only' },
  50. direct_short: { id: 'privacy.direct.short', defaultMessage: 'Direct' },
  51. });
  52. export default @injectIntl
  53. class Status extends ImmutablePureComponent {
  54. static contextTypes = {
  55. router: PropTypes.object,
  56. };
  57. static propTypes = {
  58. status: ImmutablePropTypes.map,
  59. account: ImmutablePropTypes.map,
  60. otherAccounts: ImmutablePropTypes.list,
  61. onClick: PropTypes.func,
  62. onReply: PropTypes.func,
  63. onFavourite: PropTypes.func,
  64. onReblog: PropTypes.func,
  65. onDelete: PropTypes.func,
  66. onDirect: PropTypes.func,
  67. onMention: PropTypes.func,
  68. onPin: PropTypes.func,
  69. onOpenMedia: PropTypes.func,
  70. onOpenVideo: PropTypes.func,
  71. onBlock: PropTypes.func,
  72. onEmbed: PropTypes.func,
  73. onHeightChange: PropTypes.func,
  74. onToggleHidden: PropTypes.func,
  75. onToggleCollapsed: PropTypes.func,
  76. muted: PropTypes.bool,
  77. hidden: PropTypes.bool,
  78. unread: PropTypes.bool,
  79. onMoveUp: PropTypes.func,
  80. onMoveDown: PropTypes.func,
  81. showThread: PropTypes.bool,
  82. getScrollPosition: PropTypes.func,
  83. updateScrollBottom: PropTypes.func,
  84. cacheMediaWidth: PropTypes.func,
  85. cachedMediaWidth: PropTypes.number,
  86. scrollKey: PropTypes.string,
  87. deployPictureInPicture: PropTypes.func,
  88. pictureInPicture: ImmutablePropTypes.contains({
  89. inUse: PropTypes.bool,
  90. available: PropTypes.bool,
  91. }),
  92. };
  93. // Avoid checking props that are functions (and whose equality will always
  94. // evaluate to false. See react-immutable-pure-component for usage.
  95. updateOnProps = [
  96. 'status',
  97. 'account',
  98. 'muted',
  99. 'hidden',
  100. 'unread',
  101. 'pictureInPicture',
  102. ];
  103. state = {
  104. showMedia: defaultMediaVisibility(this.props.status),
  105. statusId: undefined,
  106. };
  107. static getDerivedStateFromProps(nextProps, prevState) {
  108. if (nextProps.status && nextProps.status.get('id') !== prevState.statusId) {
  109. return {
  110. showMedia: defaultMediaVisibility(nextProps.status),
  111. statusId: nextProps.status.get('id'),
  112. };
  113. } else {
  114. return null;
  115. }
  116. }
  117. handleToggleMediaVisibility = () => {
  118. this.setState({ showMedia: !this.state.showMedia });
  119. }
  120. handleClick = () => {
  121. if (this.props.onClick) {
  122. this.props.onClick();
  123. return;
  124. }
  125. if (!this.context.router) {
  126. return;
  127. }
  128. const { status } = this.props;
  129. this.context.router.history.push(`/statuses/${status.getIn(['reblog', 'id'], status.get('id'))}`);
  130. }
  131. handleExpandClick = (e) => {
  132. if (this.props.onClick) {
  133. this.props.onClick();
  134. return;
  135. }
  136. if (e.button === 0) {
  137. if (!this.context.router) {
  138. return;
  139. }
  140. const { status } = this.props;
  141. this.context.router.history.push(`/statuses/${status.getIn(['reblog', 'id'], status.get('id'))}`);
  142. }
  143. }
  144. handleAccountClick = (e) => {
  145. if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) {
  146. const id = e.currentTarget.getAttribute('data-id');
  147. e.preventDefault();
  148. this.context.router.history.push(`/accounts/${id}`);
  149. }
  150. }
  151. handleExpandedToggle = () => {
  152. this.props.onToggleHidden(this._properStatus());
  153. }
  154. handleCollapsedToggle = isCollapsed => {
  155. this.props.onToggleCollapsed(this._properStatus(), isCollapsed);
  156. }
  157. renderLoadingMediaGallery () {
  158. return <div className='media-gallery' style={{ height: '110px' }} />;
  159. }
  160. renderLoadingVideoPlayer () {
  161. return <div className='video-player' style={{ height: '110px' }} />;
  162. }
  163. renderLoadingAudioPlayer () {
  164. return <div className='audio-player' style={{ height: '110px' }} />;
  165. }
  166. handleOpenVideo = (options) => {
  167. const status = this._properStatus();
  168. this.props.onOpenVideo(status.get('id'), status.getIn(['media_attachments', 0]), options);
  169. }
  170. handleOpenMedia = (media, index) => {
  171. this.props.onOpenMedia(this._properStatus().get('id'), media, index);
  172. }
  173. handleHotkeyOpenMedia = e => {
  174. const { onOpenMedia, onOpenVideo } = this.props;
  175. const status = this._properStatus();
  176. e.preventDefault();
  177. if (status.get('media_attachments').size > 0) {
  178. if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
  179. onOpenVideo(status.get('id'), status.getIn(['media_attachments', 0]), { startTime: 0 });
  180. } else {
  181. onOpenMedia(status.get('id'), status.get('media_attachments'), 0);
  182. }
  183. }
  184. }
  185. handleDeployPictureInPicture = (type, mediaProps) => {
  186. const { deployPictureInPicture } = this.props;
  187. const status = this._properStatus();
  188. deployPictureInPicture(status, type, mediaProps);
  189. }
  190. handleHotkeyReply = e => {
  191. e.preventDefault();
  192. this.props.onReply(this._properStatus(), this.context.router.history);
  193. }
  194. handleHotkeyFavourite = () => {
  195. this.props.onFavourite(this._properStatus());
  196. }
  197. handleHotkeyBoost = e => {
  198. this.props.onReblog(this._properStatus(), e);
  199. }
  200. handleHotkeyMention = e => {
  201. e.preventDefault();
  202. this.props.onMention(this._properStatus().get('account'), this.context.router.history);
  203. }
  204. handleHotkeyOpen = () => {
  205. this.context.router.history.push(`/statuses/${this._properStatus().get('id')}`);
  206. }
  207. handleHotkeyOpenProfile = () => {
  208. this.context.router.history.push(`/accounts/${this._properStatus().getIn(['account', 'id'])}`);
  209. }
  210. handleHotkeyMoveUp = e => {
  211. this.props.onMoveUp(this.props.status.get('id'), e.target.getAttribute('data-featured'));
  212. }
  213. handleHotkeyMoveDown = e => {
  214. this.props.onMoveDown(this.props.status.get('id'), e.target.getAttribute('data-featured'));
  215. }
  216. handleHotkeyToggleHidden = () => {
  217. this.props.onToggleHidden(this._properStatus());
  218. }
  219. handleHotkeyToggleSensitive = () => {
  220. this.handleToggleMediaVisibility();
  221. }
  222. _properStatus () {
  223. const { status } = this.props;
  224. if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') {
  225. return status.get('reblog');
  226. } else {
  227. return status;
  228. }
  229. }
  230. handleRef = c => {
  231. this.node = c;
  232. }
  233. render () {
  234. let media = null;
  235. let statusAvatar, prepend, rebloggedByText;
  236. const { intl, hidden, featured, otherAccounts, unread, showThread, scrollKey, pictureInPicture } = this.props;
  237. let { status, account, ...other } = this.props;
  238. if (status === null) {
  239. return null;
  240. }
  241. const handlers = this.props.muted ? {} : {
  242. reply: this.handleHotkeyReply,
  243. favourite: this.handleHotkeyFavourite,
  244. boost: this.handleHotkeyBoost,
  245. mention: this.handleHotkeyMention,
  246. open: this.handleHotkeyOpen,
  247. openProfile: this.handleHotkeyOpenProfile,
  248. moveUp: this.handleHotkeyMoveUp,
  249. moveDown: this.handleHotkeyMoveDown,
  250. toggleHidden: this.handleHotkeyToggleHidden,
  251. toggleSensitive: this.handleHotkeyToggleSensitive,
  252. openMedia: this.handleHotkeyOpenMedia,
  253. };
  254. if (hidden) {
  255. return (
  256. <HotKeys handlers={handlers}>
  257. <div ref={this.handleRef} className={classNames('status__wrapper', { focusable: !this.props.muted })} tabIndex='0'>
  258. <span>{status.getIn(['account', 'display_name']) || status.getIn(['account', 'username'])}</span>
  259. <span>{status.get('content')}</span>
  260. </div>
  261. </HotKeys>
  262. );
  263. }
  264. if (status.get('filtered') || status.getIn(['reblog', 'filtered'])) {
  265. const minHandlers = this.props.muted ? {} : {
  266. moveUp: this.handleHotkeyMoveUp,
  267. moveDown: this.handleHotkeyMoveDown,
  268. };
  269. return (
  270. <HotKeys handlers={minHandlers}>
  271. <div className='status__wrapper status__wrapper--filtered focusable' tabIndex='0' ref={this.handleRef}>
  272. <FormattedMessage id='status.filtered' defaultMessage='Filtered' />
  273. </div>
  274. </HotKeys>
  275. );
  276. }
  277. if (featured) {
  278. prepend = (
  279. <div className='status__prepend'>
  280. <div className='status__prepend-icon-wrapper'><Icon id='thumb-tack' className='status__prepend-icon' fixedWidth /></div>
  281. <FormattedMessage id='status.pinned' defaultMessage='Pinned toot' />
  282. </div>
  283. );
  284. } else if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') {
  285. const display_name_html = { __html: status.getIn(['account', 'display_name_html']) };
  286. prepend = (
  287. <div className='status__prepend'>
  288. <div className='status__prepend-icon-wrapper'><Icon id='retweet' className='status__prepend-icon' fixedWidth /></div>
  289. <FormattedMessage id='status.reblogged_by' defaultMessage='{name} boosted' values={{ name: <a onClick={this.handleAccountClick} data-id={status.getIn(['account', 'id'])} href={status.getIn(['account', 'url'])} className='status__display-name muted'><bdi><strong dangerouslySetInnerHTML={display_name_html} /></bdi></a> }} />
  290. </div>
  291. );
  292. rebloggedByText = intl.formatMessage({ id: 'status.reblogged_by', defaultMessage: '{name} boosted' }, { name: status.getIn(['account', 'acct']) });
  293. account = status.get('account');
  294. status = status.get('reblog');
  295. }
  296. if (pictureInPicture.get('inUse')) {
  297. media = <PictureInPicturePlaceholder width={this.props.cachedMediaWidth} />;
  298. } else if (status.get('media_attachments').size > 0) {
  299. if (this.props.muted) {
  300. media = (
  301. <AttachmentList
  302. compact
  303. media={status.get('media_attachments')}
  304. />
  305. );
  306. } else if (status.getIn(['media_attachments', 0, 'type']) === 'audio') {
  307. const attachment = status.getIn(['media_attachments', 0]);
  308. media = (
  309. <Bundle fetchComponent={Audio} loading={this.renderLoadingAudioPlayer} >
  310. {Component => (
  311. <Component
  312. src={attachment.get('url')}
  313. alt={attachment.get('description')}
  314. poster={attachment.get('preview_url') || status.getIn(['account', 'avatar_static'])}
  315. backgroundColor={attachment.getIn(['meta', 'colors', 'background'])}
  316. foregroundColor={attachment.getIn(['meta', 'colors', 'foreground'])}
  317. accentColor={attachment.getIn(['meta', 'colors', 'accent'])}
  318. duration={attachment.getIn(['meta', 'original', 'duration'], 0)}
  319. width={this.props.cachedMediaWidth}
  320. height={110}
  321. cacheWidth={this.props.cacheMediaWidth}
  322. deployPictureInPicture={pictureInPicture.get('available') ? this.handleDeployPictureInPicture : undefined}
  323. />
  324. )}
  325. </Bundle>
  326. );
  327. } else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
  328. const attachment = status.getIn(['media_attachments', 0]);
  329. media = (
  330. <Bundle fetchComponent={Video} loading={this.renderLoadingVideoPlayer} >
  331. {Component => (
  332. <Component
  333. preview={attachment.get('preview_url')}
  334. frameRate={attachment.getIn(['meta', 'original', 'frame_rate'])}
  335. blurhash={attachment.get('blurhash')}
  336. src={attachment.get('url')}
  337. alt={attachment.get('description')}
  338. width={this.props.cachedMediaWidth}
  339. height={110}
  340. inline
  341. sensitive={status.get('sensitive')}
  342. onOpenVideo={this.handleOpenVideo}
  343. cacheWidth={this.props.cacheMediaWidth}
  344. deployPictureInPicture={pictureInPicture.get('available') ? this.handleDeployPictureInPicture : undefined}
  345. visible={this.state.showMedia}
  346. onToggleVisibility={this.handleToggleMediaVisibility}
  347. />
  348. )}
  349. </Bundle>
  350. );
  351. } else {
  352. media = (
  353. <Bundle fetchComponent={MediaGallery} loading={this.renderLoadingMediaGallery}>
  354. {Component => (
  355. <Component
  356. media={status.get('media_attachments')}
  357. sensitive={status.get('sensitive')}
  358. height={110}
  359. onOpenMedia={this.handleOpenMedia}
  360. cacheWidth={this.props.cacheMediaWidth}
  361. defaultWidth={this.props.cachedMediaWidth}
  362. visible={this.state.showMedia}
  363. onToggleVisibility={this.handleToggleMediaVisibility}
  364. />
  365. )}
  366. </Bundle>
  367. );
  368. }
  369. } else if (status.get('spoiler_text').length === 0 && status.get('card')) {
  370. media = (
  371. <Card
  372. onOpenMedia={this.handleOpenMedia}
  373. card={status.get('card')}
  374. compact
  375. cacheWidth={this.props.cacheMediaWidth}
  376. defaultWidth={this.props.cachedMediaWidth}
  377. sensitive={status.get('sensitive')}
  378. />
  379. );
  380. }
  381. if (otherAccounts && otherAccounts.size > 0) {
  382. statusAvatar = <AvatarComposite accounts={otherAccounts} size={48} />;
  383. } else if (account === undefined || account === null) {
  384. statusAvatar = <Avatar account={status.get('account')} size={48} />;
  385. } else {
  386. statusAvatar = <AvatarOverlay account={status.get('account')} friend={account} />;
  387. }
  388. const visibilityIconInfo = {
  389. 'public': { icon: 'globe', text: intl.formatMessage(messages.public_short) },
  390. 'unlisted': { icon: 'unlock', text: intl.formatMessage(messages.unlisted_short) },
  391. 'private': { icon: 'lock', text: intl.formatMessage(messages.private_short) },
  392. 'direct': { icon: 'envelope', text: intl.formatMessage(messages.direct_short) },
  393. };
  394. const visibilityIcon = visibilityIconInfo[status.get('visibility')];
  395. return (
  396. <HotKeys handlers={handlers}>
  397. <div className={classNames('status__wrapper', `status__wrapper-${status.get('visibility')}`, { 'status__wrapper-reply': !!status.get('in_reply_to_id'), unread, focusable: !this.props.muted })} tabIndex={this.props.muted ? null : 0} data-featured={featured ? 'true' : null} aria-label={textForScreenReader(intl, status, rebloggedByText)} ref={this.handleRef}>
  398. {prepend}
  399. <div className={classNames('status', `status-${status.get('visibility')}`, { 'status-reply': !!status.get('in_reply_to_id'), muted: this.props.muted })} data-id={status.get('id')}>
  400. <div className='status__expand' onClick={this.handleExpandClick} role='presentation' />
  401. <div className='status__info'>
  402. <a href={status.get('url')} className='status__relative-time' target='_blank' rel='noopener noreferrer'>
  403. <span className='status__visibility-icon'><Icon id={visibilityIcon.icon} title={visibilityIcon.text} /></span>
  404. <RelativeTimestamp timestamp={status.get('created_at')} />
  405. </a>
  406. <a onClick={this.handleAccountClick} data-id={status.getIn(['account', 'id'])} href={status.getIn(['account', 'url'])} title={status.getIn(['account', 'acct'])} className='status__display-name' target='_blank' rel='noopener noreferrer'>
  407. <div className='status__avatar'>
  408. {statusAvatar}
  409. </div>
  410. <DisplayName account={status.get('account')} others={otherAccounts} />
  411. </a>
  412. </div>
  413. <StatusContent status={status} onClick={this.handleClick} expanded={!status.get('hidden')} showThread={showThread} onExpandedToggle={this.handleExpandedToggle} collapsable onCollapsedToggle={this.handleCollapsedToggle} />
  414. {media}
  415. <StatusActionBar scrollKey={scrollKey} status={status} account={account} {...other} />
  416. </div>
  417. </div>
  418. </HotKeys>
  419. );
  420. }
  421. }