mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-15 16:41:11 -07:00
fix(cli): ensure past messages re-render when terminal theme changes
This commit is contained in:
@@ -75,7 +75,7 @@ export const MainContent = () => {
|
|||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
availableTerminalHeightGemini={MAX_GEMINI_MESSAGE_LINES}
|
availableTerminalHeightGemini={MAX_GEMINI_MESSAGE_LINES}
|
||||||
key={h.id}
|
key={`${h.id}-${uiState.historyRemountKey}`}
|
||||||
item={h}
|
item={h}
|
||||||
isPending={false}
|
isPending={false}
|
||||||
commands={uiState.slashCommands}
|
commands={uiState.slashCommands}
|
||||||
@@ -90,6 +90,7 @@ export const MainContent = () => {
|
|||||||
uiState.slashCommands,
|
uiState.slashCommands,
|
||||||
uiState.constrainHeight,
|
uiState.constrainHeight,
|
||||||
lastUserPromptIndex,
|
lastUserPromptIndex,
|
||||||
|
uiState.historyRemountKey,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -108,7 +109,7 @@ export const MainContent = () => {
|
|||||||
<Box flexDirection="column">
|
<Box flexDirection="column">
|
||||||
{pendingHistoryItems.map((item, i) => (
|
{pendingHistoryItems.map((item, i) => (
|
||||||
<HistoryItemDisplay
|
<HistoryItemDisplay
|
||||||
key={i}
|
key={`pending-${i}-${uiState.historyRemountKey}`}
|
||||||
availableTerminalHeight={
|
availableTerminalHeight={
|
||||||
uiState.constrainHeight ? staticAreaMaxItemHeight : undefined
|
uiState.constrainHeight ? staticAreaMaxItemHeight : undefined
|
||||||
}
|
}
|
||||||
@@ -130,6 +131,7 @@ export const MainContent = () => {
|
|||||||
mainAreaWidth,
|
mainAreaWidth,
|
||||||
showConfirmationQueue,
|
showConfirmationQueue,
|
||||||
confirmingTool,
|
confirmingTool,
|
||||||
|
uiState.historyRemountKey,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -151,7 +153,7 @@ export const MainContent = () => {
|
|||||||
if (item.type === 'header') {
|
if (item.type === 'header') {
|
||||||
return (
|
return (
|
||||||
<MemoizedAppHeader
|
<MemoizedAppHeader
|
||||||
key="app-header"
|
key={`app-header-${uiState.historyRemountKey}`}
|
||||||
version={version}
|
version={version}
|
||||||
showDetails={showHeaderDetails}
|
showDetails={showHeaderDetails}
|
||||||
/>
|
/>
|
||||||
@@ -166,7 +168,7 @@ export const MainContent = () => {
|
|||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
availableTerminalHeightGemini={MAX_GEMINI_MESSAGE_LINES}
|
availableTerminalHeightGemini={MAX_GEMINI_MESSAGE_LINES}
|
||||||
key={item.item.id}
|
key={`${item.item.id}-${uiState.historyRemountKey}`}
|
||||||
item={item.item}
|
item={item.item}
|
||||||
isPending={false}
|
isPending={false}
|
||||||
commands={uiState.slashCommands}
|
commands={uiState.slashCommands}
|
||||||
@@ -185,6 +187,7 @@ export const MainContent = () => {
|
|||||||
pendingItems,
|
pendingItems,
|
||||||
uiState.constrainHeight,
|
uiState.constrainHeight,
|
||||||
staticAreaMaxItemHeight,
|
staticAreaMaxItemHeight,
|
||||||
|
uiState.historyRemountKey,
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -198,9 +201,11 @@ export const MainContent = () => {
|
|||||||
renderItem={renderItem}
|
renderItem={renderItem}
|
||||||
estimatedItemHeight={() => 100}
|
estimatedItemHeight={() => 100}
|
||||||
keyExtractor={(item, _index) => {
|
keyExtractor={(item, _index) => {
|
||||||
if (item.type === 'header') return 'header';
|
if (item.type === 'header')
|
||||||
if (item.type === 'history') return item.item.id.toString();
|
return `header-${uiState.historyRemountKey}`;
|
||||||
return 'pending';
|
if (item.type === 'history')
|
||||||
|
return `${item.item.id}-${uiState.historyRemountKey}`;
|
||||||
|
return `pending-${uiState.historyRemountKey}`;
|
||||||
}}
|
}}
|
||||||
initialScrollIndex={SCROLL_TO_ITEM_END}
|
initialScrollIndex={SCROLL_TO_ITEM_END}
|
||||||
initialScrollOffsetInIndex={SCROLL_TO_ITEM_END}
|
initialScrollOffsetInIndex={SCROLL_TO_ITEM_END}
|
||||||
|
|||||||
Reference in New Issue
Block a user