Skip to content

Commit 3e80f41

Browse files
committed
fix(tui): remove dead PlaceholderScreen and fix gateway wizard UX
- Remove unreachable PlaceholderScreen route and component (dead code) - Add exitEnabled={false} to gateway wizard Screen to prevent accidental Escape exit mid-flow - Show friendly authorizer name in confirm review instead of raw enum - Update output key comment to document hash suffix pattern
1 parent aec6102 commit 3e80f41

5 files changed

Lines changed: 11 additions & 31 deletions

File tree

src/cli/cloudformation/outputs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function parseGatewayOutputs(
5252
const gatewayNames = Object.keys(gatewaySpecs);
5353
const gatewayIdMap = new Map(gatewayNames.map(name => [toPascalId(name), name]));
5454

55-
// Match patterns: Gateway{Name}{Type}Output
55+
// Match patterns: Gateway{Name}{Type}Output{Hash}
5656
const outputPattern = /^Gateway(.+?)(Id|Arn|Url)Output/;
5757

5858
for (const [key, value] of Object.entries(outputs)) {

src/cli/tui/App.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { getWorkingDirectory } from '../../lib';
22
import { createProgram } from '../cli';
33
import { LayoutProvider } from './context';
44
import { MissingProjectMessage, WrongDirectoryMessage, getProjectRootMismatch, projectExists } from './guards';
5-
import { PlaceholderScreen } from './screens/PlaceholderScreen';
65
import { AddFlow } from './screens/add/AddFlow';
76
import { CreateScreen } from './screens/create';
87
import { DeployScreen } from './screens/deploy/DeployScreen';
@@ -17,7 +16,7 @@ import { RunEvalFlow, RunScreen } from './screens/run-eval';
1716
import { StatusScreen } from './screens/status/StatusScreen';
1817
import { UpdateScreen } from './screens/update';
1918
import { ValidateScreen } from './screens/validate';
20-
import { type CommandMeta, getCommandsForUI } from './utils/commands';
19+
import { getCommandsForUI } from './utils/commands';
2120
import { useApp } from 'ink';
2221
import React, { useState } from 'react';
2322

@@ -27,7 +26,6 @@ const cwd = getWorkingDirectory();
2726
type Route =
2827
| { name: 'home' }
2928
| { name: 'help'; initialQuery?: string }
30-
| { name: 'command'; command: CommandMeta }
3129
| { name: 'dev' }
3230
| { name: 'deploy' }
3331
| { name: 'invoke' }
@@ -102,8 +100,6 @@ function AppContent() {
102100
setRoute({ name: 'package' });
103101
} else if (id === 'update') {
104102
setRoute({ name: 'update' });
105-
} else {
106-
setRoute({ name: 'command', command: cmd });
107103
}
108104
};
109105

@@ -243,7 +239,8 @@ function AppContent() {
243239
return <UpdateScreen isInteractive={true} onExit={() => setRoute({ name: 'help' })} />;
244240
}
245241

246-
return <PlaceholderScreen command={route.command} onBack={() => setRoute({ name: 'help' })} />;
242+
// All visible commands are handled above; this is unreachable.
243+
return null;
247244
}
248245

249246
export function App() {

src/cli/tui/screens/PlaceholderScreen.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/cli/tui/screens/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
export { PlaceholderScreen } from './PlaceholderScreen';
21
export { DevScreen } from './dev';
32
export { InvokeScreen } from './invoke';
43
export { StatusScreen } from './status';

src/cli/tui/screens/mcp/AddGatewayScreen.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export function AddGatewayScreen({ onComplete, onExit, existingGateways, unassig
179179
const headerContent = <StepIndicator steps={wizard.steps} currentStep={wizard.step} labels={GATEWAY_STEP_LABELS} />;
180180

181181
return (
182-
<Screen title="Add Gateway" onExit={onExit} helpText={helpText} headerContent={headerContent}>
182+
<Screen title="Add Gateway" onExit={onExit} helpText={helpText} headerContent={headerContent} exitEnabled={false}>
183183
<Panel>
184184
{isNameStep && (
185185
<TextInput
@@ -263,7 +263,12 @@ export function AddGatewayScreen({ onComplete, onExit, existingGateways, unassig
263263
fields={[
264264
{ label: 'Name', value: wizard.config.name },
265265
{ label: 'Description', value: wizard.config.description },
266-
{ label: 'Authorizer', value: wizard.config.authorizerType },
266+
{
267+
label: 'Authorizer',
268+
value:
269+
AUTHORIZER_TYPE_OPTIONS.find(o => o.id === wizard.config.authorizerType)?.title ??
270+
wizard.config.authorizerType,
271+
},
267272
...(wizard.config.authorizerType === 'CUSTOM_JWT' && wizard.config.jwtConfig
268273
? [
269274
{ label: 'Discovery URL', value: wizard.config.jwtConfig.discoveryUrl },

0 commit comments

Comments
 (0)