Polish Novya UI with brand colors, first-load skeletons, and session transition overlay.
Keep chat pinned to the latest message while AI thinks or streams, and align buttons/inputs with the logo teal/blue focus treatment. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -13,6 +13,8 @@ import { getBackendErrorMessage, isBackendNetworkError } from '@/lib/backendErro
|
||||
import { useToast } from '@/components/ui/use-toast';
|
||||
import { PCQ24_QUESTIONS, PCQ_LIKERT_OPTIONS } from '@/config/pcq24';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { AssessmentSkeleton } from '@/components/skeletons';
|
||||
import { LoadingOverlay } from '@/components/ui/loading-overlay';
|
||||
|
||||
const FADE_MS = 220;
|
||||
|
||||
@@ -71,6 +73,10 @@ export default function AssessmentPage() {
|
||||
}
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
return <AssessmentSkeleton />;
|
||||
}
|
||||
|
||||
const advanceWithFade = (delta: number) => {
|
||||
if (isAnimating || submitting || isRedirecting) return;
|
||||
setIsAnimating(true);
|
||||
@@ -229,6 +235,10 @@ export default function AssessmentPage() {
|
||||
|
||||
return (
|
||||
<div className="relative h-full min-h-0 flex-1 overflow-hidden p-4">
|
||||
<LoadingOverlay
|
||||
open={isRedirecting}
|
||||
message={successMessage ?? 'در حال انتقال…'}
|
||||
/>
|
||||
{/* Intro overlay — dark veil on text area; bottom almost visible */}
|
||||
{showIntro && (
|
||||
<div
|
||||
@@ -314,10 +324,12 @@ export default function AssessmentPage() {
|
||||
disabled={isAnimating || submitting || isRedirecting || showIntro}
|
||||
onClick={() => onSelect(currentQuestion.id, option.value)}
|
||||
className={cn(
|
||||
'flex h-11 w-full items-center justify-start rounded-xl border px-4 text-right text-sm transition-colors duration-200',
|
||||
'flex h-11 w-full items-center justify-start rounded-xl border px-4 text-right text-sm transition-all duration-200',
|
||||
'shadow-[0_2px_4px_rgba(15,23,42,0.05)] focus-visible:outline-none',
|
||||
'focus-visible:border-[#26d4ca] focus-visible:shadow-[0_0_0_1px_rgba(38,212,202,0.35),0_3px_8px_rgba(15,23,42,0.08)]',
|
||||
selected
|
||||
? 'border-cyan-500 bg-cyan-100 text-cyan-950 shadow-sm dark:border-neon-cyan dark:bg-neon-blue/25 dark:text-white dark:shadow-glow-sm'
|
||||
: 'border-slate-200 bg-white/80 text-body hover:border-cyan-400 hover:bg-white hover:text-foreground dark:border-neon-cyan/20 dark:bg-slate-900/35 dark:hover:border-neon-cyan/50 dark:hover:bg-slate-800/45 dark:hover:text-white'
|
||||
? 'border-[#26d4ca] bg-[rgb(38_212_202/0.12)] text-foreground shadow-[0_0_0_1px_rgba(38,212,202,0.25),0_3px_8px_rgba(15,23,42,0.08)] dark:border-neon-cyan dark:bg-neon-cyan/15 dark:text-white dark:shadow-glow-sm'
|
||||
: 'border-slate-200 bg-white/80 text-body hover:border-[#26d4ca]/70 hover:bg-white hover:text-foreground dark:border-neon-cyan/20 dark:bg-slate-900/35 dark:hover:border-neon-cyan/55 dark:hover:bg-slate-800/45 dark:hover:text-white'
|
||||
)}
|
||||
>
|
||||
{option.label}
|
||||
@@ -357,12 +369,6 @@ export default function AssessmentPage() {
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{successMessage && (
|
||||
<p className="shrink-0 rounded-xl border border-neon-emerald/35 bg-neon-emerald/10 px-3 py-2 text-center text-sm text-neon-teal">
|
||||
{successMessage}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user