mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-27 20:22:58 -07:00
Checkpoint no commit.
This commit is contained in:
@@ -59,6 +59,7 @@ describe('ToolConfirmationQueue', () => {
|
||||
getPlansDir: () => '/mock/temp/plans',
|
||||
},
|
||||
getUseAlternateBuffer: () => false,
|
||||
getUseTerminalBuffer: () => false,
|
||||
} as unknown as Config;
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -35,6 +35,7 @@ interface ScrollableListProps<T> extends VirtualizedListProps<T> {
|
||||
stableScrollback?: boolean;
|
||||
copyModeEnabled?: boolean;
|
||||
isStatic?: boolean;
|
||||
fixedItemHeight?: boolean;
|
||||
}
|
||||
|
||||
export type ScrollableListRef<T> = VirtualizedListRef<T>;
|
||||
|
||||
@@ -39,6 +39,7 @@ export type VirtualizedListProps<T> = {
|
||||
scrollbar?: boolean;
|
||||
stableScrollback?: boolean;
|
||||
copyModeEnabled?: boolean;
|
||||
fixedItemHeight?: boolean;
|
||||
};
|
||||
|
||||
export type VirtualizedListRef<T> = {
|
||||
@@ -131,6 +132,7 @@ function VirtualizedList<T>(
|
||||
scrollbar = true,
|
||||
stableScrollback,
|
||||
copyModeEnabled = false,
|
||||
fixedItemHeight = false,
|
||||
} = props;
|
||||
const dataRef = useRef(data);
|
||||
useLayoutEffect(() => {
|
||||
@@ -443,14 +445,14 @@ function VirtualizedList<T>(
|
||||
const key = keyExtractor(item, i);
|
||||
// Always update the key mapping because React can reuse nodes at different indices/keys
|
||||
nodeToKeyRef.current.set(node, key);
|
||||
if (!isStatic && !observedNodes.current.has(node)) {
|
||||
if (!isStatic && !fixedItemHeight && !observedNodes.current.has(node)) {
|
||||
itemsObserver.observe(node);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const node of observedNodes.current) {
|
||||
if (!currentNodes.has(node)) {
|
||||
if (!isStatic) {
|
||||
if (!isStatic && !fixedItemHeight) {
|
||||
itemsObserver.unobserve(node);
|
||||
}
|
||||
nodeToKeyRef.current.delete(node);
|
||||
|
||||
Reference in New Issue
Block a user