Allow local AI without account signup
This commit is contained in:
@@ -20,7 +20,6 @@ use galaxyui::elements::{
|
|||||||
use galaxyui::fonts::{Properties, Weight};
|
use galaxyui::fonts::{Properties, Weight};
|
||||||
use galaxyui::keymap::{ContextPredicate, FixedBinding, Keystroke};
|
use galaxyui::keymap::{ContextPredicate, FixedBinding, Keystroke};
|
||||||
use galaxyui::platform::Cursor;
|
use galaxyui::platform::Cursor;
|
||||||
use galaxyui::ui_components::button::ButtonVariant;
|
|
||||||
use galaxyui::ui_components::components::{Coords, UiComponent, UiComponentStyles};
|
use galaxyui::ui_components::components::{Coords, UiComponent, UiComponentStyles};
|
||||||
use galaxyui::ui_components::slider::SliderStateHandle;
|
use galaxyui::ui_components::slider::SliderStateHandle;
|
||||||
use galaxyui::ui_components::switch::{SwitchStateHandle, TooltipConfig};
|
use galaxyui::ui_components::switch::{SwitchStateHandle, TooltipConfig};
|
||||||
@@ -3017,7 +3016,6 @@ pub enum AISettingsPageAction {
|
|||||||
AddToMCPDenylist(uuid::Uuid),
|
AddToMCPDenylist(uuid::Uuid),
|
||||||
RemoveFromMCPDenylist(uuid::Uuid),
|
RemoveFromMCPDenylist(uuid::Uuid),
|
||||||
CreateProfile,
|
CreateProfile,
|
||||||
SignupAnonymousUser,
|
|
||||||
ToggleBedrockEnabled,
|
ToggleBedrockEnabled,
|
||||||
ToggleOpenAIEnabled,
|
ToggleOpenAIEnabled,
|
||||||
ConnectChatGPTSubscription,
|
ConnectChatGPTSubscription,
|
||||||
@@ -3732,9 +3730,6 @@ impl TypedActionView for AISettingsPageView {
|
|||||||
}
|
}
|
||||||
ctx.notify();
|
ctx.notify();
|
||||||
}
|
}
|
||||||
AISettingsPageAction::SignupAnonymousUser => {
|
|
||||||
ctx.emit(AISettingsPageEvent::SignupAnonymousUser);
|
|
||||||
}
|
|
||||||
AISettingsPageAction::ToggleCloudAgentComputerUse => {
|
AISettingsPageAction::ToggleCloudAgentComputerUse => {
|
||||||
AISettings::handle(ctx).update(ctx, |settings, ctx| {
|
AISettings::handle(ctx).update(ctx, |settings, ctx| {
|
||||||
report_if_error!(settings
|
report_if_error!(settings
|
||||||
@@ -4187,7 +4182,6 @@ fn render_ai_list(
|
|||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
struct GlobalAIWidget {
|
struct GlobalAIWidget {
|
||||||
switch_state: SwitchStateHandle,
|
switch_state: SwitchStateHandle,
|
||||||
sign_up_button: MouseStateHandle,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SettingsWidget for GlobalAIWidget {
|
impl SettingsWidget for GlobalAIWidget {
|
||||||
@@ -4208,10 +4202,6 @@ impl SettingsWidget for GlobalAIWidget {
|
|||||||
let is_ai_disabled_due_to_remote_session_org_policy =
|
let is_ai_disabled_due_to_remote_session_org_policy =
|
||||||
AISettings::as_ref(app).is_ai_disabled_due_to_remote_session_org_policy(app);
|
AISettings::as_ref(app).is_ai_disabled_due_to_remote_session_org_policy(app);
|
||||||
|
|
||||||
let is_anonymous = AuthStateProvider::as_ref(app)
|
|
||||||
.get()
|
|
||||||
.is_anonymous_or_logged_out();
|
|
||||||
|
|
||||||
let mut row = Flex::row()
|
let mut row = Flex::row()
|
||||||
.with_main_axis_size(MainAxisSize::Max)
|
.with_main_axis_size(MainAxisSize::Max)
|
||||||
.with_main_axis_alignment(MainAxisAlignment::SpaceBetween)
|
.with_main_axis_alignment(MainAxisAlignment::SpaceBetween)
|
||||||
@@ -4244,75 +4234,20 @@ impl SettingsWidget for GlobalAIWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show sign-up button for anonymous users, toggle for logged-in users
|
row.add_child(
|
||||||
if is_anonymous {
|
Container::new(
|
||||||
row.add_child(
|
ui_builder
|
||||||
Flex::row()
|
.switch(self.switch_state.clone())
|
||||||
.with_cross_axis_alignment(CrossAxisAlignment::Center)
|
.check(AISettings::as_ref(app).is_any_ai_enabled(app))
|
||||||
.with_child(
|
.build()
|
||||||
Container::new(
|
.on_click(move |ctx, _, _| {
|
||||||
Text::new_inline(
|
ctx.dispatch_typed_action(AISettingsPageAction::ToggleGlobalAI);
|
||||||
"To use AI features, please create an account.",
|
})
|
||||||
appearance.ui_font_family(),
|
|
||||||
14.,
|
|
||||||
)
|
|
||||||
.with_color(
|
|
||||||
appearance
|
|
||||||
.theme()
|
|
||||||
.sub_text_color(appearance.theme().surface_2())
|
|
||||||
.into_solid(),
|
|
||||||
)
|
|
||||||
.finish(),
|
|
||||||
)
|
|
||||||
.with_margin_right(16.)
|
|
||||||
.finish(),
|
|
||||||
)
|
|
||||||
.with_child(
|
|
||||||
Container::new(
|
|
||||||
ui_builder
|
|
||||||
.button(ButtonVariant::Accent, self.sign_up_button.clone())
|
|
||||||
.with_style(UiComponentStyles {
|
|
||||||
font_size: Some(14.),
|
|
||||||
font_weight: Some(Weight::Semibold),
|
|
||||||
border_radius: Some(CornerRadius::with_all(Radius::Pixels(4.))),
|
|
||||||
padding: Some(Coords {
|
|
||||||
top: 8.,
|
|
||||||
bottom: 8.,
|
|
||||||
left: 24.,
|
|
||||||
right: 24.,
|
|
||||||
}),
|
|
||||||
..Default::default()
|
|
||||||
})
|
|
||||||
.with_text_label("Sign up".to_owned())
|
|
||||||
.build()
|
|
||||||
.on_click(move |ctx, _, _| {
|
|
||||||
ctx.dispatch_typed_action(
|
|
||||||
AISettingsPageAction::SignupAnonymousUser,
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.finish(),
|
|
||||||
)
|
|
||||||
.with_padding_right(TOGGLE_BUTTON_RIGHT_PADDING)
|
|
||||||
.finish(),
|
|
||||||
)
|
|
||||||
.finish(),
|
.finish(),
|
||||||
);
|
)
|
||||||
} else {
|
.with_padding_right(TOGGLE_BUTTON_RIGHT_PADDING)
|
||||||
row.add_child(
|
.finish(),
|
||||||
Container::new(
|
);
|
||||||
ui_builder
|
|
||||||
.switch(self.switch_state.clone())
|
|
||||||
.check(AISettings::as_ref(app).is_any_ai_enabled(app))
|
|
||||||
.build()
|
|
||||||
.on_click(move |ctx, _, _| {
|
|
||||||
ctx.dispatch_typed_action(AISettingsPageAction::ToggleGlobalAI);
|
|
||||||
})
|
|
||||||
.finish(),
|
|
||||||
)
|
|
||||||
.with_padding_right(TOGGLE_BUTTON_RIGHT_PADDING)
|
|
||||||
.finish(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Container::new(row.finish())
|
Container::new(row.finish())
|
||||||
.with_padding_bottom(15.)
|
.with_padding_bottom(15.)
|
||||||
|
|||||||
@@ -405,6 +405,8 @@ metadata.
|
|||||||
collapse behavior; shared/team folders retain the existing remote path.
|
collapse behavior; shared/team folders retain the existing remote path.
|
||||||
- [x] Remove the account/signup gate from Galaxy Drive visibility and Settings controls so local
|
- [x] Remove the account/signup gate from Galaxy Drive visibility and Settings controls so local
|
||||||
Drive remains usable while logged out; team-only actions retain their separate restrictions.
|
Drive remains usable while logged out; team-only actions retain their separate restrictions.
|
||||||
|
- [x] Remove the stale account/signup gate from the Global Agent control so configured local
|
||||||
|
providers and runtimes remain usable while logged out.
|
||||||
- [x] Move the retained Drive import flow onto local persistence for personal targets, including
|
- [x] Move the retained Drive import flow onto local persistence for personal targets, including
|
||||||
local folder/notebook/workflow creation and progress reporting without remote `UpdateManager`
|
local folder/notebook/workflow creation and progress reporting without remote `UpdateManager`
|
||||||
or `SyncQueue` dependencies; shared/team imports retain their remote path.
|
or `SyncQueue` dependencies; shared/team imports retain their remote path.
|
||||||
|
|||||||
Reference in New Issue
Block a user