fix: minor fixes to tips

This commit is contained in:
Nikhil Sonti
2026-02-11 10:58:32 -08:00
parent 27c9a9748e
commit d6b02703df
2 changed files with 32 additions and 18 deletions

View File

@@ -1,13 +1,23 @@
import { Lightbulb, X } from 'lucide-react'
import { ChevronRight, Lightbulb, X } from 'lucide-react'
import { AnimatePresence, motion } from 'motion/react'
import { type FC, useMemo, useState } from 'react'
import { type FC, useState } from 'react'
import { NEWTAB_TIP_DISMISSED_EVENT } from '@/lib/constants/analyticsEvents'
import { track } from '@/lib/metrics/track'
import { dismissTip, getRandomTip, shouldShowTip } from './tips'
import { dismissTip, shouldShowTip, TIPS } from './tips'
export const NewTabTip: FC = () => {
const tip = useMemo(() => getRandomTip(), [])
const [visible, setVisible] = useState(() => tip !== null && shouldShowTip())
const [index, setIndex] = useState(() =>
Math.floor(Math.random() * TIPS.length),
)
const [visible, setVisible] = useState(
() => TIPS.length > 0 && shouldShowTip(),
)
const tip = TIPS[index]
const handleNext = () => {
setIndex((prev) => (prev + 1) % TIPS.length)
}
const handleDismiss = () => {
setVisible(false)
@@ -33,10 +43,19 @@ export const NewTabTip: FC = () => {
</span>{' '}
{tip.text}
</p>
<button
type="button"
onClick={handleNext}
className="flex-shrink-0 rounded-sm p-0.5 text-muted-foreground/50 opacity-0 transition-all hover:text-muted-foreground group-hover:opacity-100"
title="Next tip"
>
<ChevronRight className="h-3 w-3" />
</button>
<button
type="button"
onClick={handleDismiss}
className="flex-shrink-0 rounded-sm p-0.5 text-muted-foreground/50 opacity-0 transition-all hover:text-muted-foreground group-hover:opacity-100"
title="Dismiss"
>
<X className="h-3 w-3" />
</button>

View File

@@ -11,18 +11,13 @@ const TIP_DISMISSED_KEY = 'tip-dismissed-session'
export const TIPS: Tip[] = [
{
id: 'chat-any-page',
text: 'Press Option+K to open the AI Chat panel on any webpage — it includes full page context.',
shortcut: 'K',
},
{
id: 'compare-models',
text: 'Press Cmd+Shift+U to open LLM Hub and query multiple AI models side-by-side.',
shortcut: '⌘⇧U',
text: 'Press Ctrl+Shift+K (Cmd+Shift+K on Mac) to open the AI Chat panel on any webpage.',
shortcut: '⌃⇧K',
},
{
id: 'switch-models',
text: 'Press Option+L to cycle between AI providers without closing the chat panel.',
shortcut: 'L',
text: 'Press Ctrl+Shift+L (Cmd+Shift+L on Mac) to cycle between AI providers without closing the chat panel.',
shortcut: '⌃⇧L',
},
{
id: 'screenshot-chat',
@@ -42,7 +37,7 @@ export const TIPS: Tip[] = [
},
{
id: 'background-tasks',
text: 'Scheduled tasks run in a hidden window so they never interrupt your browsing.',
text: 'Scheduled tasks run in a seperate window so they never interrupt your browsing.',
},
{
id: 'claude-code-mcp',
@@ -58,7 +53,7 @@ export const TIPS: Tip[] = [
},
{
id: 'ad-blocking',
text: 'BrowserOS comes with uBlock Origin pre-enabled — blocking 10x more ads than Chrome out of the box.',
text: 'BrowserOS supports uBlock Origin for ad blocking — install it from the Chrome Web Store or GitHub.',
},
{
id: 'at-mention-tabs',
@@ -69,8 +64,8 @@ export const TIPS: Tip[] = [
text: 'For complex repeatable tasks, build visual Workflows instead of one-off prompts for consistent results.',
},
{
id: 'model-selection',
text: 'Use Gemini Flash for quick questions and Claude Opus for complex multi-step agent tasks.',
id: 'mode-selection',
text: 'Use Chat mode for read-only operations like questions and summaries, and Agent mode for multi-step browser tasks.',
},
]