diff --git a/apps/desktop/changelog/next.md b/apps/desktop/changelog/next.md index fc6b11e21a..b5f932781a 100644 --- a/apps/desktop/changelog/next.md +++ b/apps/desktop/changelog/next.md @@ -2,6 +2,7 @@ ## Shiny new things +- add a button to open the search panel (#4296) - AI Chat for RSS (Folo AI): A personalized, context-aware chat built for readers. The assistant understands your feeds, lists, and reading patterns to help you get more from what you follow. - Summarize articles, translate content, and get quick explanations—without leaving your timeline. - Ask feed-aware questions (e.g., “What did I miss this week?”) and receive suggestions tailored to your habits. diff --git a/apps/desktop/layer/renderer/src/atoms/settings/ui.ts b/apps/desktop/layer/renderer/src/atoms/settings/ui.ts index c864fe8381..36bcc955fd 100644 --- a/apps/desktop/layer/renderer/src/atoms/settings/ui.ts +++ b/apps/desktop/layer/renderer/src/atoms/settings/ui.ts @@ -18,6 +18,7 @@ export const createDefaultUISettings = (): UISettings => ({ // Discover discoverLanguage: getDefaultLanguage().startsWith("zh") ? "all" : "eng", accentColor: "orange", + showSearchButton: true, }) const zenModeAtom = atom(false) diff --git a/apps/desktop/layer/renderer/src/modules/command/commands/global.tsx b/apps/desktop/layer/renderer/src/modules/command/commands/global.tsx index fe9da08261..864326b660 100644 --- a/apps/desktop/layer/renderer/src/modules/command/commands/global.tsx +++ b/apps/desktop/layer/renderer/src/modules/command/commands/global.tsx @@ -94,8 +94,14 @@ export type ToggleAIChatCommand = Command<{ fn: (ctx?: { entryId?: string }) => void }> +export type ToggleAIChatPinnedCommand = Command<{ + id: typeof COMMAND_ID.global.toggleAIChatPinned + fn: () => void +}> + export type GlobalCommand = | ShowShortcutsCommand | ToggleCornerPlayCommand | QuickAddCommand + | ToggleAIChatPinnedCommand | ToggleAIChatCommand diff --git a/apps/desktop/layer/renderer/src/modules/command/commands/id.ts b/apps/desktop/layer/renderer/src/modules/command/commands/id.ts index e1b03ccc63..853dc78c93 100644 --- a/apps/desktop/layer/renderer/src/modules/command/commands/id.ts +++ b/apps/desktop/layer/renderer/src/modules/command/commands/id.ts @@ -50,6 +50,7 @@ export const COMMAND_ID = { toggleCornerPlay: "global:toggle-corner-play", quickAdd: "global:quick-add", toggleAIChat: "global:toggle-ai-chat", + toggleAIChatPinned: "global:toggle-ai-chat-pinned", }, layout: { toggleSubscriptionColumn: "layout:toggle-subscription-column", diff --git a/apps/desktop/layer/renderer/src/modules/command/hooks/use-command-binding.ts b/apps/desktop/layer/renderer/src/modules/command/hooks/use-command-binding.ts index f26dfc4150..7863674a28 100644 --- a/apps/desktop/layer/renderer/src/modules/command/hooks/use-command-binding.ts +++ b/apps/desktop/layer/renderer/src/modules/command/hooks/use-command-binding.ts @@ -201,10 +201,9 @@ export const useIsShortcutConflict = ( }, [shortcut, excludeCommandId, overrideCommandShortcuts]) } -export const useCommandBinding = ({ +export const useCommandBinding = ({ commandId, when = true, - args, }: Omit, "shortcut">) => { const commandShortcut = useCommandShortcut(commandId) @@ -212,6 +211,5 @@ export const useCommandBinding = ({ shortcut: commandShortcut, commandId, when, - args, }) } diff --git a/apps/desktop/layer/renderer/src/modules/settings/tabs/appearance.tsx b/apps/desktop/layer/renderer/src/modules/settings/tabs/appearance.tsx index f436e00328..f9223be055 100644 --- a/apps/desktop/layer/renderer/src/modules/settings/tabs/appearance.tsx +++ b/apps/desktop/layer/renderer/src/modules/settings/tabs/appearance.tsx @@ -75,6 +75,10 @@ export const SettingAppearance = () => { label: t("appearance.unread_count.sidebar.title"), description: t("appearance.unread_count.sidebar.description"), }), + defineItem("showSearchButton", { + label: t("appearance.show_search_button.label"), + description: t("appearance.show_search_button.description"), + }), defineItem("hideExtraBadge", { label: t("appearance.hide_extra_badge.label"), description: t("appearance.hide_extra_badge.description"), diff --git a/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionColumnHeader.tsx b/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionColumnHeader.tsx index f29d0f2d32..def5415976 100644 --- a/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionColumnHeader.tsx +++ b/apps/desktop/layer/renderer/src/modules/subscription-column/SubscriptionColumnHeader.tsx @@ -13,7 +13,7 @@ import { Link } from "react-router" import { toast } from "sonner" import { setAppSearchOpen } from "~/atoms/app" -import { useIsZenMode, useSetZenMode } from "~/atoms/settings/ui" +import { useIsZenMode, useSetZenMode, useUISettingKey } from "~/atoms/settings/ui" import { setTimelineColumnShow, useTimelineColumnShow } from "~/atoms/sidebar" import { DropdownMenu, @@ -165,5 +165,16 @@ const SearchTrigger = () => { { preventDefault: true }, ) - return null + const t = useI18n() + const showSearchButton = useUISettingKey("showSearchButton") + + return showSearchButton ? ( + setAppSearchOpen(true)} + > + + + ) : null } diff --git a/locales/settings/en.json b/locales/settings/en.json index aca78d263b..3040090005 100644 --- a/locales/settings/en.json +++ b/locales/settings/en.json @@ -158,6 +158,8 @@ "appearance.reduce_motion.description": "Reducing the Motion of Elements to Improve Performance and Reduce Energy Consumption", "appearance.reduce_motion.label": "Reduce Motion", "appearance.save": "Save", + "appearance.show_search_button.description": "Whether to display the search button on the homepage", + "appearance.show_search_button.label": "Show Search Button", "appearance.sidebar": "Sidebar", "appearance.sidebar_title": "Appearance", "appearance.subscription_list.title": "Subscription List", diff --git a/locales/settings/ja.json b/locales/settings/ja.json index ddf775eb32..956c2d66b2 100644 --- a/locales/settings/ja.json +++ b/locales/settings/ja.json @@ -158,6 +158,8 @@ "appearance.reduce_motion.description": "要素の動きを減らして、パフォーマンスを向上させ、エネルギー消費を抑えます", "appearance.reduce_motion.label": "動きを減らす", "appearance.save": "保存", + "appearance.show_search_button.description": "ホームページに検索ボタンを表示するかどうか", + "appearance.show_search_button.label": "検索ボタンを表示", "appearance.sidebar": "サイドバー", "appearance.sidebar_title": "外観", "appearance.subscription_list.title": "購読リスト", diff --git a/locales/settings/zh-CN.json b/locales/settings/zh-CN.json index 85bf108407..2a5170b88a 100644 --- a/locales/settings/zh-CN.json +++ b/locales/settings/zh-CN.json @@ -158,6 +158,8 @@ "appearance.reduce_motion.description": "减弱动态效果以提高整体性能并减少电量消耗。", "appearance.reduce_motion.label": "减弱动态效果", "appearance.save": "保存", + "appearance.show_search_button.description": "是否在主页显示搜索按钮", + "appearance.show_search_button.label": "显示搜索按钮", "appearance.sidebar": "侧边栏", "appearance.sidebar_title": "外观", "appearance.subscription_list.title": "订阅列表", diff --git a/locales/settings/zh-TW.json b/locales/settings/zh-TW.json index f4d684e659..fe471113b4 100644 --- a/locales/settings/zh-TW.json +++ b/locales/settings/zh-TW.json @@ -145,6 +145,8 @@ "appearance.reduce_motion.description": "減少元素的動畫效果以提升效能並降低功耗。", "appearance.reduce_motion.label": "減少動畫", "appearance.save": "儲存", + "appearance.show_search_button.description": "是否在主頁顯示搜尋按鈕", + "appearance.show_search_button.label": "顯示搜尋按鈕", "appearance.sidebar": "側邊欄", "appearance.sidebar_title": "外觀", "appearance.subscription_list.title": "訂閱列表", diff --git a/packages/internal/shared/src/settings/defaults.ts b/packages/internal/shared/src/settings/defaults.ts index 6c6bcf73b8..4239dd67bf 100644 --- a/packages/internal/shared/src/settings/defaults.ts +++ b/packages/internal/shared/src/settings/defaults.ts @@ -45,6 +45,7 @@ export const defaultGeneralSettings: GeneralSettings = { export const defaultUISettings: UISettings = { accentColor: "orange", + showSearchButton: true, // Sidebar entryColWidth: 356, diff --git a/packages/internal/shared/src/settings/interface.ts b/packages/internal/shared/src/settings/interface.ts index e659d38630..7ed9c6b594 100644 --- a/packages/internal/shared/src/settings/interface.ts +++ b/packages/internal/shared/src/settings/interface.ts @@ -71,6 +71,7 @@ export interface UISettings { guessCodeLanguage: boolean hideRecentReader: boolean customCSS: string + showSearchButton: boolean // view pictureViewMasonry: boolean