debug info in threads

This commit is contained in:
Baptiste Lemoine 2019-12-22 18:30:22 +01:00
parent a572fd707a
commit 0b5c3dba2a
8 changed files with 88 additions and 50 deletions

View File

@ -82,11 +82,15 @@ class Status extends ImmutablePureComponent {
onMoveUp : PropTypes.func, onMoveUp : PropTypes.func,
onMoveDown : PropTypes.func, onMoveDown : PropTypes.func,
showThread : PropTypes.bool, showThread : PropTypes.bool,
threadsCompile : PropTypes.bool,
getScrollPosition : PropTypes.func, getScrollPosition : PropTypes.func,
updateScrollBottom: PropTypes.func, updateScrollBottom: PropTypes.func,
cacheMediaWidth : PropTypes.func, cacheMediaWidth : PropTypes.func,
cachedMediaWidth : PropTypes.number, cachedMediaWidth : PropTypes.number,
}; };
static defaultProps = {
threadsCompile: true,
};
// Avoid checking props that are functions (and whose equality will always // Avoid checking props that are functions (and whose equality will always
// evaluate to false. See react-immutable-pure-component for usage. // evaluate to false. See react-immutable-pure-component for usage.
@ -199,24 +203,24 @@ class Status extends ImmutablePureComponent {
}; };
renderLoadingMediaGallery() { renderLoadingMediaGallery() {
return <div return (<div
className='media-gallery' className='media-gallery'
style={{ height: '110px' }} style={{ height: '110px' }}
/>; />);
} }
renderLoadingVideoPlayer() { renderLoadingVideoPlayer() {
return <div return (<div
className='video-player' className='video-player'
style={{ height: '110px' }} style={{ height: '110px' }}
/>; />);
} }
renderLoadingAudioPlayer() { renderLoadingAudioPlayer() {
return <div return (<div
className='audio-player' className='audio-player'
style={{ height: '110px' }} style={{ height: '110px' }}
/>; />);
} }
handleOpenVideo = (media, startTime) => { handleOpenVideo = (media, startTime) => {
@ -308,6 +312,8 @@ class Status extends ImmutablePureComponent {
return null; return null;
} }
const moreStatusCount = this.props.status.replies;
const handlers = this.props.muted ? {} : { const handlers = this.props.muted ? {} : {
reply : this.handleHotkeyReply, reply : this.handleHotkeyReply,
favourite : this.handleHotkeyFavourite, favourite : this.handleHotkeyFavourite,
@ -497,20 +503,20 @@ class Status extends ImmutablePureComponent {
} }
if (otherAccounts && otherAccounts.size > 0) { if (otherAccounts && otherAccounts.size > 0) {
statusAvatar = <AvatarComposite statusAvatar = (<AvatarComposite
accounts={otherAccounts} accounts={otherAccounts}
size={48} size={48}
/>; />);
} else if (account === undefined || account === null) { } else if (account === undefined || account === null) {
statusAvatar = <Avatar statusAvatar = (<Avatar
account={status.get('account')} account={status.get('account')}
size={48} size={48}
/>; />);
} else { } else {
statusAvatar = <AvatarOverlay statusAvatar = (<AvatarOverlay
account={status.get('account')} account={status.get('account')}
friend={account} friend={account}
/>; />);
} }
return ( return (
@ -545,7 +551,7 @@ class Status extends ImmutablePureComponent {
{isStaff && (<div className='administrate-stuff pull-left'> {isStaff && (<div className='administrate-stuff pull-left'>
<i className='fa fa-gears'></i > <i className='fa fa-gears' />
</div > </div >
)} )}
<a <a
@ -601,10 +607,19 @@ class Status extends ImmutablePureComponent {
/> />
</button > </button >
)} )}
<div className='well'>
{status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) &&
<p > oui je cause tout seul, c'est un thread</p >
}
{this.props.threadsCompile &&
<p > les threads sont en mode compilés</p >
}
</div >
<StatusActionBar <StatusActionBar
status={status} status={status}
account={account} {...other} /> account={account} {...other}
/>
</div > </div >
</div > </div >
</HotKeys > </HotKeys >

View File

@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes'; import ImmutablePropTypes from 'react-immutable-proptypes';
import LoadingIndicator from '../../components/loading_indicator'; import LoadingIndicator from '../../components/loading_indicator';
import { fetchReblogs } from '../../actions/interactions'; import { fetchReblogs } from '../../actions/interactions';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import { defineMessages, FormattedMessage, injectIntl } from 'react-intl';
import AccountContainer from '../../containers/account_container'; import AccountContainer from '../../containers/account_container';
import Column from '../ui/components/column'; import Column from '../ui/components/column';
import ScrollableList from '../../components/scrollable_list'; import ScrollableList from '../../components/scrollable_list';
@ -25,15 +25,15 @@ export default @connect(mapStateToProps)
class Reblogs extends ImmutablePureComponent { class Reblogs extends ImmutablePureComponent {
static propTypes = { static propTypes = {
params: PropTypes.object.isRequired, params : PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired, dispatch : PropTypes.func.isRequired,
shouldUpdateScroll: PropTypes.func, shouldUpdateScroll: PropTypes.func,
accountIds: ImmutablePropTypes.list, accountIds : ImmutablePropTypes.list,
multiColumn: PropTypes.bool, multiColumn : PropTypes.bool,
intl: PropTypes.object.isRequired, intl : PropTypes.object.isRequired,
}; };
componentWillMount () { componentWillMount() {
if (!this.props.accountIds) { if (!this.props.accountIds) {
this.props.dispatch(fetchReblogs(this.props.params.statusId)); this.props.dispatch(fetchReblogs(this.props.params.statusId));
} }
@ -47,20 +47,23 @@ class Reblogs extends ImmutablePureComponent {
handleRefresh = () => { handleRefresh = () => {
this.props.dispatch(fetchReblogs(this.props.params.statusId)); this.props.dispatch(fetchReblogs(this.props.params.statusId));
} };
render () { render() {
const { intl, shouldUpdateScroll, accountIds, multiColumn } = this.props; const { intl, shouldUpdateScroll, accountIds, multiColumn } = this.props;
if (!accountIds) { if (!accountIds) {
return ( return (
<Column> <Column >
<LoadingIndicator /> <LoadingIndicator />
</Column> </Column >
); );
} }
const emptyMessage = <FormattedMessage id='status.reblogs.empty' defaultMessage='No one has boosted this toot yet. When someone does, they will show up here.' />; const emptyMessage = (<FormattedMessage
id='status.reblogs.empty'
defaultMessage='No one has boosted this toot yet. When someone does, they will show up here.'
/>);
return ( return (
<Column bindToDocument={!multiColumn}> <Column bindToDocument={!multiColumn}>
@ -68,7 +71,12 @@ class Reblogs extends ImmutablePureComponent {
showBackButton showBackButton
multiColumn={multiColumn} multiColumn={multiColumn}
extraButton={( extraButton={(
<button className='column-header__button' title={intl.formatMessage(messages.refresh)} aria-label={intl.formatMessage(messages.refresh)} onClick={this.handleRefresh}><Icon id='refresh' /></button> <button
className='column-header__button'
title={intl.formatMessage(messages.refresh)}
aria-label={intl.formatMessage(messages.refresh)}
onClick={this.handleRefresh}
><Icon id='refresh' /></button >
)} )}
/> />
@ -79,10 +87,14 @@ class Reblogs extends ImmutablePureComponent {
bindToDocument={!multiColumn} bindToDocument={!multiColumn}
> >
{accountIds.map(id => {accountIds.map(id =>
<AccountContainer key={id} id={id} withNote={false} /> (<AccountContainer
key={id}
id={id}
withNote={false}
/>),
)} )}
</ScrollableList> </ScrollableList >
</Column> </Column >
); );
} }

View File

@ -551,8 +551,9 @@ class Status extends ImmutablePureComponent {
className={classNames('scrollable', { fullscreen })} className={classNames('scrollable', { fullscreen })}
ref={this.setRef} ref={this.setRef}
> >
<h2 className='debug'>ancestors:</h2 >
{ancestors} {ancestors}
<h2 className='debug'>common:</h2 >
<HotKeys handlers={handlers}> <HotKeys handlers={handlers}>
<div <div
className={classNames('focusable', 'detailed-status__wrapper')} className={classNames('focusable', 'detailed-status__wrapper')}
@ -591,7 +592,7 @@ class Status extends ImmutablePureComponent {
/> />
</div > </div >
</HotKeys > </HotKeys >
<h2 className='debug'>Descendants:</h2 >
{descendants} {descendants}
</div > </div >
</ScrollContainer > </ScrollContainer >

View File

@ -1,6 +1,6 @@
import React from 'react'; import React from 'react';
export default class ConversationStream extends React.PureComponent { export default class Conversation extends React.PureComponent {
following = []; following = [];

View File

@ -52,7 +52,7 @@ export default class Messaging extends React.PureComponent {
<div > <div >
messagerie todo messagerie todo
{/*<Conversations />*/} {/*<Conversation />*/}
<ContactsList /> <ContactsList />
</div > </div >
); );

View File

@ -1,21 +1,16 @@
import { import {
REBLOG_REQUEST,
REBLOG_FAIL,
FAVOURITE_REQUEST,
FAVOURITE_FAIL,
UNFAVOURITE_SUCCESS,
BOOKMARK_REQUEST,
BOOKMARK_FAIL, BOOKMARK_FAIL,
BOOKMARK_REQUEST,
FAVOURITE_FAIL,
FAVOURITE_REQUEST,
REBLOG_FAIL,
REBLOG_REQUEST,
UNFAVOURITE_SUCCESS,
} from '../actions/interactions'; } from '../actions/interactions';
import { import { STATUS_HIDE, STATUS_MUTE_SUCCESS, STATUS_REVEAL, STATUS_UNMUTE_SUCCESS } from '../actions/statuses';
STATUS_MUTE_SUCCESS,
STATUS_UNMUTE_SUCCESS,
STATUS_REVEAL,
STATUS_HIDE,
} from '../actions/statuses';
import { TIMELINE_DELETE } from '../actions/timelines'; import { TIMELINE_DELETE } from '../actions/timelines';
import { STATUS_IMPORT, STATUSES_IMPORT } from '../actions/importer'; import { STATUS_IMPORT, STATUSES_IMPORT } from '../actions/importer';
import { Map as ImmutableMap, fromJS } from 'immutable'; import { fromJS, Map as ImmutableMap } from 'immutable';
const importStatus = (state, status) => state.set(status.id, fromJS(status)); const importStatus = (state, status) => state.set(status.id, fromJS(status));
@ -33,7 +28,7 @@ const deleteStatus = (state, id, references) => {
const initialState = ImmutableMap(); const initialState = ImmutableMap();
export default function statuses(state = initialState, action) { export default function statuses(state = initialState, action) {
switch(action.type) { switch (action.type) {
case STATUS_IMPORT: case STATUS_IMPORT:
return importStatus(state, action.status); return importStatus(state, action.status);
case STATUSES_IMPORT: case STATUSES_IMPORT:

View File

@ -14,16 +14,23 @@ $messagingBoxHeight: 20em;
right: 1em; right: 1em;
width: $messagingBoxWidth; width: $messagingBoxWidth;
background: $ui-base-color; background: $ui-base-color;
.messager-textarea {
width: 100%;
}
} }
.conversations_list { .conversations_list {
}
.conversation-item {
@extend .fixed-box; @extend .fixed-box;
width: $messagingBoxWidth; width: $messagingBoxWidth;
right: $messagingBoxWidth + 5em; right: $messagingBoxWidth + 5em;
background: $ui-secondary-color; background: $ui-secondary-color;
}
.conversation-item {
&.has-new-message { &.has-new-message {
background: $ui-highlight-color; background: $ui-highlight-color;
color: $classic-primary-color; color: $classic-primary-color;

View File

@ -28,3 +28,11 @@ $media-modal-media-max-height: 80%;
// then we import the rest of the world // then we import the rest of the world
@import 'application'; @import 'application';
@import 'bliss/messaging'; @import 'bliss/messaging';
.debug, .well {
padding: 0.5rem;
border: solid 1px greenyellow;
background: yellow;
color: #222;
}