Skip to content

Commit 299cc26

Browse files
authored
improvement(lint): fix react-doctor errors and warnings (#3232)
* improvement(lint): fix react-doctor errors and warnings * remove separators
1 parent 48715ff commit 299cc26

File tree

23 files changed

+267
-281
lines changed

23 files changed

+267
-281
lines changed

apps/docs/app/global.css

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@ body {
5959
--content-gap: 1.75rem;
6060
}
6161

62-
/* Remove custom layout variable overrides to fallback to fumadocs defaults */
63-
64-
/* ============================================
65-
Navbar Light Mode Styling
66-
============================================ */
67-
6862
/* Light mode navbar and search styling */
6963
:root:not(.dark) nav {
7064
background-color: hsla(0, 0%, 96%, 0.85) !important;
@@ -88,10 +82,6 @@ body {
8882
-webkit-backdrop-filter: blur(25px) saturate(180%) brightness(0.6) !important;
8983
}
9084

91-
/* ============================================
92-
Custom Sidebar Styling (Turborepo-inspired)
93-
============================================ */
94-
9585
/* Floating sidebar appearance - remove background */
9686
[data-sidebar-container],
9787
#nd-sidebar {
@@ -468,10 +458,6 @@ aside[data-sidebar],
468458
writing-mode: horizontal-tb !important;
469459
}
470460

471-
/* ============================================
472-
Code Block Styling (Improved)
473-
============================================ */
474-
475461
/* Apply Geist Mono to code elements */
476462
code,
477463
pre,
@@ -532,10 +518,6 @@ pre code .line {
532518
color: var(--color-fd-primary);
533519
}
534520

535-
/* ============================================
536-
TOC (Table of Contents) Styling
537-
============================================ */
538-
539521
/* Remove the thin border-left on nested TOC items (keeps main indicator only) */
540522
#nd-toc a[style*="padding-inline-start"] {
541523
border-left: none !important;
@@ -554,10 +536,6 @@ main article,
554536
padding-bottom: 4rem;
555537
}
556538

557-
/* ============================================
558-
Center and Constrain Main Content Width
559-
============================================ */
560-
561539
/* Main content area - center and constrain like turborepo/raindrop */
562540
/* Note: --sidebar-offset and --toc-offset are now applied at #nd-docs-layout level */
563541
main[data-main] {

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: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,3 +754,100 @@ 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+
/* WandPromptBar status indicator */
774+
@keyframes smoke-pulse {
775+
0%,
776+
100% {
777+
transform: scale(0.8);
778+
opacity: 0.4;
779+
}
780+
50% {
781+
transform: scale(1.1);
782+
opacity: 0.8;
783+
}
784+
}
785+
786+
.status-indicator {
787+
position: relative;
788+
width: 12px;
789+
height: 12px;
790+
border-radius: 50%;
791+
overflow: hidden;
792+
background-color: hsl(var(--muted-foreground) / 0.5);
793+
transition: background-color 0.3s ease;
794+
}
795+
796+
.status-indicator.streaming {
797+
background-color: transparent;
798+
}
799+
800+
.status-indicator.streaming::before {
801+
content: "";
802+
position: absolute;
803+
inset: 0;
804+
border-radius: 50%;
805+
background: radial-gradient(
806+
circle,
807+
hsl(var(--primary) / 0.9) 0%,
808+
hsl(var(--primary) / 0.4) 60%,
809+
transparent 80%
810+
);
811+
animation: smoke-pulse 1.8s ease-in-out infinite;
812+
opacity: 0.9;
813+
}
814+
815+
.dark .status-indicator.streaming::before {
816+
background: #6b7280;
817+
opacity: 0.9;
818+
animation: smoke-pulse 1.8s ease-in-out infinite;
819+
}
820+
821+
/* MessageContainer loading dot */
822+
@keyframes growShrink {
823+
0%,
824+
100% {
825+
transform: scale(0.9);
826+
}
827+
50% {
828+
transform: scale(1.1);
829+
}
830+
}
831+
832+
.loading-dot {
833+
animation: growShrink 1.5s infinite ease-in-out;
834+
}
835+
836+
/* Subflow node z-index and drag-over styles */
837+
.workflow-container .react-flow__node-subflowNode {
838+
z-index: -1 !important;
839+
}
840+
841+
.workflow-container .react-flow__node-subflowNode:has([data-subflow-selected="true"]) {
842+
z-index: 10 !important;
843+
}
844+
845+
.loop-node-drag-over,
846+
.parallel-node-drag-over {
847+
box-shadow: 0 0 0 1.75px var(--brand-secondary) !important;
848+
border-radius: 8px !important;
849+
}
850+
851+
.react-flow__node[data-parent-node-id] .react-flow__handle {
852+
z-index: 30;
853+
}

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'

0 commit comments

Comments
 (0)