refactor(cli,core): foundational layout, identity management, and type safety (#23286)

This commit is contained in:
Jarrod Whelan
2026-03-23 18:49:51 -07:00
committed by GitHub
parent 57a66f5f0d
commit 89ca78837e
31 changed files with 477 additions and 182 deletions
@@ -184,28 +184,28 @@ describe('<ShellToolMessage />', () => {
[
'respects availableTerminalHeight when it is smaller than ACTIVE_SHELL_MAX_LINES',
10,
8,
7,
false,
true,
],
[
'uses ACTIVE_SHELL_MAX_LINES when availableTerminalHeight is large',
100,
ACTIVE_SHELL_MAX_LINES - 3,
ACTIVE_SHELL_MAX_LINES - 4,
false,
true,
],
[
'uses full availableTerminalHeight when focused in alternate buffer mode',
100,
98,
97,
true,
false,
],
[
'defaults to ACTIVE_SHELL_MAX_LINES in alternate buffer when availableTerminalHeight is undefined',
undefined,
ACTIVE_SHELL_MAX_LINES - 3,
ACTIVE_SHELL_MAX_LINES - 4,
false,
false,
],
@@ -323,8 +323,8 @@ describe('<ShellToolMessage />', () => {
await waitFor(() => {
const frame = lastFrame();
// Should still be constrained to 12 (15 - 3) because isExpandable is false
expect(frame.match(/Line \d+/g)?.length).toBe(12);
// Should still be constrained to 11 (15 - 4) because isExpandable is false
expect(frame.match(/Line \d+/g)?.length).toBe(11);
});
expect(lastFrame()).toMatchSnapshot();
unmount();
@@ -453,7 +453,6 @@ describe('ToolConfirmationMessage', () => {
cancel: vi.fn(),
isDiffingEnabled: false,
});
const { lastFrame, unmount } = await renderWithProviders(
<ToolConfirmationMessage
callId="test-call-id"
@@ -480,7 +479,6 @@ describe('ToolConfirmationMessage', () => {
cancel: vi.fn(),
isDiffingEnabled: false,
});
const { lastFrame, unmount } = await renderWithProviders(
<ToolConfirmationMessage
callId="test-call-id"
@@ -723,7 +721,6 @@ describe('ToolConfirmationMessage', () => {
cancel: vi.fn(),
isDiffingEnabled: false,
});
const confirmationDetails: SerializableConfirmationDetails = {
type: 'info',
title: 'Confirm Web Fetch',
@@ -4,7 +4,6 @@ exports[`<ShellToolMessage /> > Height Constraints > defaults to ACTIVE_SHELL_MA
"╭──────────────────────────────────────────────────────────────────────────────╮
│ ⊶ Shell Command A shell command │
│ │
│ Line 89 │
│ Line 90 │
│ Line 91 │
│ Line 92 │
@@ -14,7 +13,7 @@ exports[`<ShellToolMessage /> > Height Constraints > defaults to ACTIVE_SHELL_MA
│ Line 96 │
│ Line 97 │
│ Line 98 │
│ Line 99
│ Line 99
│ Line 100 █ │
"
`;
@@ -130,7 +129,6 @@ exports[`<ShellToolMessage /> > Height Constraints > respects availableTerminalH
"╭──────────────────────────────────────────────────────────────────────────────╮
│ ⊶ Shell Command A shell command │
│ │
│ Line 93 │
│ Line 94 │
│ Line 95 │
│ Line 96 │
@@ -145,7 +143,6 @@ exports[`<ShellToolMessage /> > Height Constraints > stays constrained in altern
"╭──────────────────────────────────────────────────────────────────────────────╮
│ ✓ Shell Command A shell command │
│ │
│ Line 89 │
│ Line 90 │
│ Line 91 │
│ Line 92 │
@@ -155,7 +152,7 @@ exports[`<ShellToolMessage /> > Height Constraints > stays constrained in altern
│ Line 96 │
│ Line 97 │
│ Line 98 │
│ Line 99
│ Line 99
│ Line 100 █ │
"
`;
@@ -164,7 +161,6 @@ exports[`<ShellToolMessage /> > Height Constraints > uses ACTIVE_SHELL_MAX_LINES
"╭──────────────────────────────────────────────────────────────────────────────╮
│ ⊶ Shell Command A shell command │
│ │
│ Line 89 │
│ Line 90 │
│ Line 91 │
│ Line 92 │
@@ -174,7 +170,7 @@ exports[`<ShellToolMessage /> > Height Constraints > uses ACTIVE_SHELL_MAX_LINES
│ Line 96 │
│ Line 97 │
│ Line 98 │
│ Line 99
│ Line 99
│ Line 100 █ │
"
`;
@@ -183,10 +179,9 @@ exports[`<ShellToolMessage /> > Height Constraints > uses full availableTerminal
"╭──────────────────────────────────────────────────────────────────────────────╮
│ ⊶ Shell Command A shell command (Shift+Tab to unfocus) │
│ │
│ Line 3 │
│ Line 4 │
│ Line 5
│ Line 6
│ Line 5
│ Line 6
│ Line 7 █ │
│ Line 8 █ │
│ Line 9 █ │
@@ -37,8 +37,7 @@ exports[`ToolResultDisplay > renders string result as plain text when renderOutp
`;
exports[`ToolResultDisplay > truncates very long string results 1`] = `
"... 248 hidden (Ctrl+O) ...
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
"... 249 hidden (Ctrl+O) ...
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa