fix(ui): improve WhatsNew modal design and responsiveness (#8155)

- Add side spacing for small viewports (calc(100%-2rem) instead of w-full)
- Apply rounded corners at all viewport sizes (not just sm:)
- Remove redundant "NEW" badge (title already says "New in v...")
- Remove redundant "Dismiss" button (X close button is sufficient)
- Reduce excess bottom padding for tighter layout
- Add cursor-pointer to dialog close button for better UX
- Clean up unused imports (PLATFORM_CONFIG, PlatformType, isVscode)
This commit is contained in:
Saoud Rizwan authored and GitHub committed 2025-12-17 05:25:33 -08:00
1 parent c090f5b1a7
commit 1ed4d00a16
2 files changed
+11 -31

No files matched your search

@@ -3,7 +3,6 @@ import { EmptyRequest } from "@shared/proto/cline/common"
import React, { useCallback, useRef } from "react"
import { useMount } from "react-use"
import { Dialog, DialogContent } from "@/components/ui/dialog"
import { PLATFORM_CONFIG, PlatformType } from "@/config/platform.config"
import { useClineAuth } from "@/context/ClineAuthContext"
import { useExtensionState } from "@/context/ExtensionStateContext"
import { AccountServiceClient } from "@/services/grpc-client"
@@ -16,7 +15,6 @@ interface WhatsNewModalProps {
}
export const WhatsNewModal: React.FC<WhatsNewModalProps> = ({ open, onClose, version }) => {
const isVscode = PLATFORM_CONFIG.type === PlatformType.VSCODE
const { clineUser } = useClineAuth()
const { openRouterModels, setShowChatModelSelector, refreshOpenRouterModels } = useExtensionState()
const { handleFieldsChange } = useApiConfigurationHandlers()
@@ -65,7 +63,7 @@ export const WhatsNewModal: React.FC<WhatsNewModalProps> = ({ open, onClose, ver
const AuthButton: React.FC<{ children: React.ReactNode }> = ({ children }) =>
clineUser ? (
<div className="flex gap-2 flex-wrap my-1.5">{children}</div>
<div className="flex gap-2 flex-wrap">{children}</div>
) : (
<Button className="my-1" onClick={handleShowAccount} size="sm">
Sign Up with Cline
@@ -74,31 +72,20 @@ export const WhatsNewModal: React.FC<WhatsNewModalProps> = ({ open, onClose, ver
return (
<Dialog onOpenChange={(isOpen) => !isOpen && onClose()} open={open}>
<DialogContent aria-describedby="whats-new-description" aria-labelledby="whats-new-title" className="p-0 gap-0">
{/* Content area */}
<div className="p-5 pr-10" id="whats-new-description">
{/* Badge */}
<div className="mb-3">
<span
className="px-2 py-1 text-xs font-semibold rounded"
style={{
backgroundColor: "color-mix(in srgb, var(--vscode-button-background) 30%, transparent)",
color: "var(--vscode-button-foreground)",
}}>
NEW
</span>
</div>
{/* Title */}
<DialogContent
aria-describedby="whats-new-description"
aria-labelledby="whats-new-title"
className="pt-5 px-5 pb-4 gap-0">
<div id="whats-new-description">
<h2
className="text-lg font-semibold mb-3"
className="text-lg font-semibold mb-3 pr-6"
id="whats-new-title"
style={{ color: "var(--vscode-editor-foreground)" }}>
🎉 New in v{version}
</h2>
{/* Description */}
<ul className="text-sm mb-3 pl-3 list-disc" style={{ color: "var(--vscode-descriptionForeground)" }}>
<ul className="text-sm pl-3 list-disc" style={{ color: "var(--vscode-descriptionForeground)" }}>
<li className="mb-2">
<strong>Cline provider</strong> now runs on the Vercel AI Gateway for better latency and fewer errors.
</li>
@@ -109,7 +96,7 @@ export const WhatsNewModal: React.FC<WhatsNewModalProps> = ({ open, onClose, ver
<ModelButton label="Try GLM-4.6" modelId="z-ai/glm-4.6" />
</AuthButton>
</li>
<li className="mb-2">
<li>
<strong>Kat-Coder Pro</strong>, free for a limited time!
<br />
<AuthButton>
@@ -117,13 +104,6 @@ export const WhatsNewModal: React.FC<WhatsNewModalProps> = ({ open, onClose, ver
</AuthButton>
</li>
</ul>
{/* Action button */}
<div className="flex gap-3 pt-4 border-t-1 border-description/20">
<Button data-testid="close-whats-new-modal" onClick={onClose} size="sm" variant="secondary">
Dismiss
</Button>
</div>
</div>
</DialogContent>
</Dialog>
+2 -2
View File
@@ -37,14 +37,14 @@ const DialogContent = React.forwardRef<React.ElementRef<typeof DialogPrimitive.C
<DialogOverlay />
<DialogPrimitive.Content
className={cn(
"fixed left-[50%] top-[35%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-35%] gap-4 border border-input-placeholder/10 bg-background p-3 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg focus:outline-none",
"fixed left-[50%] top-[35%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-35%] gap-4 border border-input-placeholder/10 bg-background p-3 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 rounded-lg focus:outline-none",
className,
)}
ref={ref}
{...props}>
{children}
{!hideClose && (
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
<DialogPrimitive.Close className="absolute right-4 top-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground cursor-pointer">
<XIcon className="size-2" />
<span className="sr-only">Close</span>
</DialogPrimitive.Close>