统一 Rust 与 TypeScript 格式化门禁
纳入 AGC Cargo workspace 的统一 rustfmt 检查与格式化入口 完成项目 TypeScript/Prettier 与 Rust 全量格式化 修复 Pingora expected executable 门禁的空白敏感误报 同步开发运维文档与 AGC skill pack 格式化忽略规则
This commit is contained in:
@@ -34,7 +34,9 @@ function hasSeenRouteImageReady() {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
return window.sessionStorage.getItem(getRouteImageReadySessionKey()) === '1';
|
||||
return (
|
||||
window.sessionStorage.getItem(getRouteImageReadySessionKey()) === '1'
|
||||
);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
@@ -202,8 +204,7 @@ export function RouteImageReadyGate({
|
||||
const shouldRescan = mutations.some((mutation) => {
|
||||
if (mutation.type === 'childList') {
|
||||
return (
|
||||
mutation.addedNodes.length > 0 ||
|
||||
mutation.removedNodes.length > 0
|
||||
mutation.addedNodes.length > 0 || mutation.removedNodes.length > 0
|
||||
);
|
||||
}
|
||||
if (mutation.type !== 'attributes') {
|
||||
|
||||
@@ -14,9 +14,7 @@ import {
|
||||
|
||||
describe('appPageRoutes', () => {
|
||||
it('hides the legacy profile feedback route', () => {
|
||||
expect(resolveSelectionStageFromPath('/profile/feedback')).toBe(
|
||||
'platform',
|
||||
);
|
||||
expect(resolveSelectionStageFromPath('/profile/feedback')).toBe('platform');
|
||||
expect(resolveSelectionStageFromPath('/profile/feedback/')).toBe(
|
||||
'platform',
|
||||
);
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
|
||||
import { matchAppRoute, shouldUseRecommendationRouteLoading } from './appRoutes';
|
||||
import {
|
||||
matchAppRoute,
|
||||
shouldUseRecommendationRouteLoading,
|
||||
} from './appRoutes';
|
||||
|
||||
afterEach(() => {
|
||||
vi.unstubAllEnvs();
|
||||
|
||||
@@ -41,11 +41,21 @@ export type ResolvedAppRoute = {
|
||||
};
|
||||
|
||||
const GameApp = lazy(() => import('../AuthenticatedApp')) as AppRouteComponent;
|
||||
const BigFishPlaygroundApp = lazy(() => import('../BigFishPlaygroundApp')) as AppRouteComponent;
|
||||
const Match3DPlaygroundApp = lazy(() => import('../Match3DPlaygroundApp')) as AppRouteComponent;
|
||||
const BarkBattlePlaygroundApp = lazy(() => import('../BarkBattlePlaygroundApp')) as AppRouteComponent;
|
||||
const PuzzlePlaygroundApp = lazy(() => import('../PuzzlePlaygroundApp')) as AppRouteComponent;
|
||||
const ChildMotionDemoApp = lazy(() => import('../ChildMotionDemoApp')) as AppRouteComponent;
|
||||
const BigFishPlaygroundApp = lazy(
|
||||
() => import('../BigFishPlaygroundApp'),
|
||||
) as AppRouteComponent;
|
||||
const Match3DPlaygroundApp = lazy(
|
||||
() => import('../Match3DPlaygroundApp'),
|
||||
) as AppRouteComponent;
|
||||
const BarkBattlePlaygroundApp = lazy(
|
||||
() => import('../BarkBattlePlaygroundApp'),
|
||||
) as AppRouteComponent;
|
||||
const PuzzlePlaygroundApp = lazy(
|
||||
() => import('../PuzzlePlaygroundApp'),
|
||||
) as AppRouteComponent;
|
||||
const ChildMotionDemoApp = lazy(
|
||||
() => import('../ChildMotionDemoApp'),
|
||||
) as AppRouteComponent;
|
||||
const BabyLoveDrawingRuntimeApp = lazy(
|
||||
() => import('../components/edutainment-runtime/BabyLoveDrawingRuntimeShell'),
|
||||
) as AppRouteComponent;
|
||||
@@ -88,10 +98,7 @@ export function matchAppRoute(pathname: string): AppRouteMatch {
|
||||
};
|
||||
}
|
||||
|
||||
if (
|
||||
normalizedPath === '/child-motion-demo' &&
|
||||
isEdutainmentEntryEnabled()
|
||||
) {
|
||||
if (normalizedPath === '/child-motion-demo' && isEdutainmentEntryEnabled()) {
|
||||
return {
|
||||
kind: 'child-motion-demo',
|
||||
};
|
||||
|
||||
@@ -39,9 +39,7 @@ export function normalizePreloadImageUrl(rawUrl: string) {
|
||||
}
|
||||
|
||||
const baseUrl =
|
||||
typeof document === 'undefined'
|
||||
? 'http://localhost/'
|
||||
: document.baseURI;
|
||||
typeof document === 'undefined' ? 'http://localhost/' : document.baseURI;
|
||||
|
||||
try {
|
||||
return new URL(trimmedUrl, baseUrl).href;
|
||||
@@ -84,7 +82,10 @@ export function hasCssImageUrlChange(mutation: MutationRecord) {
|
||||
|
||||
export function collectRouteImageUrls(root: HTMLElement) {
|
||||
const urls = new Set<string>();
|
||||
const elements = [root, ...Array.from(root.querySelectorAll<HTMLElement>('*'))];
|
||||
const elements = [
|
||||
root,
|
||||
...Array.from(root.querySelectorAll<HTMLElement>('*')),
|
||||
];
|
||||
|
||||
root.querySelectorAll<HTMLImageElement>('img').forEach((image) => {
|
||||
addNormalizedImageUrl(urls, image.currentSrc);
|
||||
|
||||
@@ -19,8 +19,12 @@ test('runtime not found recovery returns home after direct runtime route alert',
|
||||
});
|
||||
|
||||
test('runtime not found recovery only handles direct runtime routes', () => {
|
||||
expect(resolveRuntimeNotFoundRecoveryAction('/gallery/puzzle/detail')).toBeNull();
|
||||
expect(resolveRuntimeNotFoundRecoveryAction('/creation/puzzle/result')).toBeNull();
|
||||
expect(
|
||||
resolveRuntimeNotFoundRecoveryAction('/gallery/puzzle/detail'),
|
||||
).toBeNull();
|
||||
expect(
|
||||
resolveRuntimeNotFoundRecoveryAction('/creation/puzzle/result'),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
test('work not found recovery returns home for direct public detail routes', () => {
|
||||
|
||||
Reference in New Issue
Block a user