Skip to content

Commit 5f55b8b

Browse files
committed
style(landing): convert added inline comments to TSDoc-style
1 parent ecca2a1 commit 5f55b8b

4 files changed

Lines changed: 13 additions & 19 deletions

File tree

apps/sim/app/(landing)/components/auth-modal/auth-modal.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ export function AuthModal({ children, defaultView = 'login', source }: AuthModal
9696
const hasModalContent =
9797
status.githubAvailable || status.googleAvailable || status.microsoftAvailable || ssoEnabled
9898
if (!hasModalContent) {
99-
// Close the loading state (no-op if never opened) and route out. Registration
100-
// being disabled sends signup requests to login, since signup is unavailable.
99+
/** Close the loader (no-op if never opened) and route out; disabled registration sends signup to login. */
101100
setOpen(false)
102101
router.push(status.registrationDisabled || defaultView === 'login' ? '/login' : '/signup')
103102
return
@@ -119,16 +118,13 @@ export function AuthModal({ children, defaultView = 'login', source }: AuthModal
119118
openWithStatus(providerStatus)
120119
return
121120
}
122-
// Status not loaded yet: open immediately (the loader shows) so the click feels
123-
// responsive, then resolve - unless the visitor has since dismissed the modal.
121+
/** Status not loaded yet: open the loader immediately for responsiveness, then resolve. */
124122
openRequestedRef.current = true
125123
setOpen(true)
126124
fetchProviderStatus().then((status) => {
127125
setProviderStatus(status)
128126
if (!openRequestedRef.current) return
129-
// Consume the request so a queued double-click (or the mount prefetch resolving
130-
// on the same promise) can't run openWithStatus twice - no duplicate
131-
// `auth_modal_opened`, no redundant setView.
127+
/** Consume the request so a queued double-click can't open twice (no duplicate event). */
132128
openRequestedRef.current = false
133129
openWithStatus(status)
134130
})

apps/sim/app/(landing)/components/landing-preview/components/landing-preview-chat/landing-preview-chat.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ export function LandingPreviewChat({ chat, chatName, animationKey }: LandingPrev
4545
const [phase, setPhase] = useState<RevealPhase>('hidden')
4646
const revealRef = useRef<{ key: number; chat: PreviewChat | null }>({ key: animationKey, chat })
4747

48-
// Restart the reveal synchronously when the timeline (or staged chat) changes, so
49-
// the pane never flashes the previous step's reply before the effect reruns. The
50-
// previous key/chat are tracked in a ref: these updates come from the parent's
51-
// timer-driven state (never a transition/Suspense boundary), so the render can't be
52-
// discarded between the ref write and commit - keeping the ref safe here.
48+
/**
49+
* Restart the reveal synchronously when the timeline or staged chat changes, so the
50+
* pane never flashes the previous reply before the effect reruns. The previous
51+
* key/chat live in a ref: updates come from the parent's timer-driven state (never a
52+
* transition/Suspense boundary), so the render can't be discarded between the ref
53+
* write and commit.
54+
*/
5355
if (revealRef.current.key !== animationKey || revealRef.current.chat !== chat) {
5456
revealRef.current = { key: animationKey, chat }
5557
setPhase('hidden')

apps/sim/app/(landing)/components/landing-preview/components/landing-preview-workflow/workflow-data.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,7 @@ export interface EditorPromptData {
342342
export function getEditorPrompt(workflow: PreviewWorkflow): EditorPromptData | null {
343343
for (const block of workflow.blocks) {
344344
if (!AGENT_BLOCK_TYPES.has(block.type)) continue
345-
// Single ordered pass: the first row matching either prompt title (in row order)
346-
// and the first Model row - preserving the original find() first-match semantics.
345+
/** Single ordered pass: first row matching either prompt title, and the first Model row. */
347346
let promptRow: (typeof block.rows)[number] | undefined
348347
let modelRow: (typeof block.rows)[number] | undefined
349348
for (const row of block.rows) {

apps/sim/app/(landing)/components/landing-preview/landing-preview.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,9 @@ export function LandingPreview({
179179
}, [applyDemoStep])
180180

181181
useEffect(() => {
182-
// `isDesktop` is now reactive (viewport crossing 1024px re-runs this), so gate
183-
// the auto-demo on the cycle still being active - a resize after the visitor
184-
// has interacted must not restart the sequence from the first step.
182+
/** `isDesktop` is reactive, so gate on the cycle still being active - a resize after interaction must not restart. */
185183
if (!isDesktop || !autoplay || !autoCycleActiveRef.current) return
186-
// Reset the step index so the restart shows step 0 AND `scheduleNextStep` reads
187-
// step 0's delay - otherwise a resize would replay from a stale index and skip beats.
184+
/** Reset the index so a restart replays from step 0 (index, applied step, and delay stay consistent). */
188185
demoIndexRef.current = 0
189186
applyDemoStep(DESKTOP_STEPS[0])
190187
scheduleNextStep()

0 commit comments

Comments
 (0)