Skip to content

Commit 28046e8

Browse files
committed
improvement(lint): fix react-doctor errors and warnings
1 parent 48715ff commit 28046e8

File tree

22 files changed

+271
-259
lines changed

22 files changed

+271
-259
lines changed

apps/sim/app/(auth)/components/oauth-provider-checker.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use server'
2-
31
import { env } from '@/lib/core/config/env'
42
import { isProd } from '@/lib/core/config/feature-flags'
53

apps/sim/app/(landing)/components/hero/components/landing-canvas/landing-block/landing-node.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export const LandingNode = React.memo(function LandingNode({ data }: { data: Lan
8585
transform: isAnimated ? 'translateY(0) scale(1)' : 'translateY(8px) scale(0.98)',
8686
transition:
8787
'opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1)',
88-
willChange: 'transform, opacity',
88+
willChange: isAnimated ? 'auto' : 'transform, opacity',
8989
}}
9090
>
9191
<LandingBlock icon={data.icon} color={data.color} name={data.name} tags={data.tags} />

apps/sim/app/(landing)/components/hero/components/landing-canvas/landing-edge/landing-edge.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ export const LandingEdge = React.memo(function LandingEdge(props: EdgeProps) {
6767
strokeLinejoin: 'round',
6868
pointerEvents: 'none',
6969
animation: `landing-edge-dash-${id} 1s linear infinite`,
70-
willChange: 'stroke-dashoffset',
7170
...style,
7271
}}
7372
/>

apps/sim/app/_styles/globals.css

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,3 +754,104 @@ input[type="search"]::-ms-clear {
754754
text-decoration: none !important;
755755
color: inherit !important;
756756
}
757+
758+
/**
759+
* Respect user's prefers-reduced-motion setting (WCAG 2.3.3)
760+
* Disables animations and transitions for users who prefer reduced motion.
761+
*/
762+
@media (prefers-reduced-motion: reduce) {
763+
*,
764+
*::before,
765+
*::after {
766+
animation-duration: 0.01ms !important;
767+
animation-iteration-count: 1 !important;
768+
transition-duration: 0.01ms !important;
769+
scroll-behavior: auto !important;
770+
}
771+
}
772+
773+
/* ============================================================
774+
* Component styles extracted from styled-jsx blocks
775+
* ============================================================ */
776+
777+
/* WandPromptBar status indicator */
778+
@keyframes smoke-pulse {
779+
0%,
780+
100% {
781+
transform: scale(0.8);
782+
opacity: 0.4;
783+
}
784+
50% {
785+
transform: scale(1.1);
786+
opacity: 0.8;
787+
}
788+
}
789+
790+
.status-indicator {
791+
position: relative;
792+
width: 12px;
793+
height: 12px;
794+
border-radius: 50%;
795+
overflow: hidden;
796+
background-color: hsl(var(--muted-foreground) / 0.5);
797+
transition: background-color 0.3s ease;
798+
}
799+
800+
.status-indicator.streaming {
801+
background-color: transparent;
802+
}
803+
804+
.status-indicator.streaming::before {
805+
content: "";
806+
position: absolute;
807+
inset: 0;
808+
border-radius: 50%;
809+
background: radial-gradient(
810+
circle,
811+
hsl(var(--primary) / 0.9) 0%,
812+
hsl(var(--primary) / 0.4) 60%,
813+
transparent 80%
814+
);
815+
animation: smoke-pulse 1.8s ease-in-out infinite;
816+
opacity: 0.9;
817+
}
818+
819+
.dark .status-indicator.streaming::before {
820+
background: #6b7280;
821+
opacity: 0.9;
822+
animation: smoke-pulse 1.8s ease-in-out infinite;
823+
}
824+
825+
/* MessageContainer loading dot */
826+
@keyframes growShrink {
827+
0%,
828+
100% {
829+
transform: scale(0.9);
830+
}
831+
50% {
832+
transform: scale(1.1);
833+
}
834+
}
835+
836+
.loading-dot {
837+
animation: growShrink 1.5s infinite ease-in-out;
838+
}
839+
840+
/* Subflow node z-index and drag-over styles */
841+
.workflow-container .react-flow__node-subflowNode {
842+
z-index: -1 !important;
843+
}
844+
845+
.workflow-container .react-flow__node-subflowNode:has([data-subflow-selected="true"]) {
846+
z-index: 10 !important;
847+
}
848+
849+
.loop-node-drag-over,
850+
.parallel-node-drag-over {
851+
box-shadow: 0 0 0 1.75px var(--brand-secondary) !important;
852+
border-radius: 8px !important;
853+
}
854+
855+
.react-flow__node[data-parent-node-id] .react-flow__handle {
856+
z-index: 30;
857+
}

apps/sim/app/chat/components/message-container/message-container.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,6 @@ export const ChatMessageContainer = memo(function ChatMessageContainer({
3030
}: ChatMessageContainerProps) {
3131
return (
3232
<div className='relative flex flex-1 flex-col overflow-hidden bg-white'>
33-
<style jsx>{`
34-
@keyframes growShrink {
35-
0%,
36-
100% {
37-
transform: scale(0.9);
38-
}
39-
50% {
40-
transform: scale(1.1);
41-
}
42-
}
43-
.loading-dot {
44-
animation: growShrink 1.5s infinite ease-in-out;
45-
}
46-
`}</style>
47-
4833
{/* Scrollable Messages Area */}
4934
<div
5035
ref={messagesContainerRef}

apps/sim/app/chat/components/voice-interface/voice-interface.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export function VoiceInterface({
7171
const [state, setState] = useState<'idle' | 'listening' | 'agent_speaking'>('idle')
7272
const [isInitialized, setIsInitialized] = useState(false)
7373
const [isMuted, setIsMuted] = useState(false)
74-
const [audioLevels, setAudioLevels] = useState<number[]>(new Array(200).fill(0))
74+
const [audioLevels, setAudioLevels] = useState<number[]>(() => new Array(200).fill(0))
7575
const [permissionStatus, setPermissionStatus] = useState<'prompt' | 'granted' | 'denied'>(
7676
'prompt'
7777
)
Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { redirect } from 'next/navigation'
1+
import { redirect, unstable_rethrow } from 'next/navigation'
22
import { getSession } from '@/lib/auth'
33
import { getWorkspaceFile } from '@/lib/uploads/contexts/workspace'
44
import { verifyWorkspaceMembership } from '@/app/api/workflows/utils'
@@ -14,24 +14,27 @@ interface FileViewerPageProps {
1414
export default async function FileViewerPage({ params }: FileViewerPageProps) {
1515
const { workspaceId, fileId } = await params
1616

17-
try {
18-
const session = await getSession()
19-
if (!session?.user?.id) {
20-
redirect('/')
21-
}
22-
23-
const hasPermission = await verifyWorkspaceMembership(session.user.id, workspaceId)
24-
if (!hasPermission) {
25-
redirect(`/workspace/${workspaceId}`)
26-
}
17+
const session = await getSession()
18+
if (!session?.user?.id) {
19+
redirect('/')
20+
}
2721

28-
const fileRecord = await getWorkspaceFile(workspaceId, fileId)
29-
if (!fileRecord) {
30-
redirect(`/workspace/${workspaceId}`)
31-
}
22+
const hasPermission = await verifyWorkspaceMembership(session.user.id, workspaceId)
23+
if (!hasPermission) {
24+
redirect(`/workspace/${workspaceId}`)
25+
}
3226

33-
return <FileViewer file={fileRecord} />
27+
let fileRecord: Awaited<ReturnType<typeof getWorkspaceFile>>
28+
try {
29+
fileRecord = await getWorkspaceFile(workspaceId, fileId)
3430
} catch (error) {
31+
unstable_rethrow(error)
3532
redirect(`/workspace/${workspaceId}`)
3633
}
34+
35+
if (!fileRecord) {
36+
redirect(`/workspace/${workspaceId}`)
37+
}
38+
39+
return <FileViewer file={fileRecord} />
3740
}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/combobox/combobox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'
2-
import { isEqual } from 'lodash'
2+
import isEqual from 'lodash/isEqual'
33
import { useReactFlow } from 'reactflow'
44
import { useStoreWithEqualityFn } from 'zustand/traditional'
55
import { Combobox, type ComboboxOption } from '@/components/emcn/components'

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/dropdown/dropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'
2-
import { isEqual } from 'lodash'
2+
import isEqual from 'lodash/isEqual'
33
import { useStoreWithEqualityFn } from 'zustand/traditional'
44
import { Badge } from '@/components/emcn'
55
import { Combobox, type ComboboxOption } from '@/components/emcn/components'

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/editor/components/sub-block/components/messages-input/messages-input.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
useRef,
88
useState,
99
} from 'react'
10-
import { isEqual } from 'lodash'
10+
import isEqual from 'lodash/isEqual'
1111
import { ChevronDown, ChevronsUpDown, ChevronUp, Plus } from 'lucide-react'
1212
import { Button, Popover, PopoverContent, PopoverItem, PopoverTrigger } from '@/components/emcn'
1313
import { Trash } from '@/components/emcn/icons/trash'

0 commit comments

Comments
 (0)