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
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ interface BoardAppProps {
onSignOut: () => void;
}

function BoardApp({ identity, onIdentity, onSignOut }: BoardAppProps) {
function BoardApp({ identity, onIdentity, onSignOut }: Readonly<BoardAppProps>) {
const ns = identityNamespace(identity);
const store = useMemo(() => new LocalStore(ns), [ns]);
const remote = useMemo(() => new RemoteStore(), []);
Expand Down
7 changes: 6 additions & 1 deletion src/components/AdrModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ export interface AdrModalProps {
* Nothing reaches the board until "Add selected" — the review step is the
* whole point of the feature.
*/
export function AdrModal({ sources, onSplit, onAdd, onClose }: AdrModalProps) {
export function AdrModal({
sources,
onSplit,
onAdd,
onClose,
}: Readonly<AdrModalProps>) {
const [adr, setAdr] = useState('');
const [url, setURL] = useState('');
const [source, setSource] = useState(sources[0]?.name ?? '');
Expand Down
2 changes: 1 addition & 1 deletion src/components/AuthReturn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface AuthReturnProps {
export function AuthReturn({
search = typeof location === 'undefined' ? '' : location.search,
hash = typeof location === 'undefined' ? '' : location.hash,
}: AuthReturnProps) {
}: Readonly<AuthReturnProps>) {
const [stalled, setStalled] = useState(false);
const [failed, setFailed] = useState<string | null>(null);

Expand Down
4 changes: 2 additions & 2 deletions src/components/Board.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ interface LiftState extends LiftPos {
/** Id of the description that teaches the keyboard move model. */
const KEYS_HINT_ID = 'kb-card-keys';

export function BoardView(props: BoardProps) {
export function BoardView(props: Readonly<BoardProps>) {
const { board, onTick, onEdit, onAdd, showCancelled, onRestore, onPurge } = props;
const rootRef = useRef<HTMLElement>(null);
const cloneRef = useRef<HTMLDivElement>(null);
Expand Down Expand Up @@ -736,7 +736,7 @@ function Column({
onCardKey,
onRestore,
onPurge,
}: ColumnProps) {
}: Readonly<ColumnProps>) {
const slot =
placeholder === null ? null : (
<li className="slot" aria-hidden="true" style={{ height: placeholderHeight }} />
Expand Down
4 changes: 2 additions & 2 deletions src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { tagColor } from '../lib/labels';
import type { InlineTok } from '../lib/inlineMd';
import { parseDesc, tokenizeInline } from '../lib/inlineMd';

function InlineText({ toks }: { toks: InlineTok[] }) {
function InlineText({ toks }: Readonly<{ toks: InlineTok[] }>) {
return (
<>
{toks.map((t, i) => {
Expand Down Expand Up @@ -38,7 +38,7 @@ function InlineText({ toks }: { toks: InlineTok[] }) {
);
}

function Desc({ text }: { text: string }) {
function Desc({ text }: Readonly<{ text: string }>) {
return (
<div className="desc">
{parseDesc(text).map((l, i) => (
Expand Down
6 changes: 3 additions & 3 deletions src/components/CardAIDraft.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useId, useRef, useState } from 'react';
import type { MutableRefObject } from 'react';
import type { RefObject } from 'react';
import type { AIStoryRequest, StoryDraft } from '../lib/api';
import { isAbortError } from '../lib/api';
import type { Check, Effort, Prio } from '../lib/model';
Expand All @@ -17,7 +17,7 @@ export interface CardAIDraftProps {
checks: Check[];
onApply: (draft: StoryDraft) => void;
onBusyChange: (busy: boolean) => void;
cancelRef: MutableRefObject<(() => void) | null>;
cancelRef: RefObject<(() => void) | null>;
}

export function CardAIDraft({
Expand All @@ -33,7 +33,7 @@ export function CardAIDraft({
onApply,
onBusyChange,
cancelRef,
}: CardAIDraftProps) {
}: Readonly<CardAIDraftProps>) {
const [prompt, setPrompt] = useState('');
const [busy, setBusy] = useState(false);
const [error, setError] = useState<string | null>(null);
Expand Down
6 changes: 3 additions & 3 deletions src/components/CardEditor.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from 'react';
import type { MutableRefObject, ReactNode } from 'react';
import type { ReactNode, RefObject } from 'react';
import type { AIStoryRequest, StoryDraft } from '../lib/api';
import type { Check, Effort, Prio } from '../lib/model';
import { newTask } from '../lib/model';
Expand All @@ -16,7 +16,7 @@ export interface CardEditorProps {
title: string;
onTitleChange: (title: string) => void;
onBusyChange: (busy: boolean) => void;
cancelRef: MutableRefObject<(() => void) | null>;
cancelRef: RefObject<(() => void) | null>;
titleExtras: ReactNode;
onSave: (task: ReturnType<typeof newTask>) => void;
onDelete: (taskId: string) => void;
Expand Down Expand Up @@ -51,7 +51,7 @@ export function CardEditor({
onSave,
onDelete,
onClose,
}: CardEditorProps) {
}: Readonly<CardEditorProps>) {
const base = state.mode === 'edit' ? state.task : null;
const [emoji, setEmoji] = useState(() => firstEmoji(base?.emoji ?? ''));
const [blocked, setBlocked] = useState(base?.blocked ?? false);
Expand Down
2 changes: 1 addition & 1 deletion src/components/CardModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export function CardModal({
onSave,
onDelete,
onClose,
}: CardModalProps) {
}: Readonly<CardModalProps>) {
const excludeId = state.mode === 'edit' ? canonicalTaskId : undefined;
const [title, setTitle] = useState(state.mode === 'edit' ? state.task.title : '');
const [aiBusy, setAiBusy] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConfirmDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function ConfirmDialog({
destructive = false,
onConfirm,
onClose,
}: ConfirmDialogProps) {
}: Readonly<ConfirmDialogProps>) {
const boxRef = useRef<HTMLDivElement>(null);
const inputRef = useRef<HTMLInputElement>(null);
const confirmRef = useRef<HTMLButtonElement>(null);
Expand Down
6 changes: 5 additions & 1 deletion src/components/DateField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ export interface DateFieldProps {
* Keyboard, in the popover: arrows move a day/week, PageUp/PageDown a month,
* Enter or Space picks, Escape closes and returns to the trigger.
*/
export function DateField({ inputId, value, onChange }: DateFieldProps) {
export function DateField({
inputId,
value,
onChange,
}: Readonly<DateFieldProps>) {
const [open, setOpen] = useState(false);
// The day the grid keys move; also decides the visible month.
const [focusISO, setFocusISO] = useState(todayISO());
Expand Down
5 changes: 4 additions & 1 deletion src/components/DebugOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ export function restingBox(
* cap for the confetti loop. Mounted only when the flag is on, so a disabled
* overlay costs nothing — no requestAnimationFrame runs.
*/
export function DebugOverlay({ onClose, inert }: DebugOverlayProps) {
export function DebugOverlay({
onClose,
inert,
}: Readonly<DebugOverlayProps>) {
const [fps, setFps] = useState<number | null>(null);
const [target, setTarget] = useState<FrameTarget>('uncapped');
// Moved to the opposite corner while it would otherwise cover the focused
Expand Down
6 changes: 5 additions & 1 deletion src/components/EmojiField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ export interface EmojiFieldProps {
* typing, and everything typeable here is either already in the picker or is
* something the wire format refuses.
*/
export function EmojiField({ inputId, value, onChange }: EmojiFieldProps) {
export function EmojiField({
inputId,
value,
onChange,
}: Readonly<EmojiFieldProps>) {
const [open, setOpen] = useState(false);
const [picker, setPicker] = useState<PickerModule | null>(null);
const [failed, setFailed] = useState(false);
Expand Down
6 changes: 3 additions & 3 deletions src/components/IdentityGate.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useEffect, useState } from 'react';
import type { FormEvent } from 'react';
import type { SubmitEvent } from 'react';
import type { Identity } from '../lib/auth';
import { azureAvailable, signInAzure } from '../lib/auth';

Expand All @@ -10,7 +10,7 @@ export interface IdentityGateProps {
/** The gate renders once, so a constant id is enough to point the field at. */
const ERROR_ID = 'g-error';

export function IdentityGate({ onIdentity }: IdentityGateProps) {
export function IdentityGate({ onIdentity }: Readonly<IdentityGateProps>) {
const [busy, setBusy] = useState(false);
const [error, setError] = useState<string | null>(null);
const [id, setId] = useState('');
Expand Down Expand Up @@ -47,7 +47,7 @@ export function IdentityGate({ onIdentity }: IdentityGateProps) {
}
};

const handleManual = (e: FormEvent) => {
const handleManual = (e: SubmitEvent<HTMLFormElement>) => {
e.preventDefault();
const trimmed = id.trim();
if (!trimmed) return;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ImportModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function ImportModal({
onAdd,
onCommitLinks,
onClose,
}: ImportModalProps) {
}: Readonly<ImportModalProps>) {
const [source, setSource] = useState(sources[0]?.name ?? '');
const [reference, setReference] = useState('');
const [max, setMax] = useState(MAX_DEFAULT);
Expand Down
2 changes: 1 addition & 1 deletion src/components/IntegrationsSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const busyMessage: Record<IntegrationAction, string> = {
export function IntegrationsSection({
identity,
serverPresent,
}: IntegrationsSectionProps) {
}: Readonly<IntegrationsSectionProps>) {
const [rows, setRows] = useState<IntegrationRow[]>([]);
const [loading, setLoading] = useState(serverPresent);
const [loadError, setLoadError] = useState<string | null>(null);
Expand Down
2 changes: 1 addition & 1 deletion src/components/LabelsCombobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function LabelsCombobox({
value,
suggestions,
onChange,
}: LabelsComboboxProps) {
}: Readonly<LabelsComboboxProps>) {
const [text, setText] = useState('');
const [open, setOpen] = useState(false);
const [hi, setHi] = useState(0);
Expand Down
6 changes: 3 additions & 3 deletions src/components/ReconnectModal.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useId, useRef, useState } from 'react';
import type { FormEvent } from 'react';
import type { SubmitEvent } from 'react';
import type { Identity } from '../lib/auth';
import { ReauthRequiredError, signInAzure } from '../lib/auth';
import { getLabels } from '../lib/api';
Expand Down Expand Up @@ -48,7 +48,7 @@ export function ReconnectModal({
onIdentity,
onSignOut,
onClose,
}: ReconnectModalProps) {
}: Readonly<ReconnectModalProps>) {
const [token, setToken] = useState('');
const [busy, setBusy] = useState(false);
const [error, setError] = useState<string | null>(null);
Expand Down Expand Up @@ -76,7 +76,7 @@ export function ReconnectModal({
}
};

const handleToken = (e: FormEvent) => {
const handleToken = (e: SubmitEvent<HTMLFormElement>) => {
e.preventDefault();
const serverToken = token.trim();
if (!serverToken) return;
Expand Down
2 changes: 1 addition & 1 deletion src/components/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function SettingsModal({
onDebugChange,
onClose,
onSaved,
}: SettingsModalProps) {
}: Readonly<SettingsModalProps>) {
const [loaded, setLoaded] = useState(false);
const [loadError, setLoadError] = useState<string | null>(null);
const [baseUrl, setBaseUrl] = useState('');
Expand Down
2 changes: 1 addition & 1 deletion src/components/ShipDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function ShipDialog({
onShip,
onTickAll,
onCancel,
}: ShipDialogProps) {
}: Readonly<ShipDialogProps>) {
const boxRef = useRef<HTMLDivElement>(null);
const onDialogKeyDown = useDialogFocus(boxRef);
const titleId = useId();
Expand Down