Remove the redesign-status feature flag (#40799)

This commit is contained in:
Renaud Chaput
2026-10-01 13:24:04 +00:00
committed by GitHub
parent 7c8e89807f
commit 0ed49ddccd
9 changed files with 18 additions and 27 deletions

View File

@@ -5,7 +5,7 @@ import { FormattedMessage, useIntl } from 'react-intl';
import classNames from 'classnames';
import { useSelectableClick } from '@/mastodon/hooks/useSelectableClick';
import { isRedesignStatusEnabled } from '@/mastodon/utils/environment';
import { isRedesignEnabled } from '@/mastodon/utils/environment';
import CloseIcon from '@/material-icons/400-24px/close.svg?react';
import { Button } from '../button/redesign';
@@ -42,7 +42,7 @@ export const AltTextBadge: React.FC<{
const [handleMouseDown, handleMouseUp] = useSelectableClick(handleClose);
const ButtonComp = isRedesignStatusEnabled() ? Button : 'button';
const ButtonComp = isRedesignEnabled() ? Button : 'button';
return (
<>
@@ -73,7 +73,7 @@ export const AltTextBadge: React.FC<{
className={classNames(
'info-tooltip',
'dropdown-animation',
isRedesignStatusEnabled() && classes.redesignPopover,
isRedesignEnabled() && classes.redesignPopover,
)}
role='dialog'
aria-labelledby={titleId}

View File

@@ -16,7 +16,7 @@ import { SpoilerButton } from 'mastodon/components/spoiler_button';
import { formatTime } from 'mastodon/features/video';
import { autoPlayGif, displayMedia, useBlurhash } from '../initial_state';
import { isRedesignStatusEnabled } from '../utils/environment';
import { isRedesignEnabled } from '../utils/environment';
import { Button } from './button/redesign';
class Item extends PureComponent {
@@ -322,7 +322,7 @@ class MediaGallery extends PureComponent {
children = media.map((attachment, i) => <Item key={attachment.get('id')} autoplay={autoplay} onClick={this.handleClick} attachment={attachment} index={i} lang={lang} size={size} displayWidth={width} visible={visible || uncached} />);
}
const ButtonComp = isRedesignStatusEnabled() ? Button : 'button';
const ButtonComp = isRedesignEnabled() ? Button : 'button';
return (
<div className={`media-gallery media-gallery--layout-${size}`} style={style} ref={this.handleRef}>

View File

@@ -6,7 +6,7 @@ import { Link } from 'react-router-dom';
import type { ApiMentionJSON } from '@/mastodon/api_types/statuses';
import { getCollectionPath } from '@/mastodon/features/collections/utils';
import { isRedesignStatusEnabled } from '@/mastodon/utils/environment';
import { isRedesignEnabled } from '@/mastodon/utils/environment';
import type { OnElementHandler } from '@/mastodon/utils/html';
import { HashtagMenu } from '../hashtag_menu';
@@ -44,7 +44,7 @@ export const HandledLink: FC<HandledLinkProps & ComponentProps<'a'>> = ({
) {
const hashtag = text.slice(1).trim();
if (isRedesignStatusEnabled()) {
if (isRedesignEnabled()) {
return (
<HashtagMenu tagId={hashtag} accountId={hashtagAccountId}>
<MenuTrigger as='button' className={classes.hashtag}>

View File

@@ -1,6 +1,6 @@
import { lazy, Suspense } from 'react';
import { isRedesignStatusEnabled } from '@/mastodon/utils/environment';
import { isRedesignEnabled } from '@/mastodon/utils/environment';
import { LoadingIndicator } from '../loading_indicator';
@@ -19,6 +19,4 @@ const StatusRedesign = (props: StatusContainerProps) => (
</Suspense>
);
export const Status = isRedesignStatusEnabled()
? StatusRedesign
: StatusQuoteManager;
export const Status = isRedesignEnabled() ? StatusRedesign : StatusQuoteManager;

View File

@@ -27,7 +27,7 @@ import { getAccountHidden } from 'mastodon/selectors/accounts';
import type { RootState } from 'mastodon/store';
import { useAppDispatch, useAppSelector } from 'mastodon/store';
import { isRedesignStatusEnabled } from '../../../utils/environment';
import { isRedesignEnabled } from '../../../utils/environment';
import { Button } from '../../button';
import { IconButton } from '../../icon_button';
import { LoadingIndicator } from '../../loading_indicator';
@@ -396,7 +396,7 @@ export const StatusQuoteManager = (props: StatusQuoteManagerProps) => {
});
const quote = status?.get('quote') as QuoteMap | undefined;
if (isRedesignStatusEnabled()) {
if (isRedesignEnabled()) {
return (
<Suspense fallback={<LoadingIndicator />}>
<LazyStatusRedesign {...props} />

View File

@@ -3,10 +3,7 @@ import { useMemo } from 'react';
import classNames from 'classnames';
import { LinkedDisplayName } from '@/mastodon/components/display_name';
import {
isRedesignEnabled,
isRedesignStatusEnabled,
} from '@/mastodon/utils/environment';
import { isRedesignEnabled } from '@/mastodon/utils/environment';
import { replyComposeById } from 'mastodon/actions/compose';
import { toggleReblog, toggleFavourite } from 'mastodon/actions/interactions';
import {
@@ -102,7 +99,7 @@ export const NotificationWithStatus: React.FC<{
'notification-ungrouped--unread': unread,
'notification-ungrouped--direct': isPrivateMention,
'notification-ungrouped--redesign':
isRedesignEnabled() && isRedesignStatusEnabled(),
isRedesignEnabled() && isRedesignEnabled(),
},
)}
tabIndex={0}

View File

@@ -1,7 +1,7 @@
import { lazy, Suspense } from 'react';
import { LoadingIndicator } from '@/mastodon/components/loading_indicator';
import { isRedesignStatusEnabled } from '@/mastodon/utils/environment';
import { isRedesignEnabled } from '@/mastodon/utils/environment';
const LazyStatusRedesign = lazy(() =>
import('./redesign').then(({ StatusPage }) => ({ default: StatusPage })),
@@ -10,7 +10,7 @@ const LazyStatusLegacy = lazy(() => import('./legacy'));
const StatusPage = (props: Record<string, unknown>) => (
<Suspense fallback={<LoadingIndicator />}>
{isRedesignStatusEnabled() ? (
{isRedesignEnabled() ? (
<LazyStatusRedesign />
) : (
<LazyStatusLegacy {...props} />

View File

@@ -10,7 +10,7 @@ import { throttle } from 'lodash';
import type { DeployPictureInPictureCallback } from '@/mastodon/actions/picture_in_picture';
import { Button } from '@/mastodon/components/button/redesign';
import { useRevealedMedia } from '@/mastodon/hooks/useRevealedMedia';
import { isRedesignStatusEnabled } from '@/mastodon/utils/environment';
import { isRedesignEnabled } from '@/mastodon/utils/environment';
import Forward5Icon from '@/material-icons/400-24px/forward_5-fill.svg?react';
import FullscreenIcon from '@/material-icons/400-24px/fullscreen.svg?react';
import FullscreenExitIcon from '@/material-icons/400-24px/fullscreen_exit.svg?react';
@@ -782,7 +782,7 @@ export const Video: React.FC<{
preload = 'none';
}
const ButtonComp = isRedesignStatusEnabled() ? Button : 'button';
const ButtonComp = isRedesignEnabled() ? Button : 'button';
// The outer wrapper is necessary to avoid reflowing the layout when going into full screen
return (

View File

@@ -18,7 +18,7 @@ export function isServerFeatureEnabled(feature: ServerFeatures) {
return initialState?.features.includes(feature) ?? false;
}
type ClientFeatures = 'redesign' | 'redesign-status';
type ClientFeatures = 'redesign';
export function isClientFeatureEnabled(feature: ClientFeatures) {
try {
@@ -37,7 +37,3 @@ export function isRedesignEnabled() {
isServerFeatureEnabled('redesign') || isClientFeatureEnabled('redesign')
);
}
export function isRedesignStatusEnabled() {
return isRedesignEnabled() && isClientFeatureEnabled('redesign-status');
}