Files
awoooi/apps/web/src/app/providers.tsx
OG T 89db96fc21
Some checks failed
CD Pipeline / build-and-deploy (push) Has been cancelled
feat(web): ⌘K Command Palette — 全局指令面板 + 高斯模糊
- ⌘K (Mac) / Ctrl+K (其他) 開啟/關閉
- 高斯模糊背景 (backdrop-blur 8px + rgba overlay)
- 搜尋過濾:導航 9 頁 + 快速動作(開 Terminal)
- 鍵盤完整支援:↑↓ 選擇 / Enter 執行 / Esc 關閉
- 滑鼠 hover 同步 activeIdx
- 100% i18n (commandPalette namespace)
- Z-Index: DIALOG(70),掛載於 providers.tsx 全局層

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 23:28:36 +08:00

33 lines
885 B
TypeScript

'use client'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { useState } from 'react'
import { ToastProvider, ToastInitializer } from '@/components/ui/toast'
import { OmniTerminal } from '@/components/terminal/OmniTerminal'
import { CommandPalette } from '@/components/command-palette/CommandPalette'
export function Providers({ children }: { children: React.ReactNode }) {
const [queryClient] = useState(
() =>
new QueryClient({
defaultOptions: {
queries: {
staleTime: 60 * 1000, // 1 minute
refetchOnWindowFocus: false,
},
},
})
)
return (
<QueryClientProvider client={queryClient}>
<ToastProvider>
<ToastInitializer />
{children}
<OmniTerminal />
<CommandPalette />
</ToastProvider>
</QueryClientProvider>
)
}