| Auto-Submit | +1 |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
<message name="IDS_IOS_COMPOSEBOX_CANVAS_ACTION" desc="The contextual menu option for opening the tool where users can dynamically build and edit content with the help of AI. [iOS only]..">```suggestion
<message name="IDS_IOS_COMPOSEBOX_CANVAS_ACTION" desc="The contextual menu option for opening the tool where users can dynamically build and edit content with the help of AI. [iOS only].">
```
kRegularSearch,
kAIM,
kImageGeneration,
kCanvas,Nit: It would be helpful to add a brief comment for each enum value to clarify their specific use cases.
[self.consumer setAIModeEnabled:mode == ComposeboxMode::kAIM];duplicate?
- (BOOL)isEligibleToCanvas {Private methods should have a comment. Same for some methods below.
_isMultiline || _modeHolder.mode != ComposeboxMode::kRegularSearch;optional nit: Adding new values to the ComposeboxMode enum may require an update to this flow. Maybe having a switch could solve this issue.
- (UIButton*)createCanvasButton {optional nit: It seems like a lot of private methods are also missing a comment in this file.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
<message name="IDS_IOS_COMPOSEBOX_CANVAS_ACTION" desc="The contextual menu option for opening the tool where users can dynamically build and edit content with the help of AI. [iOS only]..">```suggestion
<message name="IDS_IOS_COMPOSEBOX_CANVAS_ACTION" desc="The contextual menu option for opening the tool where users can dynamically build and edit content with the help of AI. [iOS only].">
```
Done
Nit: It would be helpful to add a brief comment for each enum value to clarify their specific use cases.
Done
[self.consumer setAIModeEnabled:mode == ComposeboxMode::kAIM];Radu Nitescuduplicate?
Done
Private methods should have a comment. Same for some methods below.
Added comments for the newly introduced private methods.
_isMultiline || _modeHolder.mode != ComposeboxMode::kRegularSearch;optional nit: Adding new values to the ComposeboxMode enum may require an update to this flow. Maybe having a switch could solve this issue.
Right now everythin that is not regular expands the input plate. Likely this is the behavior that we will follow for other future modes.
optional nit: It seems like a lot of private methods are also missing a comment in this file.
Will handle in a separate CL to avoid keep this one scoped for canvas mode.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
// Whether the client is eligible to access canvas mode. [self.consumer
// setAIModeEnabled:mode == ComposeboxMode::kAIM];is this intended ?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
// Whether the client is eligible to access canvas mode. [self.consumer
// setAIModeEnabled:mode == ComposeboxMode::kAIM];Radu Nitescuis this intended ?
No, removed.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (experimental_flags::ShouldForceDisableComposeboxCreateImages()) {We should probably have a different one for canvas.
// Text drops are always allowed even if the attachment capacity is reached.
return [self willAllowTextDrop:session];
}
BOOL willAllowPDFDrop = [self willAllowPDFDrop:session];
BOOL willAllowImageDrop = [self willAllowImageDrop:session];
BOOL willAllowTabDrop = [self willAllowTabDrop:session];
BOOL willAllowTextDrop = [self willAllowTextDrop:session];
return willAllowPDFDrop || willAllowImageDrop || willAllowTabDrop ||
willAllowTextDrop;Merge error ?
/// Returns whether a tab drop will be allowed.
- (BOOL)willAllowTabDrop:(id<UIDropSession>)session {
if (_attachTabActionsDisabled || _attachTabActionsHidden) {
return NO;
}
for (UIDragItem* item in session.items) {
if ([item.localObject isKindOfClass:[TabInfo class]]) {
// Disallow tab drops between profiles and between incognito and
// non-incognito sessions.
TabInfo* tab = item.localObject;
if ([self.delegate tabExistsOnCurrentProfile:tab]) {
return YES;
}
}
}
return NO;
}
/// Returns whether a PDF drop will be allowed based on the Composebox mode,
/// whether a drag and drop action is allowed, and whether there is a PDF in the
/// drop session.Same here
} else if ([self willAllowTabDrop:session] &&
[item.localObject isKindOfClass:[TabInfo class]]) {
[self performDropForTab:item.localObject];
} else if ([self willAllowTextDrop:session] &&
[item.itemProvider
hasItemConformingToTypeIdentifier:UTTypeText.identifier]) {
[self performDropForText:item.itemProvider];
}
}
// Drop complete.
_dragSessionWithinInputPlate = NO;
}
/// Performs a drop for dragged text from a given `itemProvider`.
- (void)performDropForText:(NSItemProvider*)itemProvider {
CHECK([itemProvider hasItemConformingToTypeIdentifier:UTTypeText.identifier]);
__weak __typeof(self) weakSelf = self;
[itemProvider loadObjectOfClass:[NSString class]
completionHandler:^(NSString* text, NSError* error) {
[weakSelf handleTextDrop:text error:error];
}];
}
/// Performs a drop for a dragged tab with `tabInfo`.
- (void)performDropForTab:(TabInfo*)tabInfo {
CHECK(self.mutator);
CHECK(tabInfo);
CHECK_EQ(tabInfo.incognito, _theme.incognito);
web::WebState* webState =
[self.delegate webStateForTabOnCurrentProfile:tabInfo];
if (!webState) {
return;
}
[self.mutator processTab:webState webStateID:tabInfo.tabID];
}
Here too
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
if (experimental_flags::ShouldForceDisableComposeboxCreateImages()) {We should probably have a different one for canvas.
Added a separate one
// Text drops are always allowed even if the attachment capacity is reached.
return [self willAllowTextDrop:session];
}
BOOL willAllowPDFDrop = [self willAllowPDFDrop:session];
BOOL willAllowImageDrop = [self willAllowImageDrop:session];
BOOL willAllowTabDrop = [self willAllowTabDrop:session];
BOOL willAllowTextDrop = [self willAllowTextDrop:session];
return willAllowPDFDrop || willAllowImageDrop || willAllowTabDrop ||
willAllowTextDrop;Radu NitescuMerge error ?
Done
/// Returns whether a tab drop will be allowed.
- (BOOL)willAllowTabDrop:(id<UIDropSession>)session {
if (_attachTabActionsDisabled || _attachTabActionsHidden) {
return NO;
}
for (UIDragItem* item in session.items) {
if ([item.localObject isKindOfClass:[TabInfo class]]) {
// Disallow tab drops between profiles and between incognito and
// non-incognito sessions.
TabInfo* tab = item.localObject;
if ([self.delegate tabExistsOnCurrentProfile:tab]) {
return YES;
}
}
}
return NO;
}
/// Returns whether a PDF drop will be allowed based on the Composebox mode,
/// whether a drag and drop action is allowed, and whether there is a PDF in the
/// drop session.Radu NitescuSame here
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |