diff --git a/app/javascript/mastodon/actions/tags_typed.ts b/app/javascript/mastodon/actions/tags_typed.ts index a3e5cfd125..1f686f0c43 100644 --- a/app/javascript/mastodon/actions/tags_typed.ts +++ b/app/javascript/mastodon/actions/tags_typed.ts @@ -1,12 +1,30 @@ +import { createAction } from '@reduxjs/toolkit'; + import { apiGetTag, apiFollowTag, apiUnfollowTag, apiFeatureTag, apiUnfeatureTag, + apiGetFollowedTags, } from 'mastodon/api/tags'; import { createDataLoadingThunk } from 'mastodon/store/typed_functions'; +export const fetchFollowedHashtags = createDataLoadingThunk( + 'tags/fetch-followed', + async ({ next }: { next?: string } = {}) => { + const response = await apiGetFollowedTags(next); + return { + ...response, + replace: !next, + }; + }, +); + +export const markFollowedHashtagsStale = createAction( + 'tags/mark-followed-stale', +); + export const fetchHashtag = createDataLoadingThunk( 'tags/fetch', ({ tagId }: { tagId: string }) => apiGetTag(tagId), @@ -15,6 +33,9 @@ export const fetchHashtag = createDataLoadingThunk( export const followHashtag = createDataLoadingThunk( 'tags/follow', ({ tagId }: { tagId: string }) => apiFollowTag(tagId), + (_, { dispatch }) => { + void dispatch(markFollowedHashtagsStale()); + }, ); export const unfollowHashtag = createDataLoadingThunk( diff --git a/app/javascript/mastodon/features/compose/index.tsx b/app/javascript/mastodon/features/compose/index.tsx index 54776c98ff..892cbb9761 100644 --- a/app/javascript/mastodon/features/compose/index.tsx +++ b/app/javascript/mastodon/features/compose/index.tsx @@ -15,39 +15,34 @@ import LogoutIcon from '@/material-icons/400-24px/logout.svg?react'; import MenuIcon from '@/material-icons/400-24px/menu.svg?react'; import NotificationsIcon from '@/material-icons/400-24px/notifications-fill.svg?react'; import PublicIcon from '@/material-icons/400-24px/public.svg?react'; -import SettingsIcon from '@/material-icons/400-24px/settings-fill.svg?react'; +import SettingsIcon from '@/material-icons/400-24px/settings.svg?react'; import { mountCompose, unmountCompose } from 'mastodon/actions/compose'; import { openModal } from 'mastodon/actions/modal'; import { Column } from 'mastodon/components/column'; import { ColumnHeader } from 'mastodon/components/column_header'; import { Icon } from 'mastodon/components/icon'; -import { mascot } from 'mastodon/initial_state'; +import { mascot, reduceMotion } from 'mastodon/initial_state'; import { useAppDispatch, useAppSelector } from 'mastodon/store'; +import { messages as navbarMessages } from '../ui/components/navigation_bar'; + import { Search } from './components/search'; import ComposeFormContainer from './containers/compose_form_container'; const messages = defineMessages({ - start: { id: 'getting_started.heading', defaultMessage: 'Getting started' }, - home_timeline: { id: 'tabs_bar.home', defaultMessage: 'Home' }, - notifications: { - id: 'tabs_bar.notifications', - defaultMessage: 'Notifications', + live_feed_public: { + id: 'navigation_bar.live_feed_public', + defaultMessage: 'Live feed (public)', }, - public: { - id: 'navigation_bar.public_timeline', - defaultMessage: 'Federated timeline', - }, - community: { - id: 'navigation_bar.community_timeline', - defaultMessage: 'Local timeline', + live_feed_local: { + id: 'navigation_bar.live_feed_local', + defaultMessage: 'Live feed (local)', }, preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences', }, logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' }, - compose: { id: 'navigation_bar.compose', defaultMessage: 'Compose new post' }, }); type ColumnMap = ImmutableMap<'id' | 'uuid' | 'params', string>; @@ -82,19 +77,27 @@ const Compose: React.FC<{ multiColumn: boolean }> = ({ multiColumn }) => { [dispatch], ); + const scrollNavbarIntoView = useCallback(() => { + const navbar = document.querySelector('.navigation-panel'); + navbar?.scrollIntoView({ + behavior: reduceMotion ? 'auto' : 'smooth', + }); + }, []); + if (multiColumn) { return (