Skip to content

fix(cli): restore approval-mode reference dropped in #4600 (InputPrompt build break) - #4724

Closed
LaZzyMan wants to merge 1 commit into
mainfrom
lazzy/sharp-mcnulty-01c3d4
Closed

fix(cli): restore approval-mode reference dropped in #4600 (InputPrompt build break)#4724
LaZzyMan wants to merge 1 commit into
mainfrom
lazzy/sharp-mcnulty-01c3d4

Conversation

@LaZzyMan

@LaZzyMan LaZzyMan commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

origin/main currently fails npm run build (tsc) on a dangling identifier:

packages/cli/src/ui/components/InputPrompt.tsx: error TS2304: Cannot find name 'showYoloStyling'.

#4600 unified the approval-mode prompt styling into a single approvalModePromptStyle constant and removed the old showAutoAcceptStyling / showYoloStyling constants, but left one dangling reference to showYoloStyling in the prefixWidth calculation. npm run bundle (esbuild) doesn't type-check, so the break only surfaces under npm run build / tsc --build — which is how it reached main.

Fix

Replace the dangling reference with approvalMode === ApprovalMode.YOLO, matching how the rest of the file branches on approval mode after #4600 (e.g. the statusText block just above).

Both ternary arms intentionally stay 2: getApprovalModePromptStyle is typed to return prefix: '>' | '*', so every approval-mode prefix is a single character and the rendered prefix width — hence cursor positioning — is unchanged. Pure build fix, no behavioral change.

Verification

  • npm run build green (full tsc --build clean)
  • pre-commit eslint --fix --max-warnings 0 passes on the changed file (0 warnings)

#4600 unified the approval-mode prompt styling into approvalModePromptStyle and removed the showAutoAcceptStyling / showYoloStyling constants, but left a dangling showYoloStyling reference in the prefixWidth calculation. This broke the tsc build (TS2304: Cannot find name showYoloStyling). npm run bundle (esbuild) skips type-checking, so the break only surfaced under npm run build / tsc --build.

Replace it with approvalMode === ApprovalMode.YOLO, matching how the rest of the file branches on approval mode after #4600. Both ternary arms stay 2 because every approval-mode prefix is a single char (getApprovalModePromptStyle returns prefix > or *), so the rendered prefix width and cursor positioning are unchanged.
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

📋 Review Summary

This PR fixes a TypeScript compilation error introduced in #4600 where a dangling reference to showYoloStyling was left in the prefixWidth calculation. The fix replaces the undefined identifier with approvalMode === ApprovalMode.YOLO, which is consistent with the rest of the file after the approval-mode prompt styling unification.

🔍 General Feedback

  • The fix is minimal and surgical - exactly what's needed for a build break
  • The change maintains consistency with how the file now handles approval mode branching
  • Good verification steps provided in the PR description
  • The semantic meaning is preserved: both ternary arms return 2 for the prefix width

🎯 Specific Feedback

No specific issues identified in this review.

✅ Highlights

  • Excellent catch on identifying the root cause of the build failure
  • The fix correctly uses approvalMode === ApprovalMode.YOLO which matches the pattern used elsewhere in the file (e.g., the statusText block)
  • Proper verification with npm run build and eslint
  • The PR description clearly explains why the break occurred and why esbuild didn't catch it

@LaZzyMan LaZzyMan closed this Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant