diff --git a/codex-rs/tui/src/onboarding/onboarding_screen.rs b/codex-rs/tui/src/onboarding/onboarding_screen.rs index c30ee500a..0c7ebda08 100644 --- a/codex-rs/tui/src/onboarding/onboarding_screen.rs +++ b/codex-rs/tui/src/onboarding/onboarding_screen.rs @@ -139,7 +139,6 @@ impl OnboardingScreen { error: None, })) } - // TODO: add git warning. Self { request_frame: tui.frame_requester(), steps, diff --git a/codex-rs/tui/src/onboarding/trust_directory.rs b/codex-rs/tui/src/onboarding/trust_directory.rs index f04e9f9af..5a1626fda 100644 --- a/codex-rs/tui/src/onboarding/trust_directory.rs +++ b/codex-rs/tui/src/onboarding/trust_directory.rs @@ -51,6 +51,23 @@ impl WidgetRef for &TrustDirectoryWidget { ])); column.push(""); + if self.cwd != self.trust_target { + #[allow(clippy::disallowed_methods)] + let git_root_warning = Paragraph::new(format!( + "Note: You’re in a subdirectory of a Git project. Trusting will apply to the repository root: {}", + self.trust_target.display() + )) + .yellow(); + column.push( + git_root_warning + .wrap(Wrap { trim: true }) + .inset(Insets::tlbr( + /*top*/ 0, /*left*/ 2, /*bottom*/ 0, /*right*/ 0, + )), + ); + column.push(""); + } + column.push( Paragraph::new( "Do you trust the contents of this directory? Working with untrusted \