From 5b929106647a6aac222c82ffe0d2c5c7bdf2d463 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sun, 2 Jun 2019 11:51:49 +0200 Subject: Fix expanding status from menu modal in glitch-soc Fixes #1085 --- app/javascript/flavours/glitch/components/status_action_bar.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/components/status_action_bar.js b/app/javascript/flavours/glitch/components/status_action_bar.js index 6d1f54c60..4c398fd19 100644 --- a/app/javascript/flavours/glitch/components/status_action_bar.js +++ b/app/javascript/flavours/glitch/components/status_action_bar.js @@ -151,8 +151,12 @@ export default class StatusActionBar extends ImmutablePureComponent { handleOpen = () => { let state = {...this.context.router.history.location.state}; - state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; - this.context.router.history.push(`/statuses/${this.props.status.get('id')}`, state); + if (state.mastodonModalOpen) { + this.context.router.history.replace(`/statuses/${this.props.status.get('id')}`, { mastodonBackSteps: (state.mastodonBackSteps || 0) + 1 }); + } else { + state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; + this.context.router.history.push(`/statuses/${this.props.status.get('id')}`, state); + } } handleEmbed = () => { -- cgit From 8eb7c3304ee1260de3e8e1d1f32bd67409488756 Mon Sep 17 00:00:00 2001 From: Jeong Arm Date: Mon, 3 Jun 2019 01:04:41 +0900 Subject: [Glitch] Fix profile picture preview Port e13e4b28db7e066d1f6f21e306aa95b97c3ccd99 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/styles/accounts.scss | 1 + 1 file changed, 1 insertion(+) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/styles/accounts.scss b/app/javascript/flavours/glitch/styles/accounts.scss index 57451c3a1..8b8c615ee 100644 --- a/app/javascript/flavours/glitch/styles/accounts.scss +++ b/app/javascript/flavours/glitch/styles/accounts.scss @@ -70,6 +70,7 @@ border-radius: 4px; @include avatar-radius(); background: darken($ui-base-color, 8%); + object-fit: cover; } } -- cgit From a7f6e72b307c2018ae1de3c301f8ac437b7bdfbe Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Thu, 6 Jun 2019 12:14:11 +0200 Subject: Fix CW field automatically getting the focus when it is always enabled --- .../flavours/glitch/features/compose/components/compose_form.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.js b/app/javascript/flavours/glitch/features/compose/components/compose_form.js index e8f000b1e..cc82a50d4 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.js @@ -323,6 +323,7 @@ class ComposeForm extends ImmutablePureComponent { searchTokens={[':']} id='glitch.composer.spoiler.input' className='spoiler-input__input' + autoFocus={false} /> -- cgit From 83600198961cce9bfe82cf0f0c33286703bc86d1 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Thu, 6 Jun 2019 13:34:33 +0200 Subject: Fix display of alt-text when a media attachment is not available --- app/javascript/flavours/glitch/styles/components/media.scss | 1 - 1 file changed, 1 deletion(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/styles/components/media.scss b/app/javascript/flavours/glitch/styles/components/media.scss index e5927057e..8b5d0486d 100644 --- a/app/javascript/flavours/glitch/styles/components/media.scss +++ b/app/javascript/flavours/glitch/styles/components/media.scss @@ -117,7 +117,6 @@ display: block; text-decoration: none; color: $secondary-text-color; - line-height: 0; position: relative; z-index: 1; -- cgit From 01aae33a5f6e69942da0a3028dded2621f1d4c81 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Fri, 7 Jun 2019 17:05:32 +0200 Subject: [Glitch] Fix refreshing featured toots when the new collection is empty Port d34a3a2cc72c12ae5119150a8ac18dd8fb7a4e6b to glitch-soc --- app/javascript/flavours/glitch/reducers/timelines.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/reducers/timelines.js b/app/javascript/flavours/glitch/reducers/timelines.js index cb233de1c..440b370e6 100644 --- a/app/javascript/flavours/glitch/reducers/timelines.js +++ b/app/javascript/flavours/glitch/reducers/timelines.js @@ -35,7 +35,9 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, is if (!next && !isLoadingRecent) mMap.set('hasMore', false); - if (!statuses.isEmpty()) { + if (timeline.endsWith(':pinned')) { + mMap.set('items', statuses.map(status => status.get('id'))); + } else if (!statuses.isEmpty()) { mMap.update('items', ImmutableList(), oldIds => { const newIds = statuses.map(status => status.get('id')); const lastIndex = oldIds.findLastIndex(id => id !== null && compareId(id, newIds.last()) >= 0) + 1; -- cgit From b32a62fe957c9c81e03ea3970705ff5eb46abf72 Mon Sep 17 00:00:00 2001 From: Jeong Arm Date: Wed, 5 Jun 2019 22:29:45 +0900 Subject: [Glitch] Scroll to compose form when focus Port 8f3c32e29cf13a84b2f0a58da0ab0c99a88caad5 to glitch-soc Signed-off-by: Thibaut Girka --- .../flavours/glitch/components/autosuggest_textarea.js | 5 ++++- .../glitch/features/compose/components/compose_form.js | 11 ++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/components/autosuggest_textarea.js b/app/javascript/flavours/glitch/components/autosuggest_textarea.js index e1ded2b3a..cf3907fbf 100644 --- a/app/javascript/flavours/glitch/components/autosuggest_textarea.js +++ b/app/javascript/flavours/glitch/components/autosuggest_textarea.js @@ -138,8 +138,11 @@ export default class AutosuggestTextarea extends ImmutablePureComponent { this.setState({ suggestionsHidden: true, focused: false }); } - onFocus = () => { + onFocus = (e) => { this.setState({ focused: true }); + if (this.props.onFocus) { + this.props.onFocus(e); + } } onSuggestionClick = (e) => { diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.js b/app/javascript/flavours/glitch/features/compose/components/compose_form.js index cc82a50d4..0120be28f 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.js @@ -28,6 +28,10 @@ const messages = defineMessages({ export default @injectIntl class ComposeForm extends ImmutablePureComponent { + setRef = c => { + this.composeForm = c; + }; + static contextTypes = { router: PropTypes.object, }; @@ -208,6 +212,10 @@ class ComposeForm extends ImmutablePureComponent { } } + handleFocus = () => { + this.composeForm.scrollIntoView(); + } + // This statement does several things: // - If we're beginning a reply, and, // - Replying to zero or one users, places the cursor at the end @@ -302,7 +310,7 @@ class ComposeForm extends ImmutablePureComponent { let disabledButton = isSubmitting || isUploading || isChangingUpload || (!text.trim().length && !anyMedia); return ( -
+
@@ -337,6 +345,7 @@ class ComposeForm extends ImmutablePureComponent { value={this.props.text} onChange={this.handleChange} suggestions={this.props.suggestions} + onFocus={this.handleFocus} onKeyDown={this.handleKeyDown} onSuggestionsFetchRequested={onFetchSuggestions} onSuggestionsClearRequested={onClearSuggestions} -- cgit From 417989ae34594df3d6ce720dfe70132158b6da28 Mon Sep 17 00:00:00 2001 From: ThibG Date: Thu, 6 Jun 2019 13:04:34 +0200 Subject: [Glitch] Fix “mark as sensitive” not being used in delete & redraft MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port 2657765d2a6804f34ce65bfdab7ec96f07d99732 to glitch-soc --- app/javascript/flavours/glitch/reducers/compose.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index 51a341c42..36dfb8f15 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -442,6 +442,7 @@ export default function compose(state = initialState, action) { map.set('focusDate', new Date()); map.set('caretPosition', null); map.set('idempotencyKey', uuid()); + map.set('sensitive', action.status.get('sensitive')); if (action.status.get('spoiler_text').length > 0) { map.set('spoiler', true); -- cgit From aec3fa35fda50e7f618dcf8b8f14e78a995583f4 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Thu, 6 Jun 2019 13:04:49 +0200 Subject: [Glitch] Fix not being able to directly switch between list timelines in web UI Port 5bfd802c571a2793bb59ba4540407a6147e82f88 to glitch-soc Signed-off-by: Thibaut Girka --- .../flavours/glitch/features/list_timeline/index.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/list_timeline/index.js b/app/javascript/flavours/glitch/features/list_timeline/index.js index ef829b937..0405073c5 100644 --- a/app/javascript/flavours/glitch/features/list_timeline/index.js +++ b/app/javascript/flavours/glitch/features/list_timeline/index.js @@ -75,6 +75,23 @@ export default class ListTimeline extends React.PureComponent { this.disconnect = dispatch(connectListStream(id)); } + componentWillReceiveProps (nextProps) { + const { dispatch } = this.props; + const { id } = nextProps.params; + + if (id !== this.props.params.id) { + if (this.disconnect) { + this.disconnect(); + this.disconnect = null; + } + + dispatch(fetchList(id)); + dispatch(expandListTimeline(id)); + + this.disconnect = dispatch(connectListStream(id)); + } + } + componentWillUnmount () { if (this.disconnect) { this.disconnect(); -- cgit