Merge remote-tracking branch 'origin/feat/background-agent-control' into feat/background-agent-ui

# Conflicts:
#	packages/cli/src/ui/AppContainer.tsx
#	packages/cli/src/ui/components/DialogManager.tsx
This commit is contained in:
愚远 2026-04-26 14:31:36 +08:00
commit 0cb6395d31
273 changed files with 23593 additions and 5416 deletions

View file

@ -293,6 +293,11 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
[],
);
// Ref to inputHistory.resetHistoryNav, populated after useInputHistory runs.
// Needed because handleSubmitAndClear is passed into useInputHistory as
// onSubmit, so we can't reference inputHistory directly here without a cycle.
const resetHistoryNavRef = useRef<() => void>(() => {});
const handleSubmitAndClear = useCallback(
(submittedValue: string) => {
// Expand any large paste placeholders to their full content before submitting
@ -330,6 +335,10 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
buffer.setText('');
onSubmit(finalValue);
// Reset history navigation so the next Up-arrow starts from the newest
// entry rather than advancing from whatever index the user picked.
resetHistoryNavRef.current();
// Dismiss follow-up suggestion after submit
followup.dismiss();
@ -373,6 +382,8 @@ export const InputPrompt: React.FC<InputPromptProps> = ({
onChange: customSetTextAndResetCompletionSignal,
});
resetHistoryNavRef.current = inputHistory.resetHistoryNav;
// When an arena session starts (agents appear), reset history position so
// that pressing down-arrow immediately focuses the agent tab bar instead
// of cycling through input history.