Skip to content

Commit e38e0c3

Browse files
Delete the unreachable anonymous-user AI sign-up banner
Removing `insert_anonymous_user_ai_sign_up_banner` in the previous commit took away the banner's only entry point, and everything left behind is a closed cycle: the field it wrote is now permanently `None`, so the render site can never fire, so the action can never dispatch, so the handler and the remover that handler calls can never run. Every member of that cycle is still referenced by another member, which is why clippy reports nothing even though the whole feature is unreachable — it has to be cut by hand. `AnonymousUserAISignUpBannerState` had exactly one constructor call and the field exactly one assignment, both inside the deleted inserter; the struct has no derives and no test or debug-only path builds one. The `anonymous_user_ai_sign_up_banner_shown` setting goes with it. It was read and written only by the inserter. It is `private: true` and `SyncToCloud::Never`, so nothing was ever written to the cloud, and every preferences backend is a plain key-value map read per key through `storage_key()`. Nothing enumerates the store to validate it against known settings, so the key existing but unread in a current user's local preferences is inert.
1 parent a87eafe commit e38e0c3

5 files changed

Lines changed: 10 additions & 308 deletions

File tree

app/src/terminal/general_settings.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,6 @@ define_settings_group!(GeneralSettings, settings: [
159159
surface: settings::SettingSurfaces::GUI,
160160
private: true,
161161
},
162-
anonymous_user_ai_sign_up_banner_shown: AnonymousUserAISignUpBannerShown {
163-
type: bool,
164-
default: false,
165-
supported_platforms: SupportedPlatforms::ALL,
166-
sync_to_cloud: SyncToCloud::Never,
167-
surface: settings::SettingSurfaces::GUI,
168-
private: true,
169-
},
170162
auto_open_code_review_pane_on_first_agent_change: AutoOpenCodeReviewPaneOnFirstAgentChange {
171163
type: bool,
172164
default: false,

app/src/terminal/view.rs

Lines changed: 8 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ pub use init::{
8888
};
8989
use init::{INPUT_BOX_VISIBLE_KEY, TOGGLE_BLOCK_FILTER_KEYBINDING};
9090
use inline_banner::{
91-
AliasExpansionBanner, AliasExpansionBannerAction, AnonymousUserAISignUpBannerState,
92-
AnonymousUserLoginBannerAction, AwsBedrockLoginBannerAction, AwsBedrockLoginBannerState,
93-
AwsCliNotInstalledBannerAction, AwsCliNotInstalledBannerState, ByoLlmAuthBannerSessionState,
94-
OpenInWarpBannerState, VimModeBannerAction, render_alias_expansion_banner,
95-
render_aws_bedrock_login_banner, render_aws_cli_not_installed_banner,
96-
render_inline_notifications_discovery_banner, render_inline_notifications_error_banner,
97-
render_inline_shared_session_ended_banner, render_inline_shared_session_started_banner,
98-
render_open_in_warp_banner, render_shell_process_terminated_banner, render_vim_mode_banner,
91+
AliasExpansionBanner, AliasExpansionBannerAction, AwsBedrockLoginBannerAction,
92+
AwsBedrockLoginBannerState, AwsCliNotInstalledBannerAction, AwsCliNotInstalledBannerState,
93+
ByoLlmAuthBannerSessionState, OpenInWarpBannerState, VimModeBannerAction,
94+
render_alias_expansion_banner, render_aws_bedrock_login_banner,
95+
render_aws_cli_not_installed_banner, render_inline_notifications_discovery_banner,
96+
render_inline_notifications_error_banner, render_inline_shared_session_ended_banner,
97+
render_inline_shared_session_started_banner, render_open_in_warp_banner,
98+
render_shell_process_terminated_banner, render_vim_mode_banner,
9999
};
100100
pub use inline_banner::{NotificationsDiscoveryBannerAction, NotificationsErrorBannerAction};
101101
use instant::Instant;
@@ -1017,7 +1017,6 @@ pub enum InlineBannerType {
10171017
VimMode,
10181018
CodebaseIndexSpeedbump,
10191019
AgentModeSetup,
1020-
AnonymousUserAISignUp,
10211020
AwsBedrockLogin,
10221021
AwsCliNotInstalled,
10231022
}
@@ -1031,7 +1030,6 @@ impl InlineBannerType {
10311030
Self::PromptSuggestions
10321031
| Self::CodebaseIndexSpeedbump
10331032
| Self::AgentModeSetup
1034-
| Self::AnonymousUserAISignUp
10351033
| Self::AwsBedrockLogin
10361034
| Self::AwsCliNotInstalled => true,
10371035
// Terminal-context banners: hidden in agent view
@@ -1091,8 +1089,6 @@ struct InlineBannersState {
10911089

10921090
agent_setup_speedbump_banner: Option<AgentModeSetupSpeedbumpBannerState>,
10931091

1094-
anonymous_user_ai_sign_up_banner: Option<AnonymousUserAISignUpBannerState>,
1095-
10961092
aws_bedrock_login_banner: Option<AwsBedrockLoginBannerState>,
10971093

10981094
aws_cli_not_installed_banner: Option<AwsCliNotInstalledBannerState>,
@@ -10706,38 +10702,6 @@ impl TerminalView {
1070610702
// No-op when local filesystem is unavailable.
1070710703
}
1070810704

10709-
fn anonymous_user_ai_sign_up_banner_action(
10710-
&mut self,
10711-
action: AnonymousUserLoginBannerAction,
10712-
ctx: &mut ViewContext<Self>,
10713-
) {
10714-
match action {
10715-
AnonymousUserLoginBannerAction::SignUp => {
10716-
ctx.emit(Event::SignupAnonymousUser {
10717-
entrypoint: AnonymousUserSignupEntrypoint::LoginGatedFeature,
10718-
});
10719-
self.remove_anonymous_user_ai_sign_up_banner(ctx);
10720-
}
10721-
AnonymousUserLoginBannerAction::Close => {
10722-
self.remove_anonymous_user_ai_sign_up_banner(ctx);
10723-
}
10724-
}
10725-
}
10726-
10727-
fn remove_anonymous_user_ai_sign_up_banner(&mut self, ctx: &mut ViewContext<Self>) {
10728-
if let Some(banner_state) = self
10729-
.inline_banners_state
10730-
.anonymous_user_ai_sign_up_banner
10731-
.take()
10732-
{
10733-
self.model
10734-
.lock()
10735-
.block_list_mut()
10736-
.remove_inline_banner(banner_state.id);
10737-
ctx.notify();
10738-
}
10739-
}
10740-
1074110705
fn remove_aws_bedrock_login_banner(&mut self, ctx: &mut ViewContext<Self>) {
1074210706
if let Some(banner_state) = self.inline_banners_state.aws_bedrock_login_banner.take() {
1074310707
self.model
@@ -24347,10 +24311,6 @@ impl TerminalView {
2434724311
);
2434824312
}
2434924313

24350-
if let Some(banner_state) = &self.inline_banners_state.anonymous_user_ai_sign_up_banner {
24351-
inline_banners.insert(banner_state.id, banner_state.render(appearance));
24352-
}
24353-
2435424314
if let Some(banner_state) = &self.inline_banners_state.aws_bedrock_login_banner {
2435524315
inline_banners.insert(
2435624316
banner_state.id,
@@ -26891,7 +26851,6 @@ impl TypedActionView for TerminalView {
2689126851
| AddProjectAtCurrentDirectory
2689226852
| CodebaseIndexSpeedbumpBanner(_)
2689326853
| AgentModeSetupSpeedbumpBanner(_)
26894-
| AnonymousUserAISignUpBanner(_)
2689526854
| SetupCloudEnvironment(_)
2689626855
| SetupCloudEnvironmentAndStart(_)
2689726856
| TriggerEnvironmentSetupSelection(_)
@@ -27644,9 +27603,6 @@ impl TypedActionView for TerminalView {
2764427603
AgentModeSetupSpeedbumpBanner(action) => {
2764527604
self.agent_mode_setup_speedbump_banner_action(*action, ctx)
2764627605
}
27647-
AnonymousUserAISignUpBanner(action) => {
27648-
self.anonymous_user_ai_sign_up_banner_action(*action, ctx);
27649-
}
2765027606
ResumeConversation => {
2765127607
// With Agent View, we want to resume the conversation the user is currently viewing,
2765227608
// not necessarily the most recently created one.

app/src/terminal/view/action.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use warpui::event::ModifiersState;
1515
use warpui::units::Lines;
1616

1717
use super::inline_banner::{
18-
AnonymousUserLoginBannerAction, AwsBedrockLoginBannerAction, AwsCliNotInstalledBannerAction,
19-
OpenInWarpBannerAction, VimModeBannerAction,
18+
AwsBedrockLoginBannerAction, AwsCliNotInstalledBannerAction, OpenInWarpBannerAction,
19+
VimModeBannerAction,
2020
};
2121
use super::{
2222
AliasExpansionBannerAction, ContextMenuAction, GridHighlightedLink, InputContextMenuAction,
@@ -356,7 +356,6 @@ pub enum TerminalAction {
356356
ToggleQueueNextPrompt,
357357
CodebaseIndexSpeedbumpBanner(CodebaseIndexSpeedbumpBannerAction),
358358
AgentModeSetupSpeedbumpBanner(AgentModeSetupSpeedbumpBannerAction),
359-
AnonymousUserAISignUpBanner(AnonymousUserLoginBannerAction),
360359
ResumeConversation,
361360
ForkConversationFromLastKnownGoodState,
362361
ToggleAIDocumentPane,
@@ -690,9 +689,6 @@ impl fmt::Debug for TerminalAction {
690689
AgentModeSetupSpeedbumpBanner(action) => {
691690
write!(f, "AgentModeSetupSpeedbumpBanner({action:?})")
692691
}
693-
AnonymousUserAISignUpBanner(action) => {
694-
write!(f, "AnonymousUserLoginBanner({action:?})")
695-
}
696692
ResumeConversation => write!(f, "ResumeConversation"),
697693
ForkConversationFromLastKnownGoodState => {
698694
write!(f, "ForkConversationFromLastKnownGoodState")

0 commit comments

Comments
 (0)