fix(navigation): use keyboard to navigation select between feed and folder

- Removed unused export of FeedCategory to streamline the component structure.
- Added import for target from happy-dom in FeedList for improved functionality.
- Implemented cleanup of selected feed IDs when a category or folder is targeted in FeedList.

These changes enhance code clarity and maintainability in the timeline column components.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei 2025-05-15 22:07:02 +08:00
parent 331f8d8022
commit 1e71cd5a59
No known key found for this signature in database
GPG Key ID: 0F62D33977F021F7
2 changed files with 6 additions and 3 deletions

View File

@ -164,7 +164,6 @@ function FeedCategoryImpl({ data: ids, view, categoryOpenStateData }: FeedCatego
})
const [isCategoryEditing, setIsCategoryEditing] = useState(false)
const [isContextMenuOpen, setIsContextMenuOpen] = useState(false)
const isCategoryIsWaiting = isChangePending
@ -373,8 +372,6 @@ function FilterReadFeedCategory(props: FeedCategoryProps) {
return <FeedCategoryImpl {...props} />
}
export const FeedCategory = memo(FeedCategoryImpl)
export function FeedCategoryAutoHideUnread(props: FeedCategoryProps) {
const hideAllReadSubscriptions = useGeneralSettingKey("hideAllReadSubscriptions")
const unreadOnly = useGeneralSettingKey("unreadOnly")

View File

@ -31,6 +31,7 @@ import { useIsPreviewFeed } from "../entry-column/hooks/useIsPreviewFeed"
import {
resetSelectedFeedIds,
setFeedAreaScrollProgressValue,
setSelectedFeedIds,
useSelectedFeedIdsState,
} from "./atom"
import { DraggableContext } from "./context"
@ -346,6 +347,11 @@ const useRegisterCommand = () => {
const targetElement = allSubscriptions[targetIndex] as HTMLElement | null
// Cleanup selected feed
const targetIsCategoryOrFolder = targetElement?.dataset.sub?.startsWith("feed-category-")
if (targetIsCategoryOrFolder) {
setSelectedFeedIds([])
}
targetElement?.click()
}