Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/chat/components/ConversationSession.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
useMemo,
useRef,
useState,
type FormEvent,
type SubmitEvent,
type ReactNode,
type RefObject,
} from 'react'
Expand Down Expand Up @@ -757,7 +757,7 @@ export function ConversationSession({
!!busy,
visible,
)
async function send(e?: FormEvent, text = input) {
async function send(e?: SubmitEvent, text = input) {
e?.preventDefault()
if (readOnly || sending || !pendingSend.ready) return
if (pendingSend.pending) {
Expand Down
4 changes: 2 additions & 2 deletions src/chat/components/DesktopBrowserPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
useLayoutEffect,
useRef,
useState,
type FormEvent,
type SubmitEvent,
} from 'react'
import {
ArrowClockwiseIcon,
Expand Down Expand Up @@ -125,7 +125,7 @@ export function DesktopBrowserPanel({
state?.appZoomPercent,
])

const navigate = (event: FormEvent<HTMLFormElement>) => {
const navigate = (event: SubmitEvent<HTMLFormElement>) => {
event.preventDefault()
if (!host || !address.trim()) return
setEditing(false)
Expand Down
4 changes: 2 additions & 2 deletions src/chat/components/ExecutionSessionPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
useLayoutEffect,
useRef,
useState,
type FormEvent,
type SyntheticEvent,
} from 'react'
import {
ArrowClockwiseIcon,
Expand Down Expand Up @@ -247,7 +247,7 @@ function SessionPanel({
}
await act(parsed.data.type, () => owners!.enqueue(identity, parsed.data))
}
function processCommand(type: 'run' | 'spawn', event: FormEvent) {
function processCommand(type: 'run' | 'spawn', event: SyntheticEvent) {
event.preventDefault()
let values: unknown
try {
Expand Down
4 changes: 2 additions & 2 deletions src/chat/components/KodyAddServer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useRef, useState, type FormEvent } from 'react'
import { useRef, useState, type SubmitEvent } from 'react'
import { useQueryClient } from '@tanstack/react-query'
import {
kodyServerAddResultSchema,
Expand All @@ -19,7 +19,7 @@ export function KodyAddServer({ userId }: { userId: string }) {
const pending = useRef<KodyServerAdd | null>(null)
const locked = useRef(false)

async function add(event: FormEvent<HTMLFormElement>) {
async function add(event: SubmitEvent<HTMLFormElement>) {
event.preventDefault()
if (locked.current) return
const parsed = kodyServerAddSchema.safeParse({
Expand Down
4 changes: 2 additions & 2 deletions src/chat/components/KodyCommunity.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, type FormEvent } from 'react'
import { useState, type SubmitEvent } from 'react'
import { useQuery, useQueryClient } from '@tanstack/react-query'
import {
ArrowLeftIcon,
Expand Down Expand Up @@ -77,7 +77,7 @@ export function KodyCommunity({
retry: false as const,
})
const detail = useQuery({ ...detailOptions(selected), enabled: !!selected })
function submit(event: FormEvent) {
function submit(event: SubmitEvent) {
event.preventDefault()
if (draft.trim() === query) void search.refetch()
else setQuery(draft.trim())
Expand Down
4 changes: 2 additions & 2 deletions src/chat/components/KodyMail.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useState, type FormEvent } from 'react'
import { useEffect, useState, type SubmitEvent } from 'react'
import { useQuery } from '@tanstack/react-query'
import { ArrowCounterClockwiseIcon, ArrowLeftIcon } from '@phosphor-icons/react'
import {
Expand Down Expand Up @@ -87,7 +87,7 @@ export function KodyMail({
})
useEffect(() => setSelectedId(null), [inboxId, query])

function search(event: FormEvent) {
function search(event: SubmitEvent) {
event.preventDefault()
const next = draft.trim()
if (next.length > 200) return
Expand Down
4 changes: 2 additions & 2 deletions src/chat/components/KodyMemorySearch.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, type FormEvent } from 'react'
import { useState, type SubmitEvent } from 'react'
import { useQuery, useQueryClient } from '@tanstack/react-query'
import {
kodyMemoryChangeSchema,
Expand Down Expand Up @@ -342,7 +342,7 @@ export function KodyMemorySearch({
refetchIntervalInBackground: false,
retry: false,
})
function submit(event: FormEvent) {
function submit(event: SubmitEvent) {
event.preventDefault()
const input = draft.trim()
if (!input || input.length > 200) {
Expand Down
4 changes: 2 additions & 2 deletions src/chat/components/KodyRunHistory.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, type FormEvent } from 'react'
import { useState, type SubmitEvent } from 'react'
import { useInfiniteQuery } from '@tanstack/react-query'
import { z } from 'zod'
import {
Expand Down Expand Up @@ -80,7 +80,7 @@ export function KodyRunHistory({ accountScope }: { accountScope: string }) {
.map((run) => [run.id, run]) ?? [],
).values(),
)
function findRun(event: FormEvent) {
function findRun(event: SubmitEvent) {
event.preventDefault()
const parsed = z.uuid().safeParse(runIdInput.trim())
if (!parsed.success) {
Expand Down
4 changes: 2 additions & 2 deletions src/chat/components/RetryComposer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { LoadingState } from './ui/LoadingState'
import { useEffect, useRef, useState, type FormEvent } from 'react'
import { useEffect, useRef, useState, type SubmitEvent } from 'react'
import { Popover } from '@base-ui/react/popover'
import { useQuery } from '@tanstack/react-query'
import {
Expand Down Expand Up @@ -313,7 +313,7 @@ export function RetryComposer({
onSent,
draft.editor,
])
async function send(event?: FormEvent) {
async function send(event?: SubmitEvent) {
event?.preventDefault()
if (
unavailable ||
Expand Down
2 changes: 1 addition & 1 deletion src/components/AiDock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,7 @@ function InputBar({
onAskAISubmit(trimmedQuery)
}, [canAsk, onAskAISubmit, refine, setSearchQuery, trimmedQuery])

const handleSubmit = (event: React.FormEvent) => {
const handleSubmit = (event: React.SubmitEvent) => {
event.preventDefault()

submitQuestion()
Expand Down
4 changes: 2 additions & 2 deletions src/components/ShowcaseSubmitForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useToast } from './ToastProvider'
import { CheckIcon, WarningCircleIcon } from '@phosphor-icons/react'
import { Button, FormInput } from '~/ui'
import { ImageUpload } from './ImageUpload'
import { FormEvent, useMemo, useState } from 'react'
import { SubmitEvent, useMemo, useState } from 'react'

// Filter to only show libraries with proper configuration
const selectableLibraries = libraries.filter(
Expand Down Expand Up @@ -122,7 +122,7 @@ export function ShowcaseSubmitForm({ showcase }: ShowcaseSubmitFormProps) {
)
}

const handleSubmit = (e: FormEvent) => {
const handleSubmit = (e: SubmitEvent) => {
e.preventDefault()

if (selectedLibraries.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/examples/SandboxBrowser.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export function SandboxBrowser({
onAnnotationModeChange?.(active)
}

function submitAddress(event: React.FormEvent<HTMLFormElement>) {
function submitAddress(event: React.SubmitEvent<HTMLFormElement>) {
event.preventDefault()
const next = address.trim()
if (!next) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/examples/WebContainerTerminal.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export function WebContainerProcessTerminalPanel({
function renderProcessOutput(
terminal: Terminal,
output: { generation: number; offset: number; value: string },
renderedOutputRef: React.MutableRefObject<{
renderedOutputRef: React.RefObject<{
end: number
generation: number
}>,
Expand Down
Loading