diff --git a/apps/docs/src/lib/excerpt-renderer.tsx b/apps/docs/src/lib/excerpt-renderer.tsx index a5a52f7f..f931be94 100644 --- a/apps/docs/src/lib/excerpt-renderer.tsx +++ b/apps/docs/src/lib/excerpt-renderer.tsx @@ -23,7 +23,7 @@ export function renderExcerpt(excerpt: string): React.ReactNode { .replace(//g, ">") .replace(/"/g, """) - .replace(/'/g, "'") + .replace(/'/g, "'") if (inMark) { elements.push( @@ -51,5 +51,5 @@ export function getExcerptText(excerpt: string): string { .replace(/</g, "<") .replace(/>/g, ">") .replace(/"/g, '"') - .replace(/'/g, "'") + .replace(/'/g, "'") } diff --git a/apps/web/src/features/trade/components/chart/TVChartContainer.tsx b/apps/web/src/features/trade/components/chart/TVChartContainer.tsx index b4713897..14e47629 100644 --- a/apps/web/src/features/trade/components/chart/TVChartContainer.tsx +++ b/apps/web/src/features/trade/components/chart/TVChartContainer.tsx @@ -28,9 +28,6 @@ import type { OhlcBar } from "../../lib/oracle" import { useWalletStore } from "@/features/wallet/store/wallet-store" import { formatUsd } from "@/shared/lib/format" import { ENV } from "@/app/config/env" -import type { CandlestickData, IChartApi, IPriceLine, ISeriesApi, UTCTimestamp } from "lightweight-charts" -import type { OhlcBar } from "../../lib/oracle" -import { useWalletStore } from "@/features/wallet/store/wallet-store" type ChartLine = { id: string diff --git a/apps/web/src/features/trade/components/positions/OrderExecutionFrozenBanner.tsx b/apps/web/src/features/trade/components/positions/OrderExecutionFrozenBanner.tsx index 2a7a3f55..e93666dd 100644 --- a/apps/web/src/features/trade/components/positions/OrderExecutionFrozenBanner.tsx +++ b/apps/web/src/features/trade/components/positions/OrderExecutionFrozenBanner.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react" +import { useEffect, useState } from "react" import { ORDER_EXECUTION_FROZEN_MESSAGE } from "@/lib/contracts" const SESSION_KEY = "so4-order-execution-frozen-dismissed" @@ -12,7 +12,7 @@ export function OrderExecutionFrozenBanner({ visible }: Props) { useEffect(() => { try { - if (typeof window !== "undefined" && sessionStorage) { + if (typeof window !== "undefined") { setDismissed(sessionStorage.getItem(SESSION_KEY) === "1") } } catch { diff --git a/apps/web/src/features/trade/components/trade-panel/TradePanel.tsx b/apps/web/src/features/trade/components/trade-panel/TradePanel.tsx index 8f40ec76..3fe83cec 100644 --- a/apps/web/src/features/trade/components/trade-panel/TradePanel.tsx +++ b/apps/web/src/features/trade/components/trade-panel/TradePanel.tsx @@ -1,5 +1,4 @@ import { useEffect, useMemo, useState } from "react" -import { explorerTxUrl } from "@/app/config/network" import { Tabs, TabsContent, @@ -27,6 +26,7 @@ import { ConfirmationDialog } from "./ConfirmationDialog" import { ApplyReferralCodePrompt } from "./ApplyReferralCodePrompt" import { LeverageSlider } from "./LeverageSlider" import type { TradeMode, TradeType, useTradeState } from "../../hooks/useTradeState" +import { explorerTxUrl } from "@/app/config/network" import { NumberInput } from "@/shared/components/NumberInput" import { useWalletStore } from "@/features/wallet/store/wallet-store" import { TokenIcon } from "@/shared/components/TokenIcon" diff --git a/apps/web/src/features/wallet/components/NetworkMismatchBanner.tsx b/apps/web/src/features/wallet/components/NetworkMismatchBanner.tsx index ebb0b236..7c8aa98d 100644 --- a/apps/web/src/features/wallet/components/NetworkMismatchBanner.tsx +++ b/apps/web/src/features/wallet/components/NetworkMismatchBanner.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react" +import { useEffect, useState } from "react" import { useLocation } from "@tanstack/react-router" import { useNetwork } from "../hooks/useNetwork" import { useWalletStore } from "../store/wallet-store" @@ -14,7 +14,7 @@ export function NetworkMismatchBanner() { useEffect(() => { try { - if (typeof window !== "undefined" && sessionStorage) { + if (typeof window !== "undefined") { setDismissed(sessionStorage.getItem(SESSION_KEY) === "1") } } catch { diff --git a/apps/web/src/shared/hooks/useTxFeedback.tsx b/apps/web/src/shared/hooks/useTxFeedback.tsx index 278148b3..f06a7022 100644 --- a/apps/web/src/shared/hooks/useTxFeedback.tsx +++ b/apps/web/src/shared/hooks/useTxFeedback.tsx @@ -2,7 +2,7 @@ import { useCallback, useRef } from "react" import { toast } from "@workspace/ui/components/toast" import { explorerTxUrl } from "@/app/config/network" -// #732: Explicit lifecycle events for transaction feedback without English message matching +// Issue 732: Explicit lifecycle events for transaction feedback without English message matching export type TxFeedbackEvent = | { type: "signing"; message: string } | { type: "signed" } @@ -15,7 +15,7 @@ export type TxFeedbackEvent = | { type: "error"; message: string } | { type: "unknown_outcome"; hash?: string } -// #732: Each attempt gets its own stable toast ID; concurrent transactions don't interfere +// Issue 732: Each attempt gets its own stable toast ID; concurrent transactions don't interfere type TxAttempt = { readonly attemptId: string readonly createdAt: number @@ -143,7 +143,7 @@ export function useTxFeedback() { break case "unknown_outcome": - // #733: Unknown submission outcome — status should be looked up by hash if available + // Issue 733: Unknown submission outcome — status should be looked up by hash if available attempt.status = "submitted" if (attempt.toastId) { toast.show({ diff --git a/apps/web/src/shared/hooks/useTxSubmit.tsx b/apps/web/src/shared/hooks/useTxSubmit.tsx index 7dff23a0..da27dd73 100644 --- a/apps/web/src/shared/hooks/useTxSubmit.tsx +++ b/apps/web/src/shared/hooks/useTxSubmit.tsx @@ -1,8 +1,8 @@ -import { useCallback, useState, useRef } from "react" +import { useCallback, useRef, useState } from "react" import { toast } from "@workspace/ui/components/toast" +import { useTxFeedback } from "./useTxFeedback" import { sendAndPoll } from "@/lib/tx-builder" import { explorerTxUrl } from "@/app/config/network" -import { useTxFeedback } from "./useTxFeedback" export type SubmitTxOptions = { loadingMessage: string @@ -81,14 +81,14 @@ export function useTxSubmit() { error: null, }) const feedback = useTxFeedback() - // #733: Track attempt identity to detect and prevent duplicate submissions + // Issue 733: Track attempt identity to detect and prevent duplicate submissions const attemptIdRef = useRef(null) - // #733: Guard against double-click, Enter+click, component rerender triggering multiple submissions + // Issue 733: Guard against double-click, Enter+click, component rerender triggering multiple submissions const submitInProgressRef = useRef(false) const submit = useCallback( async (getSignedXdr: () => Promise, options: SubmitTxOptions): Promise => { - // #733: Prevent duplicate submission (double-click, accidental Enter+click, rerender) + // Issue 733: Prevent duplicate submission (double-click, accidental Enter+click, rerender) if (submitInProgressRef.current) { throw new Error("Submission already in progress") } @@ -113,15 +113,15 @@ export function useTxSubmit() { [], ) - // #732: Extended submit that integrates with transaction feedback controller + // Issue 732: Extended submit that integrates with transaction feedback controller const submitWithFeedback = useCallback( async (getSignedXdr: () => Promise, options: SubmitTxOptions): Promise => { const attemptId = `txn-${Date.now()}-${Math.random().toString(36).slice(2, 9)}` attemptIdRef.current = attemptId - const attempt = feedback.createAttempt(attemptId) + feedback.createAttempt(attemptId) - // #733: Prevent duplicate submission with attempt tracking + // Issue 733: Prevent duplicate submission with attempt tracking if (submitInProgressRef.current) { feedback.handleEvent({ type: "error", @@ -144,7 +144,7 @@ export function useTxSubmit() { const response = await sendAndPoll(signedXdr) return response.hash } catch (submitError) { - // #733: Unknown submission outcome — signal for status lookup + // Issue 733: Unknown submission outcome — signal for status lookup const errorMsg = submitError instanceof Error ? submitError.message : "Submission failed" if (errorMsg.includes("unknown")) { feedback.handleEvent({ type: "unknown_outcome" }) @@ -181,7 +181,7 @@ export function useTxSubmit() { submitInProgressRef.current = false throw error } finally { - // #733: Keep attempt ID for status lookup in case of unknown outcomes + // Issue 733: Keep attempt ID for status lookup in case of unknown outcomes // Do NOT clear immediately — let status lookup use it if needed } }, @@ -190,7 +190,7 @@ export function useTxSubmit() { return { submit, - // #732 & #733: Extended submit with transaction feedback controller + // Issues 732 and 733: Extended submit with transaction feedback controller submitWithFeedback, isLoading: state.isLoading, txHash: state.txHash, diff --git a/apps/web/src/ui/theme-provider.tsx b/apps/web/src/ui/theme-provider.tsx index 23532a28..e493216c 100644 --- a/apps/web/src/ui/theme-provider.tsx +++ b/apps/web/src/ui/theme-provider.tsx @@ -58,7 +58,7 @@ export function ThemeProvider({ children }: { children: ReactNode }) { resolve(next) === resolve(theme) || window.matchMedia("(prefers-reduced-motion: reduce)").matches || document.documentElement.dataset.reducedMotion === "true" || - !document.startViewTransition + !Reflect.has(document, "startViewTransition") ) { activeTransition.current?.skipTransition() apply()