From 00003c4d7939db1361f0612f366d5dafb1f0176d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Thu, 5 Mar 2026 13:18:19 +0100 Subject: [PATCH] nicolium: timeline loading state improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- packages/nicolium/src/columns/timeline.tsx | 21 ++++++++++----------- packages/nicolium/src/stores/timelines.ts | 4 +--- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/packages/nicolium/src/columns/timeline.tsx b/packages/nicolium/src/columns/timeline.tsx index 475a072c6..60482fd7e 100644 --- a/packages/nicolium/src/columns/timeline.tsx +++ b/packages/nicolium/src/columns/timeline.tsx @@ -38,6 +38,12 @@ const messages = defineMessages({ }, }); +const PlaceholderTimelineStatus = () => ( +
+ +
+); + interface ITimelineStatus { id: string; contextType?: FilterContextType; @@ -134,10 +140,10 @@ const Timeline: React.FC = ({ query, contextType = 'public' }) => { /> ); } - if (entry.type === 'page-end' || entry.type === 'page-start') { + if ((entry.type === 'page-end' || entry.type === 'page-start') && !isFetching) { return (
- +
); } @@ -158,17 +164,10 @@ const Timeline: React.FC = ({ query, contextType = 'public' }) => { key='scrollable-list' isLoading={isFetching} showLoading={isPending} - placeholderComponent={() => } + placeholderComponent={() => } placeholderCount={20} ref={node} - // className={className} - // listClassName={clsx('divide-y divide-solid divide-gray-200 dark:divide-gray-800', { - // 'divide-none': divideType !== 'border', - // })} - // itemClassName={clsx({ - // 'pb-3': divideType !== 'border', - // })} - // {...other} + hasMore > {(entries || []).map(renderEntry)} diff --git a/packages/nicolium/src/stores/timelines.ts b/packages/nicolium/src/stores/timelines.ts index 4bfa788b1..5783abf00 100644 --- a/packages/nicolium/src/stores/timelines.ts +++ b/packages/nicolium/src/stores/timelines.ts @@ -166,9 +166,7 @@ const useTimelinesStore = create()( }, setLoading: (timelineId, isFetching) => set((state) => { - const timeline = state.timelines[timelineId]; - - if (!timeline) return; + const timeline = (state.timelines[timelineId] ??= createEmptyTimeline()); timeline.isFetching = isFetching; if (!isFetching) timeline.isPending = false;