fix lint err

This commit is contained in:
2026-07-17 13:46:34 +08:00
parent 9242157aaf
commit 2f42e953fa
11 changed files with 56 additions and 55 deletions
+35 -28
View File
@@ -1,3 +1,23 @@
/* eslint-disable react-refresh/only-export-components -- Testable pure helpers currently share this legacy app module. */
import {
Archive,
ChevronDown,
ChevronUp,
FileText,
FolderKanban,
Gamepad2,
GitFork,
Image,
Pause,
Pencil,
Play,
Plus,
Send,
Target,
Trash2,
Zap,
} from 'lucide-react';
import {
type ChangeEvent,
type FormEvent,
@@ -11,32 +31,7 @@ import {
useRef,
useState,
} from 'react';
import {
Archive,
Bell,
BookOpen,
ChevronDown,
ChevronUp,
CircleHelp,
Contact,
FileText,
FolderKanban,
Gamepad2,
GitFork,
Home,
Image,
LogOut,
Pause,
Pencil,
Play,
Plus,
Send,
Settings,
Target,
Trash2,
User,
Zap,
} from 'lucide-react';
import {
PlatformMudPointWalletEntry,
} from '../../../packages/shared/src/components/PlatformMudPointWalletEntry';
@@ -45,7 +40,6 @@ import {
type PlatformProfileRechargeNativePaymentState,
} from '../../../packages/shared/src/components/PlatformProfileRechargeModal';
import { PlatformProfileWalletLedgerModal } from '../../../packages/shared/src/components/PlatformProfileWalletLedgerModal';
import type {
AuthEntryResponse,
AuthMeResponse,
@@ -106,7 +100,7 @@ import HomeView, {
type HomeDraft,
} from './view/home';
import { useLauncherHomeDraftStore } from './view/home/useHomeDraftStore';
import { Sidebar, type LauncherView } from './view/layout';
import { type LauncherView, Sidebar } from './view/layout';
const seedManifest = createGameCreationAppManifest(
'local-project-draft',
@@ -4125,6 +4119,8 @@ function RuntimeConfigDialog({
useEffect(() => {
void readRuntimeConfig();
// The dialog reads once on mount; subsequent reads are explicit user actions.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
function updateRuntimeLlmConfig<K extends keyof GameCreatorAppConfig['llm']>(
@@ -5860,6 +5856,8 @@ export function WorkspaceLauncher({
return;
}
void loadAgentChatLlmStatus();
// Reload only when the active launcher selection changes.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [launcherView, agentChatSelectedAgentId]);
function validateProjectPath(nextProjectPath: string) {
@@ -17259,6 +17257,8 @@ export function App({
) {
cancelUiCommandConfirmation();
}
// The callbacks intentionally read the latest project refs.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [localProject?.projectPath, projectPath]);
useEffect(() => {
@@ -17284,6 +17284,8 @@ export function App({
return;
}
void openWorkspace(initialProjectPath, false);
// Initial project opening is guarded by initialProjectOpenedRef.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [initialProjectPath, projectSupervisorOnly]);
useEffect(() => {
@@ -17507,6 +17509,8 @@ export function App({
disposed = true;
window.clearInterval(timer);
};
// Polling restarts only when the tracked runtime identity or phase changes.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
localProject?.projectPath,
projectSupervisorSessionId,
@@ -17658,6 +17662,9 @@ export function App({
setConversationWriteVersion((current) => current + 1);
}
});
// Writes are driven by message and confirmation state; the confirmation helper
// intentionally observes the latest policy refs.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [
localProject?.projectPath,
messages,
@@ -19,7 +19,7 @@ import {
import { Upload } from 'lucide-react';
import React, { useEffect, useRef } from 'react';
import type { HomeAttachmentDraft, Draft } from '../../useHomeDraftStore';
import type { Draft, HomeAttachmentDraft } from '../../useHomeDraftStore';
import {
$createAttachmentNode,
AttachmentNode,
@@ -6,7 +6,7 @@ import {
type LexicalNode,
} from 'lexical';
import type { HomeAttachmentDraft, Draft } from '../../useHomeDraftStore';
import type { Draft, HomeAttachmentDraft } from '../../useHomeDraftStore';
import { $isAttachmentNode } from './attachmentNode';
function ordinalSuffix(index: number) {
@@ -1,3 +1,4 @@
import { openUrl } from '@tauri-apps/plugin-opener';
import {
CircleHelp,
FolderKanban,
@@ -8,9 +9,9 @@ import {
} from 'lucide-react';
import { useEffect, useRef, useState } from 'react';
import { getClientProfileDashboard } from '../services/clientApi';
import BRAND_ICON from '../../../../packages/shared/src/icons/taonier-product-ip.png';
import { openUrl } from '@tauri-apps/plugin-opener';
import { getClientProfileDashboard } from '../services/clientApi';
function cx(...classNames: Array<string | false | null | undefined>) {
return classNames.filter(Boolean).join(' ');
}
@@ -267,8 +267,8 @@ function createProjectSupervisorRuntimeHarness({
let messageSequence = 0;
let steerSequence = 0;
let sessionExists = initialSessionExists;
let currentProjectMessages = [...projectMessages];
let currentSupervisorMessages = [...supervisorMessages];
const currentProjectMessages = [...projectMessages];
const currentSupervisorMessages = [...supervisorMessages];
const runtimeState = (
overrides: Record<string, unknown> = {},
): Record<string, unknown> => ({
@@ -20050,7 +20050,7 @@ describe('AI 游戏创作 App 界面边界', () => {
it('keeps Anthropic web search choices visible when the save gate rejects them', async () => {
const invoke = vi.fn(
async (command: string, args?: Record<string, unknown>) => {
async (command: string, _args?: Record<string, unknown>) => {
if (command === 'read_game_creator_app_config') {
return {
path: '/home/test/AppData/game-creator.config.json',
@@ -20187,7 +20187,7 @@ describe('AI 游戏创作 App 界面边界', () => {
it('blocks developer file write confirmation when project policy denies it', async () => {
const invoke = vi.fn(
async (command: string, args?: Record<string, unknown>) => {
async (command: string, _args?: Record<string, unknown>) => {
if (command === 'append_local_permission_log') {
return {};
}
@@ -24946,7 +24946,7 @@ describe('AI 游戏创作 App 界面边界', () => {
'未命名游戏原型',
);
const invoke = vi.fn(
async (command: string, args?: Record<string, unknown>) => {
async (command: string, _args?: Record<string, unknown>) => {
if (command === 'append_local_permission_log') {
return {};
}
@@ -31149,7 +31149,7 @@ describe('AI 游戏创作 App 界面边界', () => {
it('generates platform art assets from the developer asset panel after confirmation', async () => {
const invoke = vi.fn(
async (command: string, args?: Record<string, unknown>) => {
async (command: string, _args?: Record<string, unknown>) => {
if (command === 'append_local_permission_log') {
return {};
}
@@ -31712,7 +31712,7 @@ describe('AI 游戏创作 App 界面边界', () => {
| ((value: { url: string }) => void)
| undefined;
const invoke = vi.fn(
async (command: string, args?: Record<string, unknown>) => {
async (command: string, _args?: Record<string, unknown>) => {
if (command === 'append_local_permission_log') {
return {};
}
@@ -6,7 +6,7 @@ import { describe, expect, test, vi } from 'vitest';
import type { ProfileRechargeProduct } from '@/packages/shared/src';
import { PlatformProfileRechargeModal } from '../../index';
import { PlatformProfileRechargeModal } from './index';
function buildNormalMembership() {
return {
@@ -5,13 +5,13 @@ import userEvent from '@testing-library/user-event';
import { describe, expect, test, vi } from 'vitest';
import type { ProfileWalletLedgerEntry } from '../../contracts/runtime';
import { PlatformProfileWalletLedgerModal } from './index';
import {
buildWalletLedgerPresentation,
formatWalletLedgerAmount,
formatWalletLedgerDate,
getWalletLedgerSourceLabel,
PlatformProfileWalletLedgerModal,
} from './index';
} from './model';
function buildLedgerEntry(
overrides: Partial<ProfileWalletLedgerEntry> = {},
@@ -128,10 +128,3 @@ export function PlatformProfileWalletLedgerModal({
</div>
);
}
export {
buildWalletLedgerPresentation,
formatWalletLedgerAmount,
formatWalletLedgerDate,
getWalletLedgerSourceLabel,
} from './model';
@@ -9,6 +9,8 @@ import {
useState,
} from 'react';
import { PlatformProfileRechargeModal } from '../../../packages/shared/src/components/PlatformProfileRechargeModal';
import { PlatformProfileWalletLedgerModal } from '../../../packages/shared/src/components/PlatformProfileWalletLedgerModal';
import type { EditorAgentGenerationResultEvent } from '../../../packages/shared/src/contracts/editorAgent';
import type { ExternalGenerationTaskRecord } from '../../../packages/shared/src/contracts/externalGeneration';
import { loadFrontendRuntimeConfig } from '../../services/frontendRuntimeConfigService';
@@ -24,8 +26,6 @@ import { shouldShowRechargeEntry } from '../../services/payment/paymentPlatform'
import { getPlatformProfileDashboard } from '../../services/platform-entry/platformProfileClient';
import { useAuthUi } from '../auth/AuthUiContext';
import { PlatformDangerConfirmDialog } from '../common/PlatformDangerConfirmDialog';
import { PlatformProfileRechargeModal } from '../../../packages/shared/src/components/PlatformProfileRechargeModal';
import { PlatformProfileWalletLedgerModal } from '../../../packages/shared/src/components/PlatformProfileWalletLedgerModal';
import { PlatformProfileRewardCodeRedeemModal } from '../platform-entry/PlatformProfileRewardCodeRedeemModal';
import {
PlatformRechargePaymentConfirmationMask,
@@ -1,5 +1,6 @@
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import type { PlatformProfileRechargeNativePaymentState } from '../../../packages/shared/src/components/PlatformProfileRechargeModal';
import {
type ConfirmWechatProfileRechargeOrderResponse,
type ProfileRechargeCenterResponse,
@@ -10,7 +11,6 @@ import {
type ProfileWalletLedgerResponse,
type RedeemProfileRewardCodeResponse,
} from '../../../packages/shared/src/contracts/runtime';
import type { PlatformProfileRechargeNativePaymentState } from '../../../packages/shared/src/components/PlatformProfileRechargeModal';
import {
clearStoredAccessToken,
refreshStoredAccessToken,
@@ -51,6 +51,8 @@ import profileCommunityImage from '../../../media/profile/_Image (7).png';
import profileFeedbackImage from '../../../media/profile/_Image (8).png';
import profileMascotImage from '../../../media/profile/_Image (9).png';
import profilePointImage from '../../../media/profile/_Image.png';
import { PlatformProfileRechargeModal } from '../../../packages/shared/src/components/PlatformProfileRechargeModal';
import { PlatformProfileWalletLedgerModal } from '../../../packages/shared/src/components/PlatformProfileWalletLedgerModal';
import type { PublicUserSummary } from '../../../packages/shared/src/contracts/auth';
import type {
CustomWorldLibraryEntry,
@@ -79,7 +81,6 @@ import {
} from '../../services/host-bridge/hostBridge';
import { shouldShowRechargeEntry } from '../../services/payment/paymentPlatform';
import type { CustomWorldProfile } from '../../types';
import type { PlatformHomeTab } from '../platform-entry/platformEntryTypes';
import { useAuthUi } from '../auth/AuthUiContext';
import { CopyFeedbackButton } from '../common/CopyFeedbackButton';
import { LegalDocumentModal } from '../common/LegalDocumentModal';
@@ -120,6 +121,7 @@ import {
isEdutainmentEntryEnabled,
} from '../platform-entry/platformEdutainmentVisibility';
import { getInitialPlatformDesktopLayout } from '../platform-entry/platformEntryResponsive';
import type { PlatformHomeTab } from '../platform-entry/platformEntryTypes';
import type { ExternalGenerationQueueStatus } from '../platform-entry/platformExternalGenerationQueueStatusModel';
import { PlatformProfileApiKeysModal } from '../platform-entry/PlatformProfileApiKeysModal';
import { PlatformProfileGenerationQueueCard } from '../platform-entry/PlatformProfileGenerationQueueCard';
@@ -133,8 +135,6 @@ import {
ProfileStatCardSkeleton,
} from '../platform-entry/PlatformProfilePrimitives';
import { PlatformProfileQrScannerModal } from '../platform-entry/PlatformProfileQrScannerModal';
import { PlatformProfileRechargeModal } from '../../../packages/shared/src/components/PlatformProfileRechargeModal';
import { PlatformProfileWalletLedgerModal } from '../../../packages/shared/src/components/PlatformProfileWalletLedgerModal';
import { PlatformProfileReferralModal } from '../platform-entry/PlatformProfileReferralModal';
import { PlatformProfileRewardCodeRedeemModal } from '../platform-entry/PlatformProfileRewardCodeRedeemModal';
import {