Skip to content

Commit 3e9aba7

Browse files
committed
feat: add notification indicator to version number for new announcements
1 parent 6fd261d commit 3e9aba7

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
117117
soundEnabled,
118118
soundVolume,
119119
cloudIsAuthenticated,
120+
shouldShowAnnouncement,
120121
} = useExtensionState()
121122

122123
const messagesRef = useRef(messages)
@@ -1829,6 +1830,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
18291830
<VersionIndicator
18301831
onClick={() => setShowAnnouncementModal(true)}
18311832
className="absolute top-2 right-3 z-10"
1833+
showNotification={shouldShowAnnouncement}
18321834
/>
18331835

18341836
<RooHero />

webview-ui/src/components/common/VersionIndicator.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,24 @@ import { Package } from "@roo/package"
55
interface VersionIndicatorProps {
66
onClick: () => void
77
className?: string
8+
showNotification?: boolean
89
}
910

10-
const VersionIndicator: React.FC<VersionIndicatorProps> = ({ onClick, className = "" }) => {
11+
const VersionIndicator: React.FC<VersionIndicatorProps> = ({ onClick, className = "", showNotification = false }) => {
1112
const { t } = useTranslation()
1213

1314
return (
1415
<button
1516
onClick={onClick}
16-
className={`text-xs text-vscode-descriptionForeground hover:text-vscode-foreground transition-colors cursor-pointer px-2 py-1 rounded border ${className}`}
17+
className={`relative text-xs text-vscode-descriptionForeground hover:text-vscode-foreground transition-colors cursor-pointer px-2 py-1 rounded border ${className}`}
1718
aria-label={t("chat:versionIndicator.ariaLabel", { version: Package.version })}>
1819
v{Package.version}
20+
{showNotification && (
21+
<span
22+
className="absolute -top-1 -right-1 w-2 h-2 bg-vscode-badge-background rounded-full animate-pulse"
23+
aria-label={t("chat:versionIndicator.newAnnouncement")}
24+
/>
25+
)}
1926
</button>
2027
)
2128
}

0 commit comments

Comments
 (0)