[Glitch] Split timeline_preview setting into more granular settings

Port 2d2c525097 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Claire
2025-10-06 10:34:05 +02:00
parent 3b659cfb48
commit e82def7dad
3 changed files with 28 additions and 17 deletions

View File

@@ -14,7 +14,7 @@ import { connectPublicStream, connectCommunityStream } from 'flavours/glitch/act
import { expandPublicTimeline, expandCommunityTimeline } from 'flavours/glitch/actions/timelines'; import { expandPublicTimeline, expandCommunityTimeline } from 'flavours/glitch/actions/timelines';
import { DismissableBanner } from 'flavours/glitch/components/dismissable_banner'; import { DismissableBanner } from 'flavours/glitch/components/dismissable_banner';
import SettingText from 'flavours/glitch/components/setting_text'; import SettingText from 'flavours/glitch/components/setting_text';
import { domain } from 'flavours/glitch/initial_state'; import { localLiveFeedAccess, remoteLiveFeedAccess, me, domain } from 'flavours/glitch/initial_state';
import { useAppDispatch, useAppSelector } from 'flavours/glitch/store'; import { useAppDispatch, useAppSelector } from 'flavours/glitch/store';
import Column from '../../components/column'; import Column from '../../components/column';
@@ -191,19 +191,21 @@ const Firehose = ({ feedType, multiColumn }) => {
<ColumnSettings /> <ColumnSettings />
</ColumnHeader> </ColumnHeader>
<div className='account__section-headline'> {(signedIn || (localLiveFeedAccess === 'public' && remoteLiveFeedAccess === 'public')) && (
<NavLink exact to='/public/local'> <div className='account__section-headline'>
<FormattedMessage tagName='div' id='firehose.local' defaultMessage='This server' /> <NavLink exact to='/public/local'>
</NavLink> <FormattedMessage tagName='div' id='firehose.local' defaultMessage='This server' />
</NavLink>
<NavLink exact to='/public/remote'> <NavLink exact to='/public/remote'>
<FormattedMessage tagName='div' id='firehose.remote' defaultMessage='Other servers' /> <FormattedMessage tagName='div' id='firehose.remote' defaultMessage='Other servers' />
</NavLink> </NavLink>
<NavLink exact to='/public'> <NavLink exact to='/public'>
<FormattedMessage tagName='div' id='firehose.all' defaultMessage='All' /> <FormattedMessage tagName='div' id='firehose.all' defaultMessage='All' />
</NavLink> </NavLink>
</div> </div>
)}
<StatusListContainer <StatusListContainer
prepend={prependBanner} prepend={prependBanner}

View File

@@ -41,7 +41,8 @@ import { ColumnLink } from 'flavours/glitch/features/ui/components/column_link';
import { useBreakpoint } from 'flavours/glitch/features/ui/hooks/useBreakpoint'; import { useBreakpoint } from 'flavours/glitch/features/ui/hooks/useBreakpoint';
import { useIdentity } from 'flavours/glitch/identity_context'; import { useIdentity } from 'flavours/glitch/identity_context';
import { import {
timelinePreview, localLiveFeedAccess,
remoteLiveFeedAccess,
trendsEnabled, trendsEnabled,
me, me,
} from 'flavours/glitch/initial_state'; } from 'flavours/glitch/initial_state';
@@ -285,10 +286,16 @@ export const NavigationPanel: React.FC<{ multiColumn?: boolean }> = ({
/> />
)} )}
{(signedIn || timelinePreview) && ( {(signedIn ||
localLiveFeedAccess === 'public' ||
remoteLiveFeedAccess === 'public') && (
<ColumnLink <ColumnLink
transparent transparent
to='/public/local' to={
signedIn || localLiveFeedAccess === 'public'
? '/public/local'
: '/public/remote'
}
icon='globe' icon='globe'
iconComponent={PublicIcon} iconComponent={PublicIcon}
isActive={isFirehoseActive} isActive={isFirehoseActive}

View File

@@ -34,7 +34,8 @@ interface InitialStateMeta {
single_user_mode: boolean; single_user_mode: boolean;
source_url: string; source_url: string;
streaming_api_base_url: string; streaming_api_base_url: string;
timeline_preview: boolean; local_live_feed_access: 'public' | 'authenticated';
remote_live_feed_access: 'public' | 'authenticated';
title: string; title: string;
show_trends: boolean; show_trends: boolean;
trends_as_landing_page: boolean; trends_as_landing_page: boolean;
@@ -138,7 +139,8 @@ export const trendsEnabled = getMeta('trends_enabled');
export const showTrends = getMeta('show_trends'); export const showTrends = getMeta('show_trends');
export const singleUserMode = getMeta('single_user_mode'); export const singleUserMode = getMeta('single_user_mode');
export const source_url = getMeta('source_url'); export const source_url = getMeta('source_url');
export const timelinePreview = getMeta('timeline_preview'); export const localLiveFeedAccess = getMeta('local_live_feed_access');
export const remoteLiveFeedAccess = getMeta('remote_live_feed_access');
export const title = getMeta('title'); export const title = getMeta('title');
export const trendsAsLanding = getMeta('trends_as_landing_page'); export const trendsAsLanding = getMeta('trends_as_landing_page');
export const useBlurhash = getMeta('use_blurhash'); export const useBlurhash = getMeta('use_blurhash');