From 44788e5bf8ed56705cf7d6bcde0638ec6350f74d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Thu, 5 Mar 2026 15:41:54 +0100 Subject: [PATCH] nicolium: remove test timeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- .../src/features/ui/components/timeline.tsx | 85 ------------------- .../nicolium/src/features/ui/router/index.tsx | 9 -- .../src/features/ui/util/async-components.ts | 1 - .../src/pages/developers/developers.tsx | 14 --- .../src/pages/timelines/test-timeline.tsx | 52 ------------ 5 files changed, 161 deletions(-) delete mode 100644 packages/nicolium/src/features/ui/components/timeline.tsx delete mode 100644 packages/nicolium/src/pages/timelines/test-timeline.tsx diff --git a/packages/nicolium/src/features/ui/components/timeline.tsx b/packages/nicolium/src/features/ui/components/timeline.tsx deleted file mode 100644 index 0749c0194..000000000 --- a/packages/nicolium/src/features/ui/components/timeline.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import debounce from 'lodash/debounce'; -import React, { useCallback, useMemo } from 'react'; -import { defineMessages } from 'react-intl'; - -import { dequeueTimeline, scrollTopTimeline } from '@/actions/timelines'; -import ScrollTopButton from '@/components/scroll-top-button'; -import StatusList, { type IStatusList } from '@/components/statuses/status-list'; -import Portal from '@/components/ui/portal'; -import { useAppDispatch } from '@/hooks/use-app-dispatch'; -import { useAppSelector } from '@/hooks/use-app-selector'; -import { makeGetStatusIds } from '@/selectors'; - -const messages = defineMessages({ - queue: { - id: 'status_list.queue_label', - defaultMessage: 'Click to see {count} new {count, plural, one {post} other {posts}}', - }, - queueLiveRegion: { - id: 'status_list.queue_label.live_region', - defaultMessage: '{count} new {count, plural, one {post} other {posts}}.', - }, -}); - -interface ITimeline extends Omit { - /** Unique key to preserve the scroll position when navigating back. */ - scrollKey: string; - /** ID of the timeline in Redux. */ - timelineId: string; - /** Settings path to use instead of the timelineId. */ - prefix?: string; -} - -/** Scrollable list of statuses from a timeline in the Redux store. */ -const Timeline: React.FC = ({ timelineId, onLoadMore, prefix, ...rest }) => { - const dispatch = useAppDispatch(); - const getStatusIds = useMemo(makeGetStatusIds, []); - - const statusIds = useAppSelector((state) => getStatusIds(state, { type: timelineId, prefix })); - const lastStatusId = statusIds.at(-1); - const isLoading = useAppSelector((state) => state.timelines[timelineId]?.isLoading); - const isPartial = useAppSelector((state) => state.timelines[timelineId]?.isPartial || false); - const hasMore = useAppSelector((state) => state.timelines[timelineId]?.hasMore); - const totalQueuedItemsCount = useAppSelector( - (state) => state.timelines[timelineId]?.totalQueuedItemsCount || 0, - ); - - const handleDequeueTimeline = useCallback(() => { - dispatch(dequeueTimeline(timelineId, onLoadMore ? () => onLoadMore(lastStatusId!) : undefined)); - }, []); - - const handleScroll = useCallback( - debounce((startIndex?: number) => { - dispatch(scrollTopTimeline(timelineId, startIndex === 0)); - }, 100), - [timelineId], - ); - - return ( - <> - - - - - - - ); -}; - -export { Timeline as default }; diff --git a/packages/nicolium/src/features/ui/router/index.tsx b/packages/nicolium/src/features/ui/router/index.tsx index 1f01f29f0..8c291d951 100644 --- a/packages/nicolium/src/features/ui/router/index.tsx +++ b/packages/nicolium/src/features/ui/router/index.tsx @@ -144,7 +144,6 @@ import { Share, Status, Subscribers, - TestTimeline, ThemeEditor, Privacy, UserIndex, @@ -1211,13 +1210,6 @@ export const developersSettingsStoreRoute = createRoute({ beforeLoad: requireAuth, }); -export const developersTimelineRoute = createRoute({ - getParentRoute: () => layouts.default, - path: '/developers/timeline', - component: TestTimeline, - beforeLoad: requireAuth, -}); - export const developersSwRoute = createRoute({ getParentRoute: () => layouts.default, path: '/developers/sw', @@ -1519,7 +1511,6 @@ const routeTree = rootRoute.addChildren([ developersRoute, developersAppsRoute, developersSettingsStoreRoute, - developersTimelineRoute, developersSwRoute, cryptoDonateRoute, federationRestrictionsRoute, diff --git a/packages/nicolium/src/features/ui/util/async-components.ts b/packages/nicolium/src/features/ui/util/async-components.ts index 0158984cd..e0c21805a 100644 --- a/packages/nicolium/src/features/ui/util/async-components.ts +++ b/packages/nicolium/src/features/ui/util/async-components.ts @@ -107,7 +107,6 @@ export const SettingsStore = lazy(() => import('@/pages/developers/settings-stor export const Share = lazy(() => import('@/pages/utils/share')); export const Status = lazy(() => import('@/pages/statuses/status')); export const Subscribers = lazy(() => import('@/pages/account-lists/subscribers')); -export const TestTimeline = lazy(() => import('@/pages/timelines/test-timeline')); export const ThemeEditor = lazy(() => import('@/pages/dashboard/theme-editor')); export const Privacy = lazy(() => import('@/pages/settings/privacy')); export const UserIndex = lazy(() => import('@/pages/dashboard/user-index')); diff --git a/packages/nicolium/src/pages/developers/developers.tsx b/packages/nicolium/src/pages/developers/developers.tsx index f3ca35861..a6b5d2e90 100644 --- a/packages/nicolium/src/pages/developers/developers.tsx +++ b/packages/nicolium/src/pages/developers/developers.tsx @@ -82,20 +82,6 @@ const DevelopersPage: React.FC = () => { - - - - - - - - { - const intl = useIntl(); - const dispatch = useAppDispatch(); - - React.useEffect(() => { - importEntities({ statuses: MOCK_STATUSES }); - dispatch(expandTimelineSuccess(timelineId, MOCK_STATUSES, null, null, false)); - }, []); - - return ( - - - } - emptyMessageIcon={require('@phosphor-icons/core/regular/chat-centered-text.svg')} - /> - - ); -}; - -export { TestTimelinePage as default };