| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
id<BWGCommands> bwgHandler =```suggestion
id<BWGCommands> geminiHandler =
```
(it should be renamed at some point)
bwgService:BwgServiceFactory::GetForProfile(profile)```suggestion
geminiService:BwgServiceFactory::GetForProfile(profile)
```
if (_identityManager) {You can probably remove this check
- (void)updateAssistantButton {Add comment
[self.consumer setAssistantButtonState:state avatar:avatar];How do you plan to handle the action from the button? Is it the VC that will always call the right command? Should it go through the mediator?
_identityManager = nullptr;Shouldn't you stop observation here?
AppBarAssistantButtonStateIneligible,What is this state? Is it signed in + inelligible? I think it maybe should be more clear. Also, is this an enum for the UI states only or is it also an enum for the different actions (for example signed out and signed in with Gemini enabled is the same UI but different action)?
typedef NS_ENUM(NSUInteger, AppBarAssistantButtonState) {Use enum class
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
BwgService change lgtm, thanks for the improvement!
id<BWGCommands> bwgHandler =```suggestion
id<BWGCommands> geminiHandler =
```(it should be renamed at some point)
We're planning to rename it soon (it's a heavy rename that touches a lot of files), but +1 to using `gemini` instead of `bwg` in local vars in the meantime
@property(nonatomic, weak) id<BWGCommands> bwgHandler;nit: geminiHandler
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Adam Arcaro```suggestion
id<BWGCommands> geminiHandler =
```(it should be renamed at some point)
We're planning to rename it soon (it's a heavy rename that touches a lot of files), but +1 to using `gemini` instead of `bwg` in local vars in the meantime
Done
bwgService:BwgServiceFactory::GetForProfile(profile)Chris Lu```suggestion
geminiService:BwgServiceFactory::GetForProfile(profile)
```
Done
You can probably remove this check
Done
- (void)updateAssistantButton {Chris LuAdd comment
Done
[self.consumer setAssistantButtonState:state avatar:avatar];How do you plan to handle the action from the button? Is it the VC that will always call the right command? Should it go through the mediator?
I was thinking we go through the mediator, since there seems to be a few different behaviors that could show the same icon. I don't mind just having one mutator API and the mediator decides the exact action.
Shouldn't you stop observation here?
Yes
AppBarAssistantButtonStateIneligible,What is this state? Is it signed in + inelligible? I think it maybe should be more clear. Also, is this an enum for the UI states only or is it also an enum for the different actions (for example signed out and signed in with Gemini enabled is the same UI but different action)?
Yes that is correct, intended to be UI state. However, reflecting more, it should definitely be more aligned with UI-focused state. "eligible" will be determined later after the tap since we may show the ask button even if the assistant is not available.
typedef NS_ENUM(NSUInteger, AppBarAssistantButtonState) {Chris LuUse enum class
Done
@property(nonatomic, weak) id<BWGCommands> bwgHandler;Chris Lunit: geminiHandler
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
[self.consumer setAssistantButtonState:state avatar:avatar];Chris LuHow do you plan to handle the action from the button? Is it the VC that will always call the right command? Should it go through the mediator?
I was thinking we go through the mediator, since there seems to be a few different behaviors that could show the same icon. I don't mind just having one mutator API and the mediator decides the exact action.
Acknowledged
AppBarAssistantButtonStateIneligible,Chris LuWhat is this state? Is it signed in + inelligible? I think it maybe should be more clear. Also, is this an enum for the UI states only or is it also an enum for the different actions (for example signed out and signed in with Gemini enabled is the same UI but different action)?
Yes that is correct, intended to be UI state. However, reflecting more, it should definitely be more aligned with UI-focused state. "eligible" will be determined later after the tap since we may show the ask button even if the assistant is not available.
Yeah I agree. I think it makes sense for the mediator to push the UI state + info relevant for the state.
image = _assistantButtonAvatar;Are we expecting the mediator to always pass an avatar (including the default "no avatar" image)? Or can this be nil in which case the VC should handle it?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
base::ScopedObservation<signin::IdentityManager,nit: Comment for consistency
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
AppBarAssistantButtonStateIneligible,Chris LuWhat is this state? Is it signed in + inelligible? I think it maybe should be more clear. Also, is this an enum for the UI states only or is it also an enum for the different actions (for example signed out and signed in with Gemini enabled is the same UI but different action)?
Gauthier AmbardYes that is correct, intended to be UI state. However, reflecting more, it should definitely be more aligned with UI-focused state. "eligible" will be determined later after the tap since we may show the ask button even if the assistant is not available.
Yeah I agree. I think it makes sense for the mediator to push the UI state + info relevant for the state.
Acknowledged
Are we expecting the mediator to always pass an avatar (including the default "no avatar" image)? Or can this be nil in which case the VC should handle it?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
base::ScopedObservation<signin::IdentityManager,Chris Lunit: Comment for consistency
sorry i didnt see this initially... but now looking through the codebase we don't really leave comments for ScopedObservation properties.. so going to avoid the extra CQ dry run and just let this slide :P
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
21 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: ios/chrome/browser/app_bar/coordinator/app_bar_mediator.mm
Insertions: 0, Deletions: 2.
@@ -719,8 +719,6 @@
if (avatarProvider) {
avatar = avatarProvider->GetIdentityAvatar(
identity, IdentityAvatarSize::TableViewIcon);
- } else {
- avatar = DefaultSymbolTemplateWithPointSize(kPersonCropCircleSymbol, 30);
}
}
```
```
The name of the file: ios/chrome/browser/app_bar/ui/app_bar_view_controller.mm
Insertions: 2, Deletions: 1.
@@ -284,7 +284,8 @@
UIButtonConfiguration* configuration = _assistantButton.configuration;
configuration.title = title;
- configuration.image = image;
+ configuration.image =
+ image ? image : DefaultAppBarSymbol(kPersonCropCircleSymbol);
_assistantButton.configuration = configuration;
}
```
[ios] Implement AppBar Assistant button states
Supports three states of the Assistant button represented by
AppBarAssistantButtonState:
- ask: show the assistant icon, shown if feature is enabled and locale requirements are met
- account: show the user's profile icon, shown if signed in
- signed out: show the signed out icon
video: https://screencast.googleplex.com/cast/NDY3NTk2ODgwMjIyNjE3NnxiOGVkMTM5NC05OQ
https://screenshot.googleplex.com/49aehKDnWNwXGnB
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |