Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/desktop/changelog/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/layer/renderer/src/atoms/settings/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
// Discover
discoverLanguage: getDefaultLanguage().startsWith("zh") ? "all" : "eng",
accentColor: "orange",
showSearchButton: true,
})

const zenModeAtom = atom(false)
Expand Down Expand Up @@ -68,7 +69,7 @@
export const useIsZenMode = () => useAtomValue(zenModeAtom)
export const getIsZenMode = () => jotaiStore.get(zenModeAtom)

export const useSetZenMode = () => {

Check warning on line 72 in apps/desktop/layer/renderer/src/atoms/settings/ui.ts

View workflow job for this annotation

GitHub Actions / Format, Lint and Typecheck (lts/*)

If your function doesn't call any Hooks, avoid the 'use' prefix. Instead, write it as a regular function without the 'use' prefix

Check warning on line 72 in apps/desktop/layer/renderer/src/atoms/settings/ui.ts

View workflow job for this annotation

GitHub Actions / Format, Lint and Typecheck (lts/*)

If your function doesn't call any Hooks, avoid the 'use' prefix. Instead, write it as a regular function without the 'use' prefix
return setZenMode
}
export const setZenMode = (checked: boolean) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,15 @@ export const useIsShortcutConflict = (
}, [shortcut, excludeCommandId, overrideCommandShortcuts])
}

export const useCommandBinding = <T extends BindingCommandId>({
export const useCommandBinding = <T extends keyof typeof defaultCommandShortcuts>({
commandId,
when = true,
args,
}: Omit<RegisterHotkeyOptions<T>, "shortcut">) => {
const commandShortcut = useCommandShortcut(commandId)

return useCommandHotkey({
shortcut: commandShortcut,
commandId,
when,
args,
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -165,5 +165,16 @@ const SearchTrigger = () => {
{ preventDefault: true },
)

return null
const t = useI18n()
const showSearchButton = useUISettingKey("showSearchButton")

return showSearchButton ? (
<ActionButton
shortcut="$mod+K"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a customizable shortcut rather than a constant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image Added a setting spot

tooltip={t("words.search")}
onClick={() => setAppSearchOpen(true)}
>
<i className="i-mgc-search-3-cute-re text-text-secondary size-5" />
</ActionButton>
) : null
}
2 changes: 2 additions & 0 deletions locales/settings/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions locales/settings/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "購読リスト",
Expand Down
2 changes: 2 additions & 0 deletions locales/settings/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "订阅列表",
Expand Down
2 changes: 2 additions & 0 deletions locales/settings/zh-TW.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "訂閱列表",
Expand Down
1 change: 1 addition & 0 deletions packages/internal/shared/src/settings/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const defaultGeneralSettings: GeneralSettings = {

export const defaultUISettings: UISettings = {
accentColor: "orange",
showSearchButton: true,

// Sidebar
entryColWidth: 356,
Expand Down
1 change: 1 addition & 0 deletions packages/internal/shared/src/settings/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export interface UISettings {
guessCodeLanguage: boolean
hideRecentReader: boolean
customCSS: string
showSearchButton: boolean

// view
pictureViewMasonry: boolean
Expand Down
Loading