{hasData ? (
diff --git a/apps/renderer/src/modules/timeline-column/InboxList.tsx b/apps/renderer/src/modules/timeline-column/InboxList.tsx
deleted file mode 100644
index b18692caa..000000000
--- a/apps/renderer/src/modules/timeline-column/InboxList.tsx
+++ /dev/null
@@ -1,55 +0,0 @@
-import { env } from "@follow/shared/env"
-import { useTranslation } from "react-i18next"
-
-import { CopyButton } from "~/components/ui/button/CopyButton"
-import { useInboxById } from "~/store/inbox"
-import { useFeedUnreadStore } from "~/store/unread"
-
-import { UnreadNumber } from "./UnreadNumber"
-
-export const InboxList = ({ id }: { id: string }) => {
- const { t } = useTranslation()
- const inboxUnread = useFeedUnreadStore((state) => state.data[id] || 0)
- const inbox = useInboxById(id)
-
- return (
-
-
-
{inbox?.title || t("words.inbox")}
-
-
-
-
-
-
-
-
{t("discover.inbox.handle")}
-
{id}
-
-
-
{t("discover.inbox.email")}
-
-
- {id}
- {env.VITE_INBOXES_EMAIL}
-
-
-
-
-
-
- )
-}
diff --git a/apps/renderer/src/modules/timeline-column/ListFeedList.tsx b/apps/renderer/src/modules/timeline-column/ListFeedList.tsx
deleted file mode 100644
index b6aa86caf..000000000
--- a/apps/renderer/src/modules/timeline-column/ListFeedList.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-import { ScrollArea } from "@follow/components/ui/scroll-area/index.js"
-import {
- Tooltip,
- TooltipContent,
- TooltipPortal,
- TooltipTrigger,
-} from "@follow/components/ui/tooltip/index.js"
-import { cn } from "@follow/utils/utils"
-import dayjs from "dayjs"
-import type { FC, MouseEventHandler } from "react"
-import { useTranslation } from "react-i18next"
-
-import { useNavigateEntry } from "~/hooks/biz/useNavigateEntry"
-import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams"
-import { useList } from "~/queries/lists"
-import { useFeedById } from "~/store/feed"
-import { useListById } from "~/store/list"
-
-import { FeedIcon } from "../feed/feed-icon"
-import { FeedTitle } from "../feed/feed-title"
-import { feedColumnStyles } from "./styles"
-
-export const ListFeedList: FC<{ listId: string }> = ({ listId }) => {
- const { t } = useTranslation()
- const cachedList = useListById(listId)
- const res = useList({ id: listId, noExtras: true })
- const list = res.data?.list || cachedList
- const currentFeedId = useRouteParamsSelector((s) => s.feedId)
-
- if (!list) return null
- return (
- <>
-
-
{list?.title || t("words.inbox")}
-
-
- {list?.feedIds.map((feedId) => (
-
- ))}
-
- >
- )
-}
-
-interface FeedItemProps {
- feedId: string
- isActive: boolean
-}
-const FeedItem = ({ feedId, isActive }: FeedItemProps) => {
- const feed = useFeedById(feedId)
- const { t } = useTranslation()
- const navigate = useNavigateEntry()
-
- if (!feed) return null
-
- const handleClick: MouseEventHandler
= (e) => {
- e.stopPropagation()
- navigate({ feedId })
- }
- return (
-
-
-
-
- {feed?.errorAt && (
-
-
-
-
-
-
-
-
- {t("feed_item.error_since")}{" "}
- {dayjs
- .duration(dayjs(feed.errorAt).diff(dayjs(), "minute"), "minute")
- .humanize(true)}
-
- {!!feed.errorMessage && (
-
-
- {feed.errorMessage}
-
- )}
-
-
-
- )}
-
-
- )
-}
diff --git a/apps/renderer/src/modules/timeline-column/QuickSelectorPanel.tsx b/apps/renderer/src/modules/timeline-column/QuickSelectorPanel.tsx
deleted file mode 100644
index 425133db0..000000000
--- a/apps/renderer/src/modules/timeline-column/QuickSelectorPanel.tsx
+++ /dev/null
@@ -1,258 +0,0 @@
-import { Divider } from "@follow/components/ui/divider/Divider.js"
-import { RootPortal } from "@follow/components/ui/portal/index.js"
-import { ScrollArea } from "@follow/components/ui/scroll-area/ScrollArea.js"
-import { EllipsisHorizontalTextWithTooltip } from "@follow/components/ui/typography/EllipsisWithTooltip.js"
-import type { FeedViewType } from "@follow/constants"
-import { views } from "@follow/constants"
-import { cn } from "@follow/utils/utils"
-import { AnimatePresence, m, useAnimationControls } from "framer-motion"
-import type { HTMLAttributes } from "react"
-import { forwardRef, useEffect, useState } from "react"
-import { useTranslation } from "react-i18next"
-
-import { useShowContextMenu } from "~/atoms/context-menu"
-import { useUISettingKey } from "~/atoms/settings/ui"
-import {
- ROUTE_TIMELINE_OF_INBOX,
- ROUTE_TIMELINE_OF_LIST,
- ROUTE_TIMELINE_OF_VIEW,
-} from "~/constants"
-import { useListActions } from "~/hooks/biz/useFeedActions"
-import { useNavigateEntry } from "~/hooks/biz/useNavigateEntry"
-import { useContextMenu } from "~/hooks/common"
-import { useInboxById } from "~/store/inbox"
-import { useListById } from "~/store/list"
-
-import { FeedIcon } from "../feed/feed-icon"
-import { feedColumnStyles } from "./styles"
-
-interface QuickSelectorPanelProps {
- rootContainer: HTMLElement | null
- timelineList: {
- views: string[]
- lists: string[]
- inboxes: string[]
- all: string[]
- }
- activeTimelineId: string | undefined
- open: boolean
-}
-
-export const QuickSelectorPanel = forwardRef(
- ({ rootContainer, timelineList, activeTimelineId, open: shouldOpen }, ref) => {
- const feedColWidth = useUISettingKey("feedColWidth")
- const animateControls = useAnimationControls()
- const [renderPanel, setRenderPanel] = useState(false)
-
- useEffect(() => {
- let cancel = false
- if (shouldOpen) {
- setRenderPanel(true)
- animateControls.start({
- transform: "translateX(0%)",
- })
- } else {
- animateControls
- .start({
- transform: "translateX(-100%)",
- })
- .then(() => {
- if (cancel) return
- setRenderPanel(false)
- })
- }
- return () => {
- cancel = true
- }
- }, [animateControls, renderPanel, shouldOpen])
-
- return (
-
-
-
-
- {renderPanel && (
- <>
-
- Quick Selector
-
-
-
-
-
-
-
-
-
-
- >
- )}
-
-
-
-
- )
- },
-)
-
-interface TimelineItemProps {
- timelineId: string
- isActive: boolean
-}
-const TimelineListViewItem = ({ timelineId, isActive }: TimelineItemProps) => {
- const id = Number.parseInt(timelineId.slice(ROUTE_TIMELINE_OF_VIEW.length), 10) as FeedViewType
- const item = views.find((item) => item.view === id)!
- const { t } = useTranslation()
-
- return (
-
-
- {item.icon}
-
- {t(item.name as any)}
-
-
-
- )
-}
-
-const ItemBase: Component<
- { timelineId: string; isActive: boolean } & HTMLAttributes
-> = ({ timelineId, isActive, children, className, ...props }) => {
- const navigate = useNavigateEntry()
- return (
-
- )
-}
-
-const TimelineListListItem = ({ timelineId, isActive }: TimelineItemProps) => {
- const id = timelineId.slice(ROUTE_TIMELINE_OF_LIST.length)
- const list = useListById(id)
-
- const items = useListActions({ listId: id })
- const showContextMenu = useShowContextMenu()
-
- const contextMenuProps = useContextMenu({
- onContextMenu: async (e) => {
- await showContextMenu(items, e)
- },
- })
-
- if (!list) return null
- return (
-
-
-
-
- {list.title}
-
-
-
- )
-}
-
-const TimelineInboxListItem = ({ timelineId, isActive }: TimelineItemProps) => {
- const id = timelineId.slice(ROUTE_TIMELINE_OF_INBOX.length)
- const inbox = useInboxById(id)
-
- if (!inbox) return null
- return (
-
-
-
-
- {inbox.title}
-
-
-
- )
-}
-
-interface TimelineSectionProps {
- title: string
- items: string[]
- ItemComponent: React.ComponentType
- activeTimelineId?: string | undefined
-}
-
-const TimelineSection = ({
- title,
- items,
- activeTimelineId,
- ItemComponent,
-}: TimelineSectionProps) => {
- return (
- <>
- {title}
- {items.length > 0 ? (
-
- {items.map((timelineId) => (
-
- ))}
-
- ) : (
- Nothing in {title}
- )}
- >
- )
-}
diff --git a/apps/renderer/src/modules/timeline-column/TimelineList.tsx b/apps/renderer/src/modules/timeline-column/TimelineList.tsx
index ba8b942aa..1306947fe 100644
--- a/apps/renderer/src/modules/timeline-column/TimelineList.tsx
+++ b/apps/renderer/src/modules/timeline-column/TimelineList.tsx
@@ -1,24 +1,12 @@
import type { FeedViewType } from "@follow/constants"
-import {
- ROUTE_TIMELINE_OF_INBOX,
- ROUTE_TIMELINE_OF_LIST,
- ROUTE_TIMELINE_OF_VIEW,
-} from "~/constants"
+import { ROUTE_TIMELINE_OF_VIEW } from "~/constants"
import { FeedList } from "./FeedList"
-import { InboxList } from "./InboxList"
-import { ListFeedList } from "./ListFeedList"
export default function TimelineList({ timelineId }: { timelineId: string }) {
if (timelineId.startsWith(ROUTE_TIMELINE_OF_VIEW)) {
const id = Number.parseInt(timelineId.slice(ROUTE_TIMELINE_OF_VIEW.length), 10) as FeedViewType
return
- } else if (timelineId.startsWith(ROUTE_TIMELINE_OF_LIST)) {
- const listId = timelineId.slice(ROUTE_TIMELINE_OF_LIST.length)
- return
- } else if (timelineId.startsWith(ROUTE_TIMELINE_OF_INBOX)) {
- const id = timelineId.slice(ROUTE_TIMELINE_OF_INBOX.length)
- return
}
}
diff --git a/apps/renderer/src/modules/timeline-column/TimelineSelector.tsx b/apps/renderer/src/modules/timeline-column/TimelineSelector.tsx
deleted file mode 100644
index cc2b6d773..000000000
--- a/apps/renderer/src/modules/timeline-column/TimelineSelector.tsx
+++ /dev/null
@@ -1,108 +0,0 @@
-import { DividerVertical } from "@follow/components/ui/divider/Divider.js"
-import { useTriangleMenu } from "@follow/hooks"
-import { getNodeXInScroller, isNodeVisibleInScroller } from "@follow/utils/dom"
-import { clsx } from "@follow/utils/utils"
-import { Fragment, useEffect, useRef, useState } from "react"
-
-import { useTimelineColumnShow } from "~/atoms/sidebar"
-import { ROOT_CONTAINER_ID } from "~/constants/dom"
-import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams"
-import { useTimelineList } from "~/hooks/biz/useTimelineList"
-
-import styles from "./index.module.css"
-import { QuickSelectorPanel } from "./QuickSelectorPanel"
-import { TimelineSwitchButton } from "./TimelineSwitchButton"
-
-export const TimelineSelector = ({ timelineId }: { timelineId: string | undefined }) => {
- const timelineList = useTimelineList()
- const scrollRef = useRef(null)
- useEffect(() => {
- const $scroll = scrollRef.current
- if (!$scroll) {
- return
- }
- const handler = () => {
- if (!timelineId) return
- const targetElement = [...$scroll.children]
- .filter(($el) => $el.tagName === "BUTTON")
- .find(($el, index) => index === timelineList.all.indexOf(timelineId))
- if (!targetElement) {
- return
- }
-
- const isInCurrentView = isNodeVisibleInScroller(targetElement, $scroll)
- if (!targetElement || isInCurrentView) {
- return
- }
- const targetX = getNodeXInScroller(targetElement, $scroll) - 12
-
- $scroll.scrollTo({
- left: targetX,
- behavior: "smooth",
- })
- }
- handler()
- }, [timelineId])
-
- const [rootContainer, setRootContainer] = useState(null)
-
- const containerRef = useRef(null)
-
- useEffect(() => {
- const $root = document.querySelector(`#${ROOT_CONTAINER_ID}`)
- if (!$root) return
-
- setRootContainer($root as HTMLElement)
- }, [])
-
- const activeTimelineId = useRouteParamsSelector((s) => s.timelineId)
-
- const [panelRef, setPanelRef] = useState(null)
- const triggerRef = useRef(null)
- const shouldOpen = useTriangleMenu(triggerRef, panelRef!, 0)
-
- const timelineColumnShow = useTimelineColumnShow()
-
- return (
-
-
-
{
- e.preventDefault()
- e.currentTarget.scrollLeft += e.deltaY
- }}
- >
- {timelineList.views.map((timelineId) => (
-
- ))}
-
- {timelineList.inboxes.length > 0 &&
}
- {timelineList.inboxes.map((timelineId) => (
-
- ))}
- {timelineList.lists.length > 0 &&
}
- {timelineList.lists.map((timelineId) => (
-
- ))}
-
-
-
-
-
- {timelineColumnShow && (
-
- )}
-
- )
-}
diff --git a/apps/renderer/src/modules/timeline-column/TimelineSwitchButton.tsx b/apps/renderer/src/modules/timeline-column/TimelineSwitchButton.tsx
index 33c9e8c8c..b00d3b481 100644
--- a/apps/renderer/src/modules/timeline-column/TimelineSwitchButton.tsx
+++ b/apps/renderer/src/modules/timeline-column/TimelineSwitchButton.tsx
@@ -2,31 +2,17 @@ import { useDroppable } from "@dnd-kit/core"
import { ActionButton } from "@follow/components/ui/button/index.js"
import type { FeedViewType } from "@follow/constants"
import { views } from "@follow/constants"
-import { nextFrame } from "@follow/utils/dom"
import { cn } from "@follow/utils/utils"
import type { FC } from "react"
import { startTransition, useCallback } from "react"
import { useTranslation } from "react-i18next"
-import { useShowContextMenu } from "~/atoms/context-menu"
-import { getMainContainerElement } from "~/atoms/dom"
import { useUISettingKey } from "~/atoms/settings/ui"
-import {
- ROUTE_TIMELINE_OF_INBOX,
- ROUTE_TIMELINE_OF_LIST,
- ROUTE_TIMELINE_OF_VIEW,
-} from "~/constants"
-import { useListActions } from "~/hooks/biz/useFeedActions"
+import { ROUTE_TIMELINE_OF_VIEW } from "~/constants"
import { useNavigateEntry } from "~/hooks/biz/useNavigateEntry"
import { useRouteParamsSelector } from "~/hooks/biz/useRouteParams"
-import { useContextMenu } from "~/hooks/common"
-import { useInboxById } from "~/store/inbox"
-import { useListById } from "~/store/list"
-import { subscriptionActions } from "~/store/subscription"
-import { useFeedUnreadStore } from "~/store/unread"
import { useUnreadByView } from "~/store/unread/hooks"
-import { FeedIcon } from "../feed/feed-icon"
import { resetSelectedFeedIds } from "./atom"
export function TimelineSwitchButton({ timelineId }: { timelineId: string }) {
@@ -45,12 +31,6 @@ export function TimelineSwitchButton({ timelineId }: { timelineId: string }) {
if (timelineId.startsWith(ROUTE_TIMELINE_OF_VIEW)) {
const id = Number.parseInt(timelineId.slice(ROUTE_TIMELINE_OF_VIEW.length), 10) as FeedViewType
return
- } else if (timelineId.startsWith(ROUTE_TIMELINE_OF_LIST)) {
- const id = timelineId.slice(ROUTE_TIMELINE_OF_LIST.length)
- return
- } else if (timelineId.startsWith(ROUTE_TIMELINE_OF_INBOX)) {
- const id = timelineId.slice(ROUTE_TIMELINE_OF_INBOX.length)
- return
}
}
@@ -80,11 +60,10 @@ const ViewSwitchButton: FC<{
shortcut={`${view + 1}`}
className={cn(
isActive && item.className,
- "flex h-11 shrink-0 flex-col items-center gap-1 text-[1.375rem]",
+ "flex h-11 w-9 shrink-0 flex-col items-center gap-1 text-[1.375rem]",
ELECTRON ? "hover:!bg-theme-item-hover" : "",
isOver && "border-theme-accent-400 bg-theme-accent-400/60",
)}
- size="lg"
onClick={(e) => {
startTransition(() => {
setActive()
@@ -108,117 +87,3 @@ const ViewSwitchButton: FC<{
)
}
-
-const ListSwitchButton: FC<{
- listId: string
- isActive: boolean
- setActive: () => void
-}> = ({ listId, isActive, setActive }) => {
- const list = useListById(listId)
- const listUnread = useFeedUnreadStore((state) => state.data[listId] || 0)
-
- const handleNavigate = useCallback(
- (e: React.MouseEvent) => {
- e.stopPropagation()
-
- setActive()
- subscriptionActions.markReadByFeedIds({
- listId,
- })
- // focus to main container in order to let keyboard can navigate entry items by arrow keys
- nextFrame(() => {
- getMainContainerElement()?.focus()
- })
- },
- [listId, setActive],
- )
-
- const items = useListActions({ listId })
- const showContextMenu = useShowContextMenu()
- const contextMenuProps = useContextMenu({
- onContextMenu: async (e) => {
- await showContextMenu(items, e)
- },
- })
-
- if (!list) return null
-
- return (
-
-
- {!!listUnread && (
-
-
-
- )}
- {!listUnread && (
-
- {list.title}
-
- )}
-
- )
-}
-
-const InboxSwitchButton: FC<{
- inboxId: string
- isActive: boolean
- setActive: () => void
-}> = ({ inboxId, isActive, setActive }) => {
- const inbox = useInboxById(inboxId)
- const inboxUnread = useFeedUnreadStore((state) => state.data[inboxId] || 0)
- const showSidebarUnreadCount = useUISettingKey("sidebarShowUnreadCount")
-
- const handleNavigate = useCallback(
- (e: React.MouseEvent) => {
- e.stopPropagation()
-
- setActive()
- // focus to main container in order to let keyboard can navigate entry items by arrow keys
- nextFrame(() => {
- getMainContainerElement()?.focus()
- })
- },
- [setActive],
- )
-
- if (!inbox) return null
-
- return (
-
-
- {showSidebarUnreadCount ? (
-
- {inboxUnread > 99 ? 99+ : inboxUnread}
-
- ) : (
-
- )}
-
- )
-}
diff --git a/apps/renderer/src/modules/timeline-column/UnreadNumber.tsx b/apps/renderer/src/modules/timeline-column/UnreadNumber.tsx
index b904628f8..b6e6a969f 100644
--- a/apps/renderer/src/modules/timeline-column/UnreadNumber.tsx
+++ b/apps/renderer/src/modules/timeline-column/UnreadNumber.tsx
@@ -2,15 +2,7 @@ import { cn } from "@follow/utils/utils"
import { useUISettingKey } from "~/atoms/settings/ui"
-export const UnreadNumber = ({
- unread,
- className,
- isList,
-}: {
- unread: number
- className?: string
- isList?: boolean
-}) => {
+export const UnreadNumber = ({ unread, className }: { unread: number; className?: string }) => {
const showUnreadCount = useUISettingKey("sidebarShowUnreadCount")
if (!unread) return null
@@ -21,7 +13,7 @@ export const UnreadNumber = ({
className,
)}
>
- {isList || !showUnreadCount ? : unread}
+ {!showUnreadCount ? : unread}
)
}
diff --git a/apps/renderer/src/modules/timeline-column/index.tsx b/apps/renderer/src/modules/timeline-column/index.tsx
index 8698c85be..521cd4d0d 100644
--- a/apps/renderer/src/modules/timeline-column/index.tsx
+++ b/apps/renderer/src/modules/timeline-column/index.tsx
@@ -26,7 +26,7 @@ import { getSelectedFeedIds, resetSelectedFeedIds, setSelectedFeedIds } from "./
import { useShouldFreeUpSpace } from "./hook"
import { TimelineColumnHeader } from "./TimelineColumnHeader"
import TimelineList from "./TimelineList"
-import { TimelineSelector } from "./TimelineSelector"
+import { TimelineSwitchButton } from "./TimelineSwitchButton"
const lethargy = new Lethargy()
@@ -66,7 +66,7 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam
(args: string | ((prev: string | undefined, index: number) => string)) => {
let nextActive
if (typeof args === "function") {
- const index = timelineId ? timelineList.all.indexOf(timelineId) : 0
+ const index = timelineId ? timelineList.indexOf(timelineId) : 0
nextActive = args(timelineId, index)
} else {
nextActive = args
@@ -75,7 +75,7 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam
navigateBackHome(nextActive)
resetSelectedFeedIds()
},
- [navigateBackHome, timelineId, timelineList.all],
+ [navigateBackHome, timelineId, timelineList],
)
useWheel(
@@ -84,7 +84,7 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam
const s = lethargy.check(event)
if (s) {
if (!wait && Math.abs(dex) > 20) {
- setActive((_, i) => timelineList.all[clamp(i + dx, 0, timelineList.all.length - 1)]!)
+ setActive((_, i) => timelineList[clamp(i + dx, 0, timelineList.length - 1)]!)
return true
} else {
return
@@ -108,13 +108,13 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam
if (isHotkeyPressed("Left")) {
setActive((_, i) => {
if (i === 0) {
- return timelineList.all.at(-1)!
+ return timelineList.at(-1)!
} else {
- return timelineList.all[i - 1]!
+ return timelineList[i - 1]!
}
})
} else {
- setActive((_, i) => timelineList.all[(i + 1) % timelineList.all.length]!)
+ setActive((_, i) => timelineList[(i + 1) % timelineList.length]!)
}
},
{ scopes: HotKeyScopeMap.Home },
@@ -152,7 +152,13 @@ export function FeedColumn({ children, className }: PropsWithChildren<{ classNam
)}
-
+
+
+ {timelineList.map((timelineId) => (
+
+ ))}
+
+
- {timelineList.all.map((timelineId) => (
+ {timelineList.map((timelineId) => (
@@ -187,7 +193,7 @@ const SwipeWrapper: FC<{
}> = memo(({ children, active }) => {
const reduceMotion = useReduceMotion()
const timelineList = useTimelineList()
- const index = timelineList.all.indexOf(active)
+ const index = timelineList.indexOf(active)
const feedColumnWidth = useUISettingKey("feedColWidth")
const containerRef = useRef(null)
diff --git a/apps/renderer/src/store/feed/hooks.ts b/apps/renderer/src/store/feed/hooks.ts
index c1ea42048..656831b11 100644
--- a/apps/renderer/src/store/feed/hooks.ts
+++ b/apps/renderer/src/store/feed/hooks.ts
@@ -3,13 +3,7 @@ import type { FeedModel, FeedOrListRespModel, InboxModel, ListModel } from "@fol
import { useCallback } from "react"
import { useTranslation } from "react-i18next"
-import {
- FEED_COLLECTION_LIST,
- ROUTE_FEED_IN_FOLDER,
- ROUTE_FEED_PENDING,
- ROUTE_TIMELINE_OF_INBOX,
- ROUTE_TIMELINE_OF_LIST,
-} from "~/constants"
+import { FEED_COLLECTION_LIST, ROUTE_FEED_IN_FOLDER, ROUTE_FEED_PENDING } from "~/constants"
import { useRouteParams } from "~/hooks/biz/useRouteParams"
import { useInboxStore } from "../inbox"
@@ -77,17 +71,10 @@ export const useInboxByIdSelector = (
export const useFeedHeaderTitle = () => {
const { t } = useTranslation()
- const { feedId: currentFeedId, view, listId, inboxId, timelineId } = useRouteParams()
+ const { feedId: currentFeedId, view, listId: currentListId } = useRouteParams()
- const listTitle = useListByIdSelector(listId, getPreferredTitle)
- const inboxTitle = useInboxByIdSelector(inboxId, getPreferredTitle)
const feedTitle = useFeedByIdSelector(currentFeedId, getPreferredTitle)
-
- if (timelineId?.startsWith(ROUTE_TIMELINE_OF_LIST)) {
- return listTitle
- } else if (timelineId?.startsWith(ROUTE_TIMELINE_OF_INBOX)) {
- return inboxTitle
- }
+ const listTitle = useListByIdSelector(currentListId, getPreferredTitle)
switch (currentFeedId) {
case ROUTE_FEED_PENDING: {
@@ -100,7 +87,7 @@ export const useFeedHeaderTitle = () => {
if (currentFeedId?.startsWith(ROUTE_FEED_IN_FOLDER)) {
return currentFeedId.replace(ROUTE_FEED_IN_FOLDER, "")
}
- return feedTitle
+ return feedTitle || listTitle
}
}
}
diff --git a/apps/renderer/src/store/subscription/store.ts b/apps/renderer/src/store/subscription/store.ts
index c811dc1fb..d4d0c6412 100644
--- a/apps/renderer/src/store/subscription/store.ts
+++ b/apps/renderer/src/store/subscription/store.ts
@@ -196,14 +196,13 @@ class SubscriptionActions {
state.listIds.add(subscription.listId)
} else if (subscription.inboxId) {
state.inboxIds.add(subscription.inboxId)
- } else {
- state.feedIdByView[subscription.view].push(subscription.feedId)
}
state.data[subscription.feedId] = omit(subscription, [
"feeds",
"lists",
"inboxes",
]) as SubscriptionFlatModel
+ state.feedIdByView[subscription.view].push(subscription.feedId)
})
})
}
From 6fe8dc910f65e096343ad732bd19fef34f18b01e Mon Sep 17 00:00:00 2001
From: DIYgod
Date: Mon, 24 Feb 2025 11:52:30 +0800
Subject: [PATCH 18/21] fix: lists fetch
---
.../entry-column/hooks/useEntriesByView.ts | 19 +-
apps/renderer/src/queries/entries.ts | 5 +-
apps/renderer/src/store/subscription/hooks.ts | 2 +-
packages/shared/src/hono.ts | 521 +++++++-----------
4 files changed, 210 insertions(+), 337 deletions(-)
diff --git a/apps/renderer/src/modules/entry-column/hooks/useEntriesByView.ts b/apps/renderer/src/modules/entry-column/hooks/useEntriesByView.ts
index 51b7633b2..f00c1be05 100644
--- a/apps/renderer/src/modules/entry-column/hooks/useEntriesByView.ts
+++ b/apps/renderer/src/modules/entry-column/hooks/useEntriesByView.ts
@@ -129,12 +129,8 @@ export const useEntriesByView = ({ onReset }: { onReset?: () => void }) => {
const sortEntries = useMemo(
() =>
- isCollection
- ? sortEntriesIdByStarAt(entryIds)
- : listId
- ? sortEntriesIdByEntryInsertedAt(entryIds)
- : sortEntriesIdByEntryPublishedAt(entryIds),
- [entryIds, isCollection, listId],
+ isCollection ? sortEntriesIdByStarAt(entryIds) : sortEntriesIdByEntryPublishedAt(entryIds),
+ [entryIds, isCollection],
)
const groupByDate = useGeneralSettingKey("groupByDate")
@@ -204,17 +200,6 @@ function sortEntriesIdByStarAt(entries: string[]) {
})
}
-function sortEntriesIdByEntryInsertedAt(entries: string[]) {
- const entriesId2Map = entryActions.getFlattenMapEntries()
- return entries
- .slice()
- .sort(
- (a, b) =>
- entriesId2Map[b]?.entries.insertedAt.localeCompare(entriesId2Map[a]?.entries.insertedAt!) ||
- 0,
- )
-}
-
const useFetchEntryContentByStream = (remoteEntryIds?: string[]) => {
const { mutate: updateEntryContent } = useMutation({
mutationKey: ["stream-entry-content", remoteEntryIds],
diff --git a/apps/renderer/src/queries/entries.ts b/apps/renderer/src/queries/entries.ts
index a42f845f1..8c0a3be2c 100644
--- a/apps/renderer/src/queries/entries.ts
+++ b/apps/renderer/src/queries/entries.ts
@@ -142,10 +142,7 @@ export const useEntries = ({
return useAuthInfiniteQuery(entries.entries({ feedId, inboxId, listId, view, read }), {
enabled: feedId !== undefined || inboxId !== undefined || listId !== undefined,
- getNextPageParam: (lastPage) =>
- listId
- ? lastPage.data?.at(-1)?.entries.insertedAt
- : lastPage.data?.at(-1)?.entries.publishedAt,
+ getNextPageParam: (lastPage) => lastPage.data?.at(-1)?.entries.publishedAt,
initialPageParam: undefined,
refetchOnWindowFocus: false,
refetchOnReconnect: false,
diff --git a/apps/renderer/src/store/subscription/hooks.ts b/apps/renderer/src/store/subscription/hooks.ts
index 32a3bd963..9ae21bd46 100644
--- a/apps/renderer/src/store/subscription/hooks.ts
+++ b/apps/renderer/src/store/subscription/hooks.ts
@@ -58,7 +58,7 @@ export const useCategoriesByView = (view: FeedViewType) =>
(state) =>
new Set(
subscriptionByViewSelector(view)(state)
- .map((subscription) => subscription!.category)
+ .map((subscription) => subscription?.category)
.filter((category) => category !== null && category !== undefined)
.filter(Boolean),
),
diff --git a/packages/shared/src/hono.ts b/packages/shared/src/hono.ts
index 9dfdb0c09..133c277c8 100644
--- a/packages/shared/src/hono.ts
+++ b/packages/shared/src/hono.ts
@@ -2984,164 +2984,6 @@ declare const subscriptionsRelations: drizzle_orm.Relations<"subscriptions", {
rsshubUsage: drizzle_orm.One<"rsshub_usage", true>;
}>;
-declare const timeline: drizzle_orm_pg_core.PgTableWithColumns<{
- name: "timeline";
- schema: undefined;
- columns: {
- userId: drizzle_orm_pg_core.PgColumn<{
- name: "user_id";
- tableName: "timeline";
- dataType: "string";
- columnType: "PgText";
- data: string;
- driverParam: string;
- notNull: true;
- hasDefault: false;
- isPrimaryKey: false;
- isAutoincrement: false;
- hasRuntimeDefault: false;
- enumValues: [string, ...string[]];
- baseColumn: never;
- identity: undefined;
- generated: undefined;
- }, {}, {}>;
- feedId: drizzle_orm_pg_core.PgColumn<{
- name: "feedId";
- tableName: "timeline";
- dataType: "string";
- columnType: "PgText";
- data: string;
- driverParam: string;
- notNull: true;
- hasDefault: false;
- isPrimaryKey: false;
- isAutoincrement: false;
- hasRuntimeDefault: false;
- enumValues: [string, ...string[]];
- baseColumn: never;
- identity: undefined;
- generated: undefined;
- }, {}, {}>;
- entryId: drizzle_orm_pg_core.PgColumn<{
- name: "entry_id";
- tableName: "timeline";
- dataType: "string";
- columnType: "PgText";
- data: string;
- driverParam: string;
- notNull: true;
- hasDefault: false;
- isPrimaryKey: false;
- isAutoincrement: false;
- hasRuntimeDefault: false;
- enumValues: [string, ...string[]];
- baseColumn: never;
- identity: undefined;
- generated: undefined;
- }, {}, {}>;
- publishedAt: drizzle_orm_pg_core.PgColumn<{
- name: "published_at";
- tableName: "timeline";
- dataType: "date";
- columnType: "PgTimestamp";
- data: Date;
- driverParam: string;
- notNull: true;
- hasDefault: false;
- isPrimaryKey: false;
- isAutoincrement: false;
- hasRuntimeDefault: false;
- enumValues: undefined;
- baseColumn: never;
- identity: undefined;
- generated: undefined;
- }, {}, {}>;
- insertedAt: drizzle_orm_pg_core.PgColumn<{
- name: "inserted_at";
- tableName: "timeline";
- dataType: "date";
- columnType: "PgTimestamp";
- data: Date;
- driverParam: string;
- notNull: true;
- hasDefault: false;
- isPrimaryKey: false;
- isAutoincrement: false;
- hasRuntimeDefault: false;
- enumValues: undefined;
- baseColumn: never;
- identity: undefined;
- generated: undefined;
- }, {}, {}>;
- view: drizzle_orm_pg_core.PgColumn<{
- name: "view";
- tableName: "timeline";
- dataType: "number";
- columnType: "PgSmallInt";
- data: number;
- driverParam: string | number;
- notNull: true;
- hasDefault: false;
- isPrimaryKey: false;
- isAutoincrement: false;
- hasRuntimeDefault: false;
- enumValues: undefined;
- baseColumn: never;
- identity: undefined;
- generated: undefined;
- }, {}, {}>;
- read: drizzle_orm_pg_core.PgColumn<{
- name: "read";
- tableName: "timeline";
- dataType: "boolean";
- columnType: "PgBoolean";
- data: boolean;
- driverParam: boolean;
- notNull: false;
- hasDefault: false;
- isPrimaryKey: false;
- isAutoincrement: false;
- hasRuntimeDefault: false;
- enumValues: undefined;
- baseColumn: never;
- identity: undefined;
- generated: undefined;
- }, {}, {}>;
- };
- dialect: "pg";
-}>;
-declare const timelineOpenAPISchema: zod.ZodObject<{
- userId: zod.ZodString;
- feedId: zod.ZodString;
- entryId: zod.ZodString;
- publishedAt: zod.ZodString;
- insertedAt: zod.ZodString;
- view: zod.ZodNumber;
- read: zod.ZodNullable;
-}, zod.UnknownKeysParam, zod.ZodTypeAny, {
- userId: string;
- view: number;
- feedId: string;
- insertedAt: string;
- publishedAt: string;
- entryId: string;
- read: boolean | null;
-}, {
- userId: string;
- view: number;
- feedId: string;
- insertedAt: string;
- publishedAt: string;
- entryId: string;
- read: boolean | null;
-}>;
-declare const timelineRelations: drizzle_orm.Relations<"timeline", {
- entries: drizzle_orm.One<"entries", true>;
- feeds: drizzle_orm.One<"feeds", true>;
- collections: drizzle_orm.One<"collections", true>;
- subscriptions: drizzle_orm.One<"subscriptions", true>;
-}>;
-
declare const inboxesEntries: drizzle_orm_pg_core.PgTableWithColumns<{
name: "inboxes_entries";
schema: undefined;
@@ -4561,6 +4403,7 @@ declare const listsRelations: drizzle_orm.Relations<"lists", {
owner: drizzle_orm.One<"user", true>;
listsSubscriptions: drizzle_orm.Many<"lists_subscriptions">;
}>;
+type ListModel = InferInsertModel;
declare const listsSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
name: "lists_subscriptions";
@@ -4634,23 +4477,6 @@ declare const listsSubscriptions: drizzle_orm_pg_core.PgTableWithColumns<{
identity: undefined;
generated: undefined;
}, {}, {}>;
- lastViewedAt: drizzle_orm_pg_core.PgColumn<{
- name: "last_viewed_at";
- tableName: "lists_subscriptions";
- dataType: "date";
- columnType: "PgTimestamp";
- data: Date;
- driverParam: string;
- notNull: false;
- hasDefault: false;
- isPrimaryKey: false;
- isAutoincrement: false;
- hasRuntimeDefault: false;
- enumValues: undefined;
- baseColumn: never;
- identity: undefined;
- generated: undefined;
- }, {}, {}>;
createdAt: drizzle_orm_pg_core.PgColumn<{
name: "created_at";
tableName: "lists_subscriptions";
@@ -4693,7 +4519,6 @@ declare const listsSubscriptionsOpenAPISchema: zod.ZodObject<{
listId: zod.ZodString;
view: zod.ZodNumber;
title: zod.ZodNullable;
- lastViewedAt: zod.ZodNullable;
createdAt: zod.ZodString;
isPrivate: zod.ZodBoolean;
}, zod.UnknownKeysParam, zod.ZodTypeAny, {
@@ -4703,7 +4528,6 @@ declare const listsSubscriptionsOpenAPISchema: zod.ZodObject<{
view: number;
isPrivate: boolean;
listId: string;
- lastViewedAt: string | null;
}, {
createdAt: string;
userId: string;
@@ -4711,109 +4535,12 @@ declare const listsSubscriptionsOpenAPISchema: zod.ZodObject<{
view: number;
isPrivate: boolean;
listId: string;
- lastViewedAt: string | null;
}>;
declare const listsSubscriptionsRelations: drizzle_orm.Relations<"lists_subscriptions", {
users: drizzle_orm.One<"user", true>;
lists: drizzle_orm.One<"lists", true>;
}>;
-declare const listsTimeline: drizzle_orm_pg_core.PgTableWithColumns<{
- name: "lists_timeline";
- schema: undefined;
- columns: {
- listId: drizzle_orm_pg_core.PgColumn<{
- name: "list_id";
- tableName: "lists_timeline";
- dataType: "string";
- columnType: "PgText";
- data: string;
- driverParam: string;
- notNull: true;
- hasDefault: false;
- isPrimaryKey: false;
- isAutoincrement: false;
- hasRuntimeDefault: false;
- enumValues: [string, ...string[]];
- baseColumn: never;
- identity: undefined;
- generated: undefined;
- }, {}, {}>;
- feedId: drizzle_orm_pg_core.PgColumn<{
- name: "feedId";
- tableName: "lists_timeline";
- dataType: "string";
- columnType: "PgText";
- data: string;
- driverParam: string;
- notNull: true;
- hasDefault: false;
- isPrimaryKey: false;
- isAutoincrement: false;
- hasRuntimeDefault: false;
- enumValues: [string, ...string[]];
- baseColumn: never;
- identity: undefined;
- generated: undefined;
- }, {}, {}>;
- entryId: drizzle_orm_pg_core.PgColumn<{
- name: "entry_id";
- tableName: "lists_timeline";
- dataType: "string";
- columnType: "PgText";
- data: string;
- driverParam: string;
- notNull: true;
- hasDefault: false;
- isPrimaryKey: false;
- isAutoincrement: false;
- hasRuntimeDefault: false;
- enumValues: [string, ...string[]];
- baseColumn: never;
- identity: undefined;
- generated: undefined;
- }, {}, {}>;
- insertedAt: drizzle_orm_pg_core.PgColumn<{
- name: "inserted_at";
- tableName: "lists_timeline";
- dataType: "date";
- columnType: "PgTimestamp";
- data: Date;
- driverParam: string;
- notNull: true;
- hasDefault: false;
- isPrimaryKey: false;
- isAutoincrement: false;
- hasRuntimeDefault: false;
- enumValues: undefined;
- baseColumn: never;
- identity: undefined;
- generated: undefined;
- }, {}, {}>;
- };
- dialect: "pg";
-}>;
-declare const listsTimelineOpenAPISchema: zod.ZodObject<{
- listId: zod.ZodString;
- feedId: zod.ZodString;
- entryId: zod.ZodString;
- insertedAt: zod.ZodString;
-}, zod.UnknownKeysParam, zod.ZodTypeAny, {
- feedId: string;
- insertedAt: string;
- entryId: string;
- listId: string;
-}, {
- feedId: string;
- insertedAt: string;
- entryId: string;
- listId: string;
-}>;
-declare const listsTimelineRelations: drizzle_orm.Relations<"lists_timeline", {
- entries: drizzle_orm.One<"entries", true>;
- feeds: drizzle_orm.One<"feeds", true>;
-}>;
-
declare const messaging: drizzle_orm_pg_core.PgTableWithColumns<{
name: "messaging";
schema: undefined;
@@ -5240,6 +4967,210 @@ declare const settings: drizzle_orm_pg_core.PgTableWithColumns<{
dialect: "pg";
}>;
+declare const timeline: drizzle_orm_pg_core.PgTableWithColumns<{
+ name: "timeline";
+ schema: undefined;
+ columns: {
+ userId: drizzle_orm_pg_core.PgColumn<{
+ name: "user_id";
+ tableName: "timeline";
+ dataType: "string";
+ columnType: "PgText";
+ data: string;
+ driverParam: string;
+ notNull: true;
+ hasDefault: false;
+ isPrimaryKey: false;
+ isAutoincrement: false;
+ hasRuntimeDefault: false;
+ enumValues: [string, ...string[]];
+ baseColumn: never;
+ identity: undefined;
+ generated: undefined;
+ }, {}, {}>;
+ feedId: drizzle_orm_pg_core.PgColumn<{
+ name: "feedId";
+ tableName: "timeline";
+ dataType: "string";
+ columnType: "PgText";
+ data: string;
+ driverParam: string;
+ notNull: true;
+ hasDefault: false;
+ isPrimaryKey: false;
+ isAutoincrement: false;
+ hasRuntimeDefault: false;
+ enumValues: [string, ...string[]];
+ baseColumn: never;
+ identity: undefined;
+ generated: undefined;
+ }, {}, {}>;
+ entryId: drizzle_orm_pg_core.PgColumn<{
+ name: "entry_id";
+ tableName: "timeline";
+ dataType: "string";
+ columnType: "PgText";
+ data: string;
+ driverParam: string;
+ notNull: true;
+ hasDefault: false;
+ isPrimaryKey: false;
+ isAutoincrement: false;
+ hasRuntimeDefault: false;
+ enumValues: [string, ...string[]];
+ baseColumn: never;
+ identity: undefined;
+ generated: undefined;
+ }, {}, {}>;
+ publishedAt: drizzle_orm_pg_core.PgColumn<{
+ name: "published_at";
+ tableName: "timeline";
+ dataType: "date";
+ columnType: "PgTimestamp";
+ data: Date;
+ driverParam: string;
+ notNull: true;
+ hasDefault: false;
+ isPrimaryKey: false;
+ isAutoincrement: false;
+ hasRuntimeDefault: false;
+ enumValues: undefined;
+ baseColumn: never;
+ identity: undefined;
+ generated: undefined;
+ }, {}, {}>;
+ insertedAt: drizzle_orm_pg_core.PgColumn<{
+ name: "inserted_at";
+ tableName: "timeline";
+ dataType: "date";
+ columnType: "PgTimestamp";
+ data: Date;
+ driverParam: string;
+ notNull: true;
+ hasDefault: false;
+ isPrimaryKey: false;
+ isAutoincrement: false;
+ hasRuntimeDefault: false;
+ enumValues: undefined;
+ baseColumn: never;
+ identity: undefined;
+ generated: undefined;
+ }, {}, {}>;
+ view: drizzle_orm_pg_core.PgColumn<{
+ name: "view";
+ tableName: "timeline";
+ dataType: "number";
+ columnType: "PgSmallInt";
+ data: number;
+ driverParam: string | number;
+ notNull: true;
+ hasDefault: false;
+ isPrimaryKey: false;
+ isAutoincrement: false;
+ hasRuntimeDefault: false;
+ enumValues: undefined;
+ baseColumn: never;
+ identity: undefined;
+ generated: undefined;
+ }, {}, {}>;
+ read: drizzle_orm_pg_core.PgColumn<{
+ name: "read";
+ tableName: "timeline";
+ dataType: "boolean";
+ columnType: "PgBoolean";
+ data: boolean;
+ driverParam: boolean;
+ notNull: false;
+ hasDefault: false;
+ isPrimaryKey: false;
+ isAutoincrement: false;
+ hasRuntimeDefault: false;
+ enumValues: undefined;
+ baseColumn: never;
+ identity: undefined;
+ generated: undefined;
+ }, {}, {}>;
+ from: drizzle_orm_pg_core.PgColumn<{
+ name: "from";
+ tableName: "timeline";
+ dataType: "array";
+ columnType: "PgArray";
+ data: string[];
+ driverParam: string | string[];
+ notNull: false;
+ hasDefault: false;
+ isPrimaryKey: false;
+ isAutoincrement: false;
+ hasRuntimeDefault: false;
+ enumValues: [string, ...string[]];
+ baseColumn: drizzle_orm.Column<{
+ name: "from";
+ tableName: "timeline";
+ dataType: "string";
+ columnType: "PgText";
+ data: string;
+ driverParam: string;
+ notNull: false;
+ hasDefault: false;
+ isPrimaryKey: false;
+ isAutoincrement: false;
+ hasRuntimeDefault: false;
+ enumValues: [string, ...string[]];
+ baseColumn: never;
+ identity: undefined;
+ generated: undefined;
+ }, {}, {}>;
+ identity: undefined;
+ generated: undefined;
+ }, {}, {
+ baseBuilder: drizzle_orm_pg_core.PgColumnBuilder<{
+ name: "from";
+ dataType: "string";
+ columnType: "PgText";
+ data: string;
+ enumValues: [string, ...string[]];
+ driverParam: string;
+ }, {}, {}, drizzle_orm.ColumnBuilderExtraConfig>;
+ size: undefined;
+ }>;
+ };
+ dialect: "pg";
+}>;
+declare const timelineOpenAPISchema: zod.ZodObject<{
+ userId: zod.ZodString;
+ feedId: zod.ZodString;
+ entryId: zod.ZodString;
+ publishedAt: zod.ZodString;
+ insertedAt: zod.ZodString;
+ view: zod.ZodNumber;
+ read: zod.ZodNullable;
+ from: zod.ZodNullable>;
+}, zod.UnknownKeysParam, zod.ZodTypeAny, {
+ userId: string;
+ view: number;
+ from: string[] | null;
+ feedId: string;
+ insertedAt: string;
+ publishedAt: string;
+ entryId: string;
+ read: boolean | null;
+}, {
+ userId: string;
+ view: number;
+ from: string[] | null;
+ feedId: string;
+ insertedAt: string;
+ publishedAt: string;
+ entryId: string;
+ read: boolean | null;
+}>;
+declare const timelineRelations: drizzle_orm.Relations<"timeline", {
+ entries: drizzle_orm.One<"entries", true>;
+ feeds: drizzle_orm.One<"feeds", true>;
+ collections: drizzle_orm.One<"collections", true>;
+ subscriptions: drizzle_orm.One<"subscriptions", true>;
+}>;
+
declare const user: drizzle_orm_pg_core.PgTableWithColumns<{
name: "user";
schema: undefined;
@@ -14313,7 +14244,6 @@ declare const _routes: hono_hono_base.HonoBase, "/">;
type AppType = typeof _routes;
-export { type ActionsModel, type AirdropActivity, type AppType, type AttachmentsModel, type AuthSession, type AuthUser, CommonEntryFields, type ConditionItem, type DetailModel, type EntriesModel, type EntryReadHistoriesModel, type ExtraModel, type FeedModel, type MediaModel, type MessagingData, MessagingType, type SettingsModel, type UrlReadsModel, account, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, activityEnum, airdrops, airdropsOpenAPISchema, attachmentsZodSchema, authPlugins, boosts, collections, collectionsOpenAPISchema, collectionsRelations, detailModelSchema, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, extraZodSchema, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsOpenAPISchema, feedsRelations, inboxHandleSchema, inboxes, inboxesEntries, inboxesEntriesInsertOpenAPISchema, type inboxesEntriesModel, inboxesEntriesOpenAPISchema, inboxesEntriesRelations, inboxesOpenAPISchema, inboxesRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, levels, levelsOpenAPISchema, levelsRelations, lists, listsOpenAPISchema, listsRelations, listsSubscriptions, listsSubscriptionsOpenAPISchema, listsSubscriptionsRelations, listsTimeline, listsTimelineOpenAPISchema, listsTimelineRelations, lower, mediaZodSchema, messaging, messagingOpenAPISchema, messagingRelations, rsshub, rsshubOpenAPISchema, rsshubPurchase, rsshubUsage, rsshubUsageOpenAPISchema, rsshubUsageRelations, session, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, twoFactor, urlReads, urlReadsOpenAPISchema, user, users, usersOpenApiSchema, usersRelations, verification, wallets, walletsOpenAPISchema, walletsRelations };
+export { type ActionsModel, type AirdropActivity, type AppType, type AttachmentsModel, type AuthSession, type AuthUser, CommonEntryFields, type ConditionItem, type DetailModel, type EntriesModel, type EntryReadHistoriesModel, type ExtraModel, type FeedModel, type ListModel, type MediaModel, type MessagingData, MessagingType, type SettingsModel, type UrlReadsModel, account, achievements, achievementsOpenAPISchema, actions, actionsItemOpenAPISchema, actionsOpenAPISchema, actionsRelations, activityEnum, airdrops, airdropsOpenAPISchema, attachmentsZodSchema, authPlugins, boosts, collections, collectionsOpenAPISchema, collectionsRelations, detailModelSchema, entries, entriesOpenAPISchema, entriesRelations, entryReadHistories, entryReadHistoriesOpenAPISchema, entryReadHistoriesRelations, extraZodSchema, feedPowerTokens, feedPowerTokensOpenAPISchema, feedPowerTokensRelations, feeds, feedsOpenAPISchema, feedsRelations, inboxHandleSchema, inboxes, inboxesEntries, inboxesEntriesInsertOpenAPISchema, type inboxesEntriesModel, inboxesEntriesOpenAPISchema, inboxesEntriesRelations, inboxesOpenAPISchema, inboxesRelations, invitations, invitationsOpenAPISchema, invitationsRelations, languageSchema, levels, levelsOpenAPISchema, levelsRelations, lists, listsOpenAPISchema, listsRelations, listsSubscriptions, listsSubscriptionsOpenAPISchema, listsSubscriptionsRelations, lower, mediaZodSchema, messaging, messagingOpenAPISchema, messagingRelations, rsshub, rsshubOpenAPISchema, rsshubPurchase, rsshubUsage, rsshubUsageOpenAPISchema, rsshubUsageRelations, session, settings, subscriptions, subscriptionsOpenAPISchema, subscriptionsRelations, timeline, timelineOpenAPISchema, timelineRelations, transactionType, transactions, transactionsOpenAPISchema, transactionsRelations, twoFactor, urlReads, urlReadsOpenAPISchema, user, users, usersOpenApiSchema, usersRelations, verification, wallets, walletsOpenAPISchema, walletsRelations };
From d07ec236e5c90165638ab341623400f8f661d49d Mon Sep 17 00:00:00 2001
From: DIYgod
Date: Mon, 24 Feb 2025 12:04:20 +0800
Subject: [PATCH 19/21] feat: optional daily
---
.../modules/power/my-wallet-section/index.tsx | 62 ++++++++++---------
1 file changed, 34 insertions(+), 28 deletions(-)
diff --git a/apps/renderer/src/modules/power/my-wallet-section/index.tsx b/apps/renderer/src/modules/power/my-wallet-section/index.tsx
index 6f153e56a..205822193 100644
--- a/apps/renderer/src/modules/power/my-wallet-section/index.tsx
+++ b/apps/renderer/src/modules/power/my-wallet-section/index.tsx
@@ -11,6 +11,7 @@ import { cn } from "@follow/utils/utils"
import { useMutation } from "@tanstack/react-query"
import { Trans, useTranslation } from "react-i18next"
+import { useServerConfigs } from "~/atoms/server-configs"
import { CopyButton } from "~/components/ui/button/CopyButton"
import { apiClient } from "~/lib/api-fetch"
import { getBlockchainExplorerUrl } from "~/lib/utils"
@@ -30,6 +31,7 @@ export const MyWalletSection = ({ className }: { className?: string }) => {
const wallet = useWallet()
const myWallet = wallet.data?.[0]
+ const serverConfigs = useServerConfigs()
const rewardDescriptionModal = useRewardDescriptionModal()
const refreshMutation = useMutation({
@@ -133,35 +135,39 @@ export const MyWalletSection = ({ className }: { className?: string }) => {
-
-
- {t("wallet.power.rewardDescription")}
-
-
- {BigInt(myWallet.todayDailyPower || 0n)}
-
- ),
- Link: ,
- }}
- />
-
-
-
-
-
-
+ {!!serverConfigs?.DAILY_POWER_SUPPLY && (
+ <>
+
+
+
{t("wallet.power.rewardDescription")}
+
+
+ {BigInt(myWallet.todayDailyPower || 0n)}
+
+ ),
+ Link: ,
+ }}
+ />
-
-
{BigInt(myWallet.todayDailyPower || 0n)}
-
-
-
+
+
+
+
+
{BigInt(myWallet.todayDailyPower || 0n)}
+
+
+
+ >
+ )}
)
}
From 0aa0daca97d4583ed294463ec7d92f70a24dc996 Mon Sep 17 00:00:00 2001
From: DIYgod
Date: Mon, 24 Feb 2025 12:07:37 +0800
Subject: [PATCH 20/21] chore(release): release v0.3.7
---
CHANGELOG.md | 22 +++++++++++++++++++---
changelog/0.3.7.md | 7 +++++++
package.json | 4 ++--
3 files changed, 28 insertions(+), 5 deletions(-)
create mode 100644 changelog/0.3.7.md
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8f2ac850e..ce52d211c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,6 +1,6 @@
# CHANGELOG
-## [0.3.6](https://github.com/RSSNext/follow/compare/v0.2.7-beta.0...v0.3.6) (2025-02-20)
+## [0.3.7](https://github.com/RSSNext/follow/compare/v0.2.7-beta.0...v0.3.7) (2025-02-24)
### Bug Fixes
@@ -224,6 +224,8 @@
* lint ([dafaf0a](https://github.com/RSSNext/follow/commit/dafaf0a97d40a6df659a7869d7c11f5cf529dfe7))
* list form width ([6487be1](https://github.com/RSSNext/follow/commit/6487be1c9f8c085f6722595d59f85d1176c503c5))
* list unread dot position ([dad33a1](https://github.com/RSSNext/follow/commit/dad33a12db4b270801da6b8c621b3049e6672c27))
+* **listEntryCover:** fix the cover mistakely render as audio ([#2813](https://github.com/RSSNext/follow/issues/2813)) ([e73eb54](https://github.com/RSSNext/follow/commit/e73eb540ed8f9325392ba6ba5829350ee27ed31e))
+* lists fetch ([6fe8dc9](https://github.com/RSSNext/follow/commit/6fe8dc910f65e096343ad732bd19fef34f18b01e))
* **lists:** fix duplicate addition issue in manage feeds functionality ([#2544](https://github.com/RSSNext/follow/issues/2544)) ([d77ed3c](https://github.com/RSSNext/follow/commit/d77ed3cb37424e97490bbf4883f9326acc446d54))
* load dynamic render assets ([3499535](https://github.com/RSSNext/follow/commit/3499535b4091e3a82734c416528b0766e70f0b63))
* load instagram image fail ([f8fd58f](https://github.com/RSSNext/follow/commit/f8fd58f78ec11bc221eb9190ac7b6a66dd858f9c)), closes [#1539](https://github.com/RSSNext/follow/issues/1539)
@@ -249,10 +251,14 @@
* missing translation in pitcure masonry ([902d681](https://github.com/RSSNext/follow/commit/902d68180d1cc872cbe4435efbcae108f0d732b5))
* mobile need login modal ([0fb16f2](https://github.com/RSSNext/follow/commit/0fb16f2352e9776731522204b838be59f66127a4))
* mobile pop back to entry list will refresh data ([3c18768](https://github.com/RSSNext/follow/commit/3c18768968aeb4635933ae616c52de55b6fad2ab))
+* **mobile:** auth redirect and 2fa support ([#2829](https://github.com/RSSNext/follow/issues/2829)) ([cc51d86](https://github.com/RSSNext/follow/commit/cc51d861c92fe5cd884210aaefecc80bad581257))
* **mobile:** background color ([9f6934f](https://github.com/RSSNext/follow/commit/9f6934f844c995a1dcbb326123420e6ee9b05a96))
* **mobile:** can not load native module ([#2791](https://github.com/RSSNext/follow/issues/2791)) ([f226de5](https://github.com/RSSNext/follow/commit/f226de53ab664c252e7d0806dbfdfe91dcd8135d))
* **mobile:** context menu crash when released too quickly ([#2732](https://github.com/RSSNext/follow/issues/2732)) ([1327f56](https://github.com/RSSNext/follow/commit/1327f5671c61f901537193cfe2960b7189c0a5a6))
+* **mobile:** disable scroll-to-top for timeline view selector ([3b5fb5f](https://github.com/RSSNext/follow/commit/3b5fb5febeb4b49d7d2943a205af3c8e5f5c3b9d))
* **mobile:** improve responsive design in CornerPlayer ([949a07e](https://github.com/RSSNext/follow/commit/949a07ed0e3cb8b8ea582ebd926f143da7386736))
+* **mobile:** remove shadow from PlayerTabBar ([79631bb](https://github.com/RSSNext/follow/commit/79631bbcbc1212a307678b04dbfff93dda793b03))
+* **mobile:** revert ref bind for nav scroll view ref ([#2856](https://github.com/RSSNext/follow/issues/2856)) ([8a0049d](https://github.com/RSSNext/follow/commit/8a0049dc1585c72d9e79fe1471c52fc8851a124a))
* **mobile:** svg background transparent ([#2820](https://github.com/RSSNext/follow/issues/2820)) ([6b991d3](https://github.com/RSSNext/follow/commit/6b991d379e608e1686ce88022b7bb57d6de6d11d))
* **mobile:** unread style not working, bring views back ([#2765](https://github.com/RSSNext/follow/issues/2765)) ([fad9f94](https://github.com/RSSNext/follow/commit/fad9f944d57d5739d6edfa7749d9802438f361c8))
* **mobile:** update email login style ([9019e9b](https://github.com/RSSNext/follow/commit/9019e9bbc6ebcdcbd8a0f21844e04f1df17dd84a))
@@ -262,6 +268,7 @@
* modal bottom buttons align ([#1216](https://github.com/RSSNext/follow/issues/1216)) ([b97096d](https://github.com/RSSNext/follow/commit/b97096dbd06bb7687b6c1313de45d8e91dee25af))
* modal close button overlaps the select content ([#1166](https://github.com/RSSNext/follow/issues/1166)) ([3c103ed](https://github.com/RSSNext/follow/commit/3c103ed15daeb1f57a001d615c047c303087ba46))
* modal exiting transition type ([5bb0100](https://github.com/RSSNext/follow/commit/5bb01006ad04f8e5ed93076905b78b74ce293f79))
+* **modal:** adjust modal header drag and resize behavior ([38e8c6c](https://github.com/RSSNext/follow/commit/38e8c6c2f4517b550273f8f09cb136107d2bebf2))
* **modal:** close button can not click on electron ([c544dfc](https://github.com/RSSNext/follow/commit/c544dfcc8d4613e8d4f6025dd8a60cf679881680))
* **modal:** drawer modal layout symmetric padding ([7141e86](https://github.com/RSSNext/follow/commit/7141e869dfc9328e3eeeda909ea2ffc7e6dd0e34))
* **modal:** fixed close modal button position ([78e9424](https://github.com/RSSNext/follow/commit/78e942473fff309e372708b56a59a9009d5bb0e9))
@@ -539,6 +546,7 @@
* basic masonry entry list and entry content view ([#2493](https://github.com/RSSNext/follow/issues/2493)) ([e569681](https://github.com/RSSNext/follow/commit/e569681198cabbfeb4c8133e421533c37b1fd96d))
* bigger font size in mobile ([3e9a92d](https://github.com/RSSNext/follow/commit/3e9a92d16a80139c851671748367f009a3af4de9))
* bigger view selector ([973c0d2](https://github.com/RSSNext/follow/commit/973c0d214d13313372c4ced0c68ec3c85db4ef4b))
+* bring back lists in views ([aeaa29b](https://github.com/RSSNext/follow/commit/aeaa29b13b0466848d6b35d4a7da232834322888))
* bring rehypeUrlToAnchor back ([6f0cc4d](https://github.com/RSSNext/follow/commit/6f0cc4d566c9f2f552f0fedf1a8e570a817e0f56)), closes [#1373](https://github.com/RSSNext/follow/issues/1373)
* checkLanguage utils ([225e470](https://github.com/RSSNext/follow/commit/225e470db84649bd23657d82b3c6a71b94cccc5f))
* collection panel active button status ([a1676fc](https://github.com/RSSNext/follow/commit/a1676fc535430c3bd4c614a5261e3152e1bf2561))
@@ -637,11 +645,14 @@
* **mobile:** Add image headers for cross-origin image loading ([053517d](https://github.com/RSSNext/follow/commit/053517db633103fb0a7f8796684181f9f3d6688b))
* **mobile:** add loading indicator for infinite scroll in entry list ([22ac1be](https://github.com/RSSNext/follow/commit/22ac1be1a5a82a1453ef200b25c49ce4f6d93ca6))
* **mobile:** Add media preview accessories and no-media rendering support ([9113c0a](https://github.com/RSSNext/follow/commit/9113c0a2e53bdbc4c9b4e83f719198a83f6b7601))
+* **mobile:** add native iOS toast module with SPIndicator ([8dbb634](https://github.com/RSSNext/follow/commit/8dbb6343fb299a7b1e15288405d45bfb72dec09b))
* **mobile:** add PortalProvider to EntryContentWebView and adjust ActivityIndicator ([713dc47](https://github.com/RSSNext/follow/commit/713dc47531f3e5fb4247cc9dc278ae2c6de6cdc6))
* **mobile:** add preview image component with advanced gesture handling ([1d4e37e](https://github.com/RSSNext/follow/commit/1d4e37e35a36eaeacbea70723464a3759131cd2b))
* **mobile:** add reader inline style rendering option ([160eb14](https://github.com/RSSNext/follow/commit/160eb14258f24afe08f5103b237e4391c09bd93e))
+* **mobile:** add reusable MediaCarousel component ([48461f1](https://github.com/RSSNext/follow/commit/48461f15e68f584372e75d41c51775d86300518f))
* **mobile:** add social entry list component ([#2733](https://github.com/RSSNext/follow/issues/2733)) ([903b989](https://github.com/RSSNext/follow/commit/903b98953aa74fe472bf3793c6a4b8edbfe519bf))
* **mobile:** add triggerAsChild prop to EntryReadHistory component ([#2773](https://github.com/RSSNext/follow/issues/2773)) ([c7b1513](https://github.com/RSSNext/follow/commit/c7b151394a2e3cfb73bb1c16b7f40d8256e65718))
+* **mobile:** audio player ([#2801](https://github.com/RSSNext/follow/issues/2801)) ([8e2dfe9](https://github.com/RSSNext/follow/commit/8e2dfe99c87d868e67f466ad2ed1687e95bf6882))
* **mobile:** auto mark as read when scrolling ([#2781](https://github.com/RSSNext/follow/issues/2781)) ([c8f580c](https://github.com/RSSNext/follow/commit/c8f580c0a1f7228ebf390f293691213b762d4499))
* **mobile:** deletion button ([79b4703](https://github.com/RSSNext/follow/commit/79b47030260e7667e23e725b2337922139b6ae6b))
* **mobile:** enhance CORS handling and image loading in WebView ([ad06db9](https://github.com/RSSNext/follow/commit/ad06db9744f3b001a8bf0d004a1492e656091ab1))
@@ -649,17 +660,21 @@
* **mobile:** Enhance grid view with dynamic media rendering and improved item handling ([27818f6](https://github.com/RSSNext/follow/commit/27818f6559bfb5b95bf529e38814eb6b83ad0d29))
* **mobile:** enhance HTML renderer with image rendering and blurhash support ([b534667](https://github.com/RSSNext/follow/commit/b534667c059c7b60edaa9c0dfe6e2bfebe85fc7e))
* **mobile:** enhance iOS image preview with SDWebImage and improved QuickLook handling ([0011861](https://github.com/RSSNext/follow/commit/0011861e3f9155ba4c28864f9bd7f452fdc2942e))
+* **mobile:** enhance player UI with floating tab bar and control improvements ([577f07f](https://github.com/RSSNext/follow/commit/577f07f85e3e7556cae5652a24317a8842c92316))
* **mobile:** Enhance PreviewImage and EntryGridItem with interactive preview and animation ([bdff613](https://github.com/RSSNext/follow/commit/bdff6138676fe9c8c185861abfd03fa74f2f29c9))
+* **mobile:** enhance tab bar icon and label animations ([9c720a7](https://github.com/RSSNext/follow/commit/9c720a7d8c918234c9aef52405aca230b401c90e))
* **mobile:** entry list by feed or category; pagination ([#2717](https://github.com/RSSNext/follow/issues/2717)) ([a63bb82](https://github.com/RSSNext/follow/commit/a63bb82935336a7f8efb5bc7e75cc2f6463d0a3c))
* **mobile:** implement collection entry list ([#2787](https://github.com/RSSNext/follow/issues/2787)) ([c251aea](https://github.com/RSSNext/follow/commit/c251aeaf65c6a13668cbe984dedc49012a86eb98))
* **mobile:** Implement global image preview with advanced gestures ([113c404](https://github.com/RSSNext/follow/commit/113c4045b79a5b5d81d644f68222063b006a1f5f))
* **mobile:** implement native image preview with QuickLook on iOS ([975285e](https://github.com/RSSNext/follow/commit/975285ec30599fe297108c5aa3e8a163e9a27d14))
+* **mobile:** implement scroll-to-top functionality ([#2831](https://github.com/RSSNext/follow/issues/2831)) ([9b3439f](https://github.com/RSSNext/follow/commit/9b3439f71162824df7732f585a16dfc2e349ebdd))
* **mobile:** improve entry list and detail view with UI refinements ([a527987](https://github.com/RSSNext/follow/commit/a52798729ec378b71367d6b90c6e65687cbe75b3))
* **mobile:** introduce expo image ([9ea93b8](https://github.com/RSSNext/follow/commit/9ea93b80238f47788e0f984f03faf3c9a3434a81))
* **mobile:** load archive entries ([#2725](https://github.com/RSSNext/follow/issues/2725)) ([d8a796d](https://github.com/RSSNext/follow/commit/d8a796d3ab4ca79496aef6e6597d2f9108d40058))
* **mobile:** prefetch entry content ([03a1438](https://github.com/RSSNext/follow/commit/03a1438133ee809d15a757b300490de4c62f63a3))
* **mobile:** refactor EntryList to use pager view ([#2802](https://github.com/RSSNext/follow/issues/2802)) ([714a933](https://github.com/RSSNext/follow/commit/714a93336118c381ca7046c13f79e2e700ee9cfe))
* **mobile:** refresh control for entry list ([#2723](https://github.com/RSSNext/follow/issues/2723)) ([c01984d](https://github.com/RSSNext/follow/commit/c01984d50f0488b74893180a2a43ad59ba3ec36a))
+* **mobile:** render as read ([#2835](https://github.com/RSSNext/follow/issues/2835)) ([c0afb39](https://github.com/RSSNext/follow/commit/c0afb39788f72ef29bd814d97752fe438c3027e3))
* **mobile:** unread state for entry ([#2730](https://github.com/RSSNext/follow/issues/2730)) ([ddd6a2c](https://github.com/RSSNext/follow/commit/ddd6a2c8cdf8fc6a06acd52345eb8c5b157c2e12))
* **modal:** enhance Follow modal with improved navigation and loading state ([cf31c0f](https://github.com/RSSNext/follow/commit/cf31c0f5fae3fd6dac1e1e571e870ea57e05ed0b))
* move feed to new category in context menu ([#2072](https://github.com/RSSNext/follow/issues/2072)) ([d684e14](https://github.com/RSSNext/follow/commit/d684e14056581744ac78ca697fa5ca059294245e))
@@ -676,6 +691,7 @@
* optimize translation display ([3f01ce8](https://github.com/RSSNext/follow/commit/3f01ce87fae9e46fcbb330c24732c4733b9f7f59))
* optimize translation display ([75b9135](https://github.com/RSSNext/follow/commit/75b9135a02fb6e94abb5c0670c9f12f354a88f0e))
* optimize unread indicator styles ([f44b1a5](https://github.com/RSSNext/follow/commit/f44b1a5604af9ee1949f35af814dcda04af691d2))
+* optional daily ([d07ec23](https://github.com/RSSNext/follow/commit/d07ec236e5c90165638ab341623400f8f661d49d))
* **podcast:** add PodcastButton component to mobile float bar ([#2514](https://github.com/RSSNext/follow/issues/2514)) ([037791e](https://github.com/RSSNext/follow/commit/037791eae13bf0b9322eba332a852f73cd737bd0))
* prefer origin addresses for content images ([d4d4345](https://github.com/RSSNext/follow/commit/d4d43451dec839b64239e1835b2ac1a1aa2478be))
* **profile:** enhance email management and avatar fallback for better mobile support ([#2776](https://github.com/RSSNext/follow/issues/2776)) ([4295dec](https://github.com/RSSNext/follow/commit/4295decfa9869599386499e405e2e30ba2796a80))
@@ -927,8 +943,8 @@
* ci ([8852a81](https://github.com/RSSNext/follow/commit/8852a81d4cfe80a0704bcf52220c39e9ccbe98de))
* ci and tootip portal ([3729917](https://github.com/RSSNext/follow/commit/37299173c8fcaf88d44b1a54baf7ddc03aa20ca6))
* ci env `NODE_OPTIONS` max-old-space-size ([b4f9b1b](https://github.com/RSSNext/follow/commit/b4f9b1b8ea326b1613ca291ed5bbcd932c5e837a))
-* **ci:** cannot release macOS APP ([#957](https://github.com/RSSNext/follow/issues/957)) ([4a14738](https://github.com/RSSNext/follow/commit/4a14738a99c7fd26dbf22c8de968a6896cbdc28b)), closes [/github.com/actions/runner/issues/2958#issuecomment-2186602747](https://github.com//github.com/actions/runner/issues/2958/issues/issuecomment-2186602747)
-* **ci:** cannot release macOS APP ([#957](https://github.com/RSSNext/follow/issues/957)) ([#1078](https://github.com/RSSNext/follow/issues/1078)) ([cd00a20](https://github.com/RSSNext/follow/commit/cd00a2064228890f4891f5b15825d1f5a0d681e9)), closes [/github.com/actions/runner/issues/2958#issuecomment-2186602747](https://github.com//github.com/actions/runner/issues/2958/issues/issuecomment-2186602747)
+* **ci:** cannot release macOS APP ([#957](https://github.com/RSSNext/follow/issues/957)) ([4a14738](https://github.com/RSSNext/follow/commit/4a14738a99c7fd26dbf22c8de968a6896cbdc28b))
+* **ci:** cannot release macOS APP ([#957](https://github.com/RSSNext/follow/issues/957)) ([#1078](https://github.com/RSSNext/follow/issues/1078)) ([cd00a20](https://github.com/RSSNext/follow/commit/cd00a2064228890f4891f5b15825d1f5a0d681e9))
* **ci:** fetch all depth ([a504a12](https://github.com/RSSNext/follow/commit/a504a127bca93a6675b3ff02bcea0b1eca6e9707))
* **ci:** nightly build ([a4ce7b1](https://github.com/RSSNext/follow/commit/a4ce7b16f476b8d72a0b1761709ec1ceba591242))
* **ci:** nightly linux build ([702b1d9](https://github.com/RSSNext/follow/commit/702b1d976d52c49647d0433f2dd162c034d0abb4))
diff --git a/changelog/0.3.7.md b/changelog/0.3.7.md
new file mode 100644
index 000000000..c5a439b7e
--- /dev/null
+++ b/changelog/0.3.7.md
@@ -0,0 +1,7 @@
+# What's new in v0.3.7
+
+## New Features
+
+## Improvements
+
+## Bug Fixes
diff --git a/package.json b/package.json
index 9d0e0a786..e26c0ca3a 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "Follow",
"type": "module",
- "version": "0.3.6",
+ "version": "0.3.7",
"private": true,
"packageManager": "pnpm@9.12.3",
"description": "Follow everything in one place",
@@ -196,5 +196,5 @@
]
},
"productName": "Follow",
- "mainHash": "d2184ce595ab3b45f933edb9938b6a6fe53d8c85558d0899b9ffb8f72850cf25"
+ "mainHash": "ed3532be011d04d18a4148a025b6ae1282bd25aa8260f8aa7e9121f855d11314"
}
From 2f5d6c216854a1e336a130123a6ae0886b99a29b Mon Sep 17 00:00:00 2001
From: DIYgod
Date: Mon, 24 Feb 2025 12:38:37 +0800
Subject: [PATCH 21/21] docs: update changelog
---
changelog/0.3.7.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/changelog/0.3.7.md b/changelog/0.3.7.md
index c5a439b7e..f635253ca 100644
--- a/changelog/0.3.7.md
+++ b/changelog/0.3.7.md
@@ -2,6 +2,6 @@
## New Features
-## Improvements
-
-## Bug Fixes
+- Revert to the previous list display styles.
+ 
+- The entries of the list is now displayed directly in the timeline.