Skip to content

Commit

Permalink
Remove status background feature (#2640)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored Dec 10, 2024
1 parent ec9f360 commit 28751ff
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 65 deletions.
19 changes: 1 addition & 18 deletions app/javascript/flavours/glitch/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ class Status extends ImmutablePureComponent {
...other
} = this.props;
const { isCollapsed } = this.state;
let background = null;
let attachments = null;

// Depending on user settings, some media are considered as parts of the
Expand Down Expand Up @@ -622,21 +621,10 @@ class Status extends ImmutablePureComponent {
);
}

// If user backgrounds for collapsed statuses are enabled, then we
// initialize our background accordingly. This will only be rendered if
// the status is collapsed.
if (settings.getIn(['collapsed', 'backgrounds', 'user_backgrounds'])) {
background = status.getIn(['account', 'header']);
}

// This handles our media attachments.
// If a media file is of unknwon type or if the status is muted
// (notification), we show a list of links instead of embedded media.

// After we have generated our appropriate media element and stored it in
// `media`, we snatch the thumbnail to use as our `background` if media
// backgrounds for collapsed statuses are enabled.

attachments = status.get('media_attachments');

if (pictureInPicture.get('inUse')) {
Expand Down Expand Up @@ -729,10 +717,6 @@ class Status extends ImmutablePureComponent {
);
mediaIcons.push('video-camera');
}

if (!status.get('sensitive') && !(status.get('spoiler_text').length > 0) && settings.getIn(['collapsed', 'backgrounds', 'preview_images'])) {
background = attachments.getIn([0, 'preview_url']);
}
} else if (status.get('card') && settings.get('inline_preview_cards') && !this.props.muted) {
media.push(
<Card
Expand Down Expand Up @@ -803,9 +787,8 @@ class Status extends ImmutablePureComponent {
{!skipPrepend && prepend}

<div
className={classNames('status', `status-${status.get('visibility')}`, { 'status-reply': !!status.get('in_reply_to_id'), 'status--in-thread': !!rootId, 'status--first-in-thread': previousId && (!connectUp || connectToRoot), muted: this.props.muted, 'has-background': isCollapsed && background })}
className={classNames('status', `status-${status.get('visibility')}`, { 'status-reply': !!status.get('in_reply_to_id'), 'status--in-thread': !!rootId, 'status--first-in-thread': previousId && (!connectUp || connectToRoot), muted: this.props.muted })}
data-id={status.get('id')}
style={isCollapsed && background ? { backgroundImage: `url(${background})` } : null}
>
{(connectReply || connectUp || connectToRoot) && <div className={classNames('status__line', { 'status__line--full': connectReply, 'status__line--first': !status.get('in_reply_to_id') && !connectToRoot })} />}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,28 +415,6 @@ class LocalSettingsPage extends PureComponent {
<FormattedMessage id='settings.auto_collapse_height' defaultMessage='Height (in pixels) for a toot to be considered lengthy' />
</LocalSettingsPageItem>
</section>
<section>
<h2><FormattedMessage id='settings.image_backgrounds' defaultMessage='Image backgrounds' /></h2>
<LocalSettingsPageItem
settings={settings}
item={['collapsed', 'backgrounds', 'user_backgrounds']}
id='mastodon-settings--collapsed-user-backgrouns'
onChange={onChange}
dependsOn={[['collapsed', 'enabled']]}
>
<FormattedMessage id='settings.image_backgrounds_users' defaultMessage='Give collapsed toots an image background' />
</LocalSettingsPageItem>
<LocalSettingsPageItem
settings={settings}
item={['collapsed', 'backgrounds', 'preview_images']}
id='mastodon-settings--collapsed-preview-images'
onChange={onChange}
dependsOn={[['collapsed', 'enabled']]}
>
<FormattedMessage id='settings.image_backgrounds_media' defaultMessage='Preview collapsed toot media' />
<span className='hint'><FormattedMessage id='settings.image_backgrounds_media_hint' defaultMessage='If the post has any media attachment, use the first one as a background' /></span>
</LocalSettingsPageItem>
</section>
</div>
),
({ intl, onChange, settings }) => (
Expand Down
4 changes: 0 additions & 4 deletions app/javascript/flavours/glitch/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@
"settings.general": "General",
"settings.hicolor_privacy_icons": "High color privacy icons",
"settings.hicolor_privacy_icons.hint": "Display privacy icons in bright and easily distinguishable colors",
"settings.image_backgrounds": "Image backgrounds",
"settings.image_backgrounds_media": "Preview collapsed toot media",
"settings.image_backgrounds_media_hint": "If the post has any media attachment, use the first one as a background",
"settings.image_backgrounds_users": "Give collapsed toots an image background",
"settings.inline_preview_cards": "Inline preview cards for external links",
"settings.layout_opts": "Layout options",
"settings.media": "Media",
Expand Down
4 changes: 0 additions & 4 deletions app/javascript/flavours/glitch/reducers/local_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@ const initialState = ImmutableMap({
media : false,
height : 400,
}),
backgrounds : ImmutableMap({
user_backgrounds : false,
preview_images : false,
}),
show_action_bar : true,
}),
media : ImmutableMap({
Expand Down
17 changes: 0 additions & 17 deletions app/javascript/flavours/glitch/styles/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1561,23 +1561,6 @@ body > [data-popper-placement] {
min-height: 0;
}

&.has-background::before {
display: block;
position: absolute;
inset-inline-start: 0;
inset-inline-end: 0;
top: 0;
bottom: 0;
background-image: linear-gradient(
to bottom,
rgba($base-shadow-color, 0.75),
rgba($base-shadow-color, 0.65) 24px,
rgba($base-shadow-color, 0.8)
);
pointer-events: none;
content: '';
}

.display-name:hover .display-name__html {
text-decoration: none;
}
Expand Down

0 comments on commit 28751ff

Please sign in to comment.