style: 完成所有文件的lint

This commit is contained in:
claude-code-best
2026-05-01 21:39:30 +08:00
parent d136872cc9
commit 6182015005
1333 changed files with 68255 additions and 77882 deletions

View File

@@ -1,10 +1,10 @@
import React, { useContext, useRef } from 'react'
import { useTerminalViewport, Box } from '@anthropic/ink'
import { InVirtualListContext } from './messageActions.js'
import React, { useContext, useRef } from 'react';
import { useTerminalViewport, Box } from '@anthropic/ink';
import { InVirtualListContext } from './messageActions.js';
type Props = {
children: React.ReactNode
}
children: React.ReactNode;
};
/**
* Freezes children when they scroll above the terminal viewport (into scrollback).
@@ -23,16 +23,16 @@ type Props = {
export function OffscreenFreeze({ children }: Props): React.ReactNode {
// React Compiler: reading cached.current in the return is the entire
// freeze mechanism — memoizing this component would defeat it. Opt out.
'use no memo'
const inVirtualList = useContext(InVirtualListContext)
const [ref, { isVisible }] = useTerminalViewport()
const cached = useRef(children)
'use no memo';
const inVirtualList = useContext(InVirtualListContext);
const [ref, { isVisible }] = useTerminalViewport();
const cached = useRef(children);
// Virtual list has no terminal scrollback — the ScrollBox clips inside the
// viewport, so there's nothing to freeze. Freezing there also blocks
// click-to-expand since useTerminalViewport's visibility calc can disagree
// with the ScrollBox's virtual scroll position.
if (isVisible || inVirtualList) {
cached.current = children
cached.current = children;
}
return <Box ref={ref}>{cached.current}</Box>
return <Box ref={ref}>{cached.current}</Box>;
}