Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Accepted with Revisions] SDL 0157 - Mobile Choice Set Manager (Revised) #475

Closed
theresalech opened this issue Apr 25, 2018 · 19 comments
Closed

Comments

@theresalech
Copy link
Contributor

Hello SDL community,

The review of the revised "Mobile Choice Set Manager" proposal begins now and runs through May 1, 2018. The proposal is available here:

https://github.com/smartdevicelink/sdl_evolution/blob/master/proposals/0157-mobile-choice-manager.md

Reviews are an important part of the SDL evolution process. All reviews should be sent to the associated Github issue at:

#475

Reviews of the original "Mobile Choice Set Manager" proposal can be found on this issue: #449

What goes into a review?

The goal of the review process is to improve the proposal under review through constructive criticism and, eventually, determine the direction of SDL. When writing your review, here are some questions you might want to answer in your review:

  • Is the problem being addressed significant enough to warrant a change to SDL?
  • Does this proposal fit well with the feel and direction of SDL?
  • If you have used competitors with a similar feature, how do you feel that this proposal compares to those?
  • How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
    Please state explicitly whether you believe that the proposal should be accepted into SDL.

More information about the SDL evolution process is available at

https://github.com/smartdevicelink/sdl_evolution/blob/master/process.md

Thank you,
Theresa Lech

Program Manager - Livio
theresa@livio.io

@theresalech theresalech changed the title [In Review] SDL 0157 - Mobile Choice Set Manager [In Review] SDL 0157 - Mobile Choice Set Manager (Revised) Apr 25, 2018
@ghost
Copy link

ghost commented Apr 27, 2018

I'm very confused with the revision. Trying to keep my comment short without giving feedback to every details. I guess it makes sense to discuss the proposed changes in a phone conference before we enter the same like #449

SDLChoiceCellGroup will cause a lot of confusion. Static choice sets can be provided without the need of yet another class. I thought that we had an agreement on that to hide the pain of the differences.

What's SDLChoiceCellPrimaryText? Do you want to identify choices using the .text parameter? Multiple choices can be created with the same primary text. I thought we agreed to use a hash of the choice's content in order to make them comparable.

I don't think the delegates and present methods are based on the given feedback.

- (NSArray<SDLChoiceCell *> *)shouldDeleteChoiceCells:(NSArray<SDLChoiceCell *> *)presentedCells; isn't needed.

- (void)userDidSubmitInput:(NSString *)inputText withSource:(SDLTriggerSource *)source; is not correct as keyboard input can be given with every keypress and

- (void)userDidCancelInputWithReason:(SDLKeyboardEvent)event; doesn't make much sense as keyboard event enum includes other events than cancel and abort.

Why is there a delegate in the choice set and another delegate in the presentXY method?

I'm not sure if I can agree to the revision. I kind of see parts of the feedback from #449 (comment) added but with many changes which are not explained and other additions that were never discussed.

@joeljfischer
Copy link
Contributor

joeljfischer commented Apr 27, 2018

I will try to keep this as short as possible, but there are a lot of questions here.

SDLChoiceCellGroup will cause a lot of confusion. Static choice sets can be provided without the need of yet another class. I thought that we had an agreement on that to hide the pain of the differences.

I had to make a choice. I believe that the old design was becoming too confusing. In order to clarify the differences between presenting a set of choices that are "dynamic" and a set of choices that must always be presented "grouped" together, I decided to make another small class that allows developers to pass the entire group and make crystal clear that the choices in this group cannot be used in a "dynamic" preloaded choices.

What's SDLChoiceCellPrimaryText?

I thought I'd gotten all the references to that. It was from an earlier version of this revision and can be ignored. That reference should be an SDLChoiceCell.

I don't think the delegates and present methods are based on the given feedback.

They were in part, but I saw issues with it as-is and decided to do a more thorough review and design revision in order to take the presented use-cases from the feedback and design a proposal that filled those use-cases as well as possible.

- (NSArray<SDLChoiceCell *> *)shouldDeleteChoiceCells:(NSArray<SDLChoiceCell *> *)presentedCells; isn't needed.

Yes, this can be removed. I like it because it gives an indication to the developer that they can / should delete unneeded cells after the presentation is complete, but, after consideration, this can be done in the documentation.

- (void)userDidSubmitInput:(NSString *)inputText withSource:(SDLTriggerSource *)source; is not correct as keyboard input can be given with every keypress and

Hmm, it's not that this is not correct, it seems that this just doesn't do what you want it to. It is correct in that it does what it intends, and provides a delegate callback for user submission of the text. Your specific issue is meant to be mitigated by the optional delegate - (NSString *)updateAutocompleteWithInput:(NSString *)currentInputText; which is the only use-case I could think of for the input being updated on every press. If a use-case exists, I could add or modify that callback to be a more general case for the input changed such as -(void)userInputDidChange:(NSString *)input.

- (void)userDidCancelInputWithReason:(SDLKeyboardEvent)event; doesn't make much sense as keyboard event enum includes other events than cancel and abort.

Again, I think that this makes perfect sense, it just isn't doing what you think it should. Yes, the keyboard event includes other enums, but this delegate callback would only be called for an enum value that makes sense (i.e. cancel and abort). It wouldn't be called in the other cases, which seems to be your confusion? While, yes, other enum values exist, and I considered creating new enums that split those enums up, because the user isn't passing us enum values it should be okay as-is. Every enum value we pass them will make sense in context.

Why is there a delegate in the choice set and another delegate in the presentXY method?

You'll notice that the choice set delegate is for the choice set and is always used. The other delegate is the keyboard delegate and is only used in some cases. To prevent the keyboard delegate from being optional and creating situations in which no keyboard delegate is set but the choice set is presented in a keyboard context, I chose to put it on the called method when keyboards are in use.

I'm not sure if I can agree to the revision. I kind of see parts of the feedback from #449 (comment) added but with many changes which are not explained and other additions that were never discussed.

I think it is unfair to dismiss this revision out of hand because it has some changes that weren't discussed. I believe that the changes are fairly well explained, and I have tried to answer any questions above. Just because this revision makes changes that weren't discussed doesn't mean it shouldn't be reviewed on its own merits. If you have additional feedback or issues with the proposal, please bring them forward.

@AndrewRMitchell
Copy link

This review is 475 only, I'm ignoring the fact that 449 even existed. I'm also taking into account any discussion occurring above.

One issue I have is if I have is if I have an SDLChoiceCell that I want to use in multiple choice sets I can't. In other words, if I have a response that exists in multiple choice sets, I have to treat them as separate responses, even if to me they really are the same. This means I have to maintain a mapping from the SDLChoiceCell to some internal representation just because I'm using it across multiple choice sets. I understand the logic, just calling out it may put additional work on my side.

@joeljfischer
Copy link
Contributor

Hi @AndrewRMitchell, I'm not quite sure what you mean. If you have a choice cell that you want to use in multiple choice sets, you would preload that cell using preloadChoices. It will then be available in the preloadedChoices set, and you can use it in any SDLChoiceSet you wish. I'm not quite sure what you mean by "separate responses," or what internal mapping you mean. Could you explain a bit more?

@AndrewRMitchell
Copy link

@joeljfischer Sorry, I was trying to get the review done in another meeting as I'm time constrained this week. I was reading the static section twice and internally was thinking dynamic. Ignore my issue.

@ghost
Copy link

ghost commented May 1, 2018

I think the way of using the group class isn't really an improvement to the way choice sets are used today. It's just being done in a different API. Yes, it's helping me with ids but the only way to use >100 choices is to preload them, create the choice set in the completion handler and then present it. I would have expected choice sets with >100 choices to be treated as static ones. I guess it's sufficient to document this so the developer knows about this. I can see the benefit of another proposal increasing the maximum of PerformInteraction.interactionChoiceSetIDList to a value which makes it irrelevant to think of static sets anymore. That said I believe we should not support static sets at all anymore but increase the limit for the next major release. It's anyway not a good practice to present so many choices to the user. That would make it a lot easier.

Regarding the choice set:

I believe we might want to merge help prompt and timeout prompt as they are mostly set to the the same anyway. As an alternative if timeout prompt isn't set the manager can use the help prompt array for both. As they are relevant for the voice mode only I don't think it's needed in the choice set.

I still don't think the delegate makes sense in that class. I thought we had an agreement to that. Don't want to repeat myself.

I don't think the layout mode is necessary in the choice set. I don't even think the interaction mode is needed at all. Not sure if this was visible or described in my last comment. The layout mode is relevant only for manual interaction mode and is ignored for voice mode. The mode "both" is not needed as it can be implemented by the app is desired but at Ford we have received customer complains about "both" as it is confusing why there's a manual interaction although the voice interaction was cancelled...

At last I was thinking about the necessarily of timeout parameter and left it out in the beginning... but it's not relevant for this discussion.

After all that would reduce the choice set to:

@interface SDLChoiceSet
@property (copy, nonatomic, readonly) NSString *title;
@property (copy, nonatomic, readonly, nullable) NSArray<SDLTTSChunk *> *initialPrompt;
@property (assign, nonatomic, readonly) NSTimeInterval timeout;
@property (copy, nonatomic, readonly) NSArray<SDLChoiceCell *> *choices;
...
@end

Regarding presentation of choice sets/keyboard

Because the interaction mode "voice" ignores the layout mode and the interaction mode "manual" ignores help/timeout prompt I proposed to separate them.

- (void)presentVoiceChoiceSet:(SDLChoiceSet *)choiceSet
 helpPrompt:(NSArray<SDLTTSChunk *> *helpPrompt
 delegate:(id<SDLChoiceSetDelegate>)delegate;

The above method starts a voice session with the user to select a choices from the given set.
The provided help prompt is used if the user say "help" or if a timeout is reached with no voice input.

- (void)presentChoiceSet:(SDLChoiceSet *)choiceSet
 layout:(SDLChoiceSetLayout)layout
 delegate:(id<SDLChoiceSetDelegate>)delegate;

This method presents the choice set on the UI either as a list or in tiles/icons.

- (void)presentChoiceSetWithKeyboard:(SDLChoiceSet *)choiceSet 
 layout:(SDLChoiceSetLayout)layout
 delegate:(id<SDLChoiceSetDelegate, SDLKeyboardDelegate>)delegate;

The above method presents the choice set on the UI including a keyboard (which does not necessarily stands for "search"). The keyboard properties of the screen manager are used by default. The keyboard delegate can be used to modify the keyboard properties during presentation (@joeljfischer I think your optional methods in the delegate are a good idea but I believe the whole keyboard properties should be modifiable for each keypress e.g. to set the limited char set etc.)

- (void)presentKeyboardWithDelegate:(id<SDLKeyboardDelegate>)delegate;

The above method presents the keyboard directly to request user input.

All these methods reduce the amount of parameter to the minimum required for the type of presentation. To me they look much simpler because the app developer can see for each call what properties are needed because unneeded properties are not requested.

Regarding the delegates we already covered the one for choice sets. The keyboard delegate you proposed doesn't fully match the SDL API.

@protocol SDLKeyboardDelegate
- (nullable SDLKeyboardProperties *)keyboardDidSendInput:(nonnull SDLKeyboardEvent)event text:(nullable NSString *)text;
@end

The above delegate call is different to my originally propsed one but it maps to OnKeyboardInput notifications and allows PerformIntearction.manualTextEntry (as it's equivalent to a submit keyboard input). I'm not sure of how much the optional keyboard delegate calls are helping to modify the keyboard properties during the presentation. In the above deleagte the modification can be done by returning a keyboard property object. To me this looks like a very easy way to modify it without the need of additional methods.

Regarding choice caching we must not use the primary text because SDL and the HMI don't use it for unique identifcation. There can be interactions with the same primary text e.g. in list mode. Instead the manager should hash the content of a choice which is used to compare it with other choices to avoid full duplicate items.

@ghost
Copy link

ghost commented May 1, 2018

I forgot to note that #189 (comment) refers to this proposal. The VR commands for choices are already nullable but the placeholder for keyboard interactions isn't considered yet. I propose to include the below text in this proposal:

In the proxy layer we must make Choice.vrCommands nullable and mention in the code comments of the property "Starting with RPC spec version X.Y vr Commands is optional but <X.Y it's mandatory".

In the management layer I would expect the choice set manager to use the auto-generated choiceID as a VR command placeholder (auto-fill) if the app is connected to a head unit that doesn't support optional VR commands. Still these choices must not be used for VR sessions. This way the app developer wouldn't need to care about it.

In fact since Ford's SYNC3 head unit v2.3 I can send choices without .vrCommands and I receive SUCCESS. I think that's the MsgVersion 4.2... That's a decent amount of vehicles already supporting it. Therefore my suggestion for the choice set manager would be the following (I guess I should copy that to the acutal manager proposal):

  1. The choice set manager should create a single choice set as a place holder (the placeholder choice) for keyboard presentation. (This is required anyway because .interactionChoiceSetIDList is mandatory. We should propose to make it optional for 5.0 as well)
  2. The placeholder choice should be created after the app was launched. This is the case if the app entered an HMI level that allows CreateIntearctionChoiceSet for the first time after registration.
  3. The placeholder choice should contain a reserved .choiceID and .text when being sent by the manager.
  4. If the head unit replies with SUCCESS the manager should remember that and not auto-fill .vrCommands for non-voice choices created by the app later on.
  5. If the head unit replies with INVALID_DATA (happens within <50ms) the manager should repeat sending the placeholder choice but this time using .vrCommands set to ["(.choiceID)"]. The manager should remember that auto-fill is required for non-voice choices.

@joeljfischer
Copy link
Contributor

I apologize if my brevity sometimes comes off as dismissal. That isn't intentional; I am trying to reduce the length of these posts as much as I can.

I think the way of using the group class isn't really an improvement to the way choice sets are used today. It's just being done in a different API.

I don't think we can strictly go to dynamic sets. I think it's a big help for lists that always remain the same (easier to reference as a whole) or need to be over 100 long (though we could remove documentation around that, as it's kind of a cheat and not recommended). It provides the delegate system and ID management enhancements.

I believe we might want to merge help prompt and timeout prompt as they are mostly set to the the same anyway.

I don't know if that's a good idea. One is for when the user says "help" and the other is if it times out, right? Those are fairly different use cases. I don't have a problem with providing "default" text for either, though that would require translation work.

I still don't think the delegate makes sense in that class. I thought we had an agreement to that. Don't want to repeat myself.

With the current proposal it makes a lot more sense to be there, as the SDLChoiceSet object is quite different now. I see no reason to move it off the object.

I don't think the layout mode is necessary in the choice set. I don't even think the interaction mode is needed at all...The mode "both" is not needed as it can be implemented by the app is desired but at Ford we have received customer complains about "both" as it is confusing why there's a manual interaction although the voice interaction was cancelled...

If we could remove BOTH, we could change the ChoiceSetLayout to have a voice option, but we cannot, and it must remain as is. We would have to remove it from the spec or could recommend devs not use it, but we cannot remove it from this API because Ford has had consumer complaints. There could be many reasons why users think BOTH is confusing, including Ford's implementation of it. Perhaps the higher level UI manager could automate the trigger source as it would have better information to work with. Also, interactionMode should remain on the presentation method for the following use case:

1a. User presses menu button
2a. Dev presents choice set as MANUAL

1b. User speaks menu voice command
2b. Dev presents choice set in VR

The choice set, even if it has a manual layout, should have the option of being presented in VR mode at presentation time.

Regarding presentation of choice sets/keyboard

Due to the above reasons, I disagree with all that is in this section, and recommend sticking to my outlined methods.

I believe the whole keyboard properties should be modifiable for each keypress e.g. to set the limited char set etc.

Changing the limited char set seems an odd and low-usage use case. If it's a necessary one, I would either recommend removing the current autocomplete one, or adding one to change the char-set per key-press. I don't think that optional delegate method is currently necessary however.

Regarding the delegates we already covered the one for choice sets. The keyboard delegate you proposed doesn't fully match the SDL API.

I think this is more confusing. You're essentially combining three of my delegate methods into one super-method that I find significantly less clear. The dev, if they just want the input from the user, has to implement your method, know to return nil, switch on the event for ENTRY_SUBMITED or ENTRY_VOICE and pull that text, and ignore the others. The implementation of mine would be a one-liner and is called much less often.

Regarding choice caching we must not use the primary text because SDL and the HMI don't use it for unique identifcation.

This proposal already does full choice cell hashing and not what you say here.

I forgot to note that #189 (comment) refers to this proposal.

Your 5 points would be a good addition to the proposal because it works today.

Though, it shouldn't, and is probably considered a Ford bug? So it may merit more discussion. Additional text about changes in the spec would have to be held until that spec change occurs.

@joeljfischer
Copy link
Contributor

joeljfischer commented May 1, 2018

For reference for tonights meeting:

Accepted changes:

SDLScreenManager

  • Update method - (void)presentKeyboardWithDelegate:(id<SDLKeyboardDelegate>)delegate; to -(void)presentKeyboardWithInitialText:(NSString *)initialText delegate:(id<SDLKeyboardDelegate>)delegate;

SDLChoiceSetDelegate

  • Remove delegate method - (NSArray<SDLChoiceCell *> *)shouldDeleteChoiceCells:(NSArray<SDLChoiceCell *> *)presentedCells;

SDLKeyboardDelegate

  • Add optional delegate method to SDLKeyboardDelegate: -(void)updateCharacterSetWithInput:(NSString *)currentInputText completionHandler:(void (^nonnull)(NSArray<NSString *> *updatedCharacterSet))completionHandler;.
  • Update SDLKeyboardDelegate method: - (NSString *)updateAutocompleteWithInput:(NSString *)currentInputText; to - (void)updateAutocompleteWithInput:(NSString *)currentInputText completionHandler:(void (^nonnull)(NSString *updatedAutocompleteText))completionHandler;.
  • Update SDLKeyboardDelegate method: - (void)userDidSubmitInput:(NSString *)inputText withSource:(SDLTriggerSource *)source; to - (void)userDidSubmitInput:(NSString *)inputText withEvent:(SDLKeyboardEvent *)source; to match comment
  • Add - (void)keyboardDidSendEvent:(nonnull SDLKeyboardEvent)event text:(nullable NSString *)currentInputText;

Other

  • Reference to SDLChoiceCellPrimaryText should be SDLChoiceCell
  • Fix downside text, it references an API from an outdated version of this proposal.
  • Remove the SDLChoiceCellGroup API, leaving only "dynamic" choice sets.
  • Add text around pre-loading an example cell to check for optional voice commands on Choices. Send automated text or not when a cell's voiceCommands property is nil based on that.

@NickFromAmazon
Copy link

First to make sure I'm correctly following, the core mobile API as I'm reading it allows you to:

  1. Create/preload an ordered group of 1-100 Choices (a ChoiceSet)
  2. Present an Interaction with 0-100 of these preloaded ChoiceSets with specified prompt data, display configuration, and input options.
    2a. Receive a response containing customer's choice (or lack there of) on the given interaction.
  3. Delete a preloaded ChoiceSet

I agree that an extra Manager API that allows me to combine steps 1-2, and optionally 3, for dynamic data would be very convenient; moving too far beyond that and I'm worried that either complexity will increase, or supported functionality will be hidden.

a set of choices that must always be presented "grouped" together

Maybe I'm fundamentally misunderstanding the API but I'm still unclear on this one:
If ChoiceSet items are necessarily grouped for preloaded Choices, I'm in favor of a defined type for these groups as I think it makes usage more clear. However, given preloadedChoices is an NSSet<SDLChoiceCell *> *, maybe I'm missing something - will the choices always be uploaded individually? If this is the case then the collection type does seem unnecessary.

On that point (re-hashing the old debate,) I find it confusing to have multiple types essentially name Choice[Collection]: the SDLChoiceCellGroup (that actually corresponds to core's 'ChoiceSet') and the ChoiceSet (corresponding to core's 'Interaction').

You'll notice that the choice set delegate is for the choice set and is always used. The other delegate is the keyboard delegate and is only used in some cases

Not a showstopper to me, but I find it unintuitive to have to use a delegate as a method parameter AND and a property in order to detect a completed interaction.

Autocomplete ...

Not completely sure I'm following the conversation here, but agree this should be handled independently from the Interaction's response. Perhaps it could even be sidelined and then handled more generally - some kind of optional 'KeyboardInputProcessor' that could be used in the future if/when additional keyboard input fields are supported?

This proposal already does full choice cell hashing and not what you say here.

The proposal states If the developer attempts another dynamic choice set containing an SDLChoiceSet with the same primary text (the key), the choice will be reused. I assume this is what's being referred to, whereas the intention is the comment on preloadedChoices: Cells will be hashed by their text, image names, and VR command text?

@joeljfischer
Copy link
Contributor

Maybe I'm fundamentally misunderstanding the API but I'm still unclear on this one:
If ChoiceSet items are necessarily grouped for preloaded Choices, I'm in favor of a defined type for these groups as I think it makes usage more clear. However, given preloadedChoices is an NSSet<SDLChoiceCell *> *, maybe I'm missing something - will the choices always be uploaded individually? If this is the case then the collection type does seem unnecessary.

  1. If the cells are uploaded via a Group, then they are uploaded as one CreateInteractionChoiceSet.
  2. If they are uploaded via preloadChoices, where the number of cells is n then they are uploaded as n CreateInteractionChoiceSet.

To clarify for everyone (sorry for the length here), a Group could be used for the following:

a. If you need more than 100 choices in a presentation. This is not a recommended use-case.
b. If you want to reference a common use case list. For example: You have a choice set that is a simple "Yes" and "No". This could be a Group set. Instead of preloading the "Yes" cell and the "No" cell, creating a choice set with the "Yes" cell and the "No" cell, and then presenting that set, you would create the group, preload the group, and present the group. I have not provided a deletion for a group because they should only be these kinds of "static" menus, those that exist across the lifecycle of the app.

Now, this use-case isn't necessary, and I fully admit that. We can remove it, and only use the (2) use-case above. That does work in all cases (outside of > 100 cells). The reason I have not already done so was the discussion on the previous revision of this proposal regarding having both "static" and "dynamic" cells. This mimics that with different naming.

Without this Group API, the developer would just have to reference the "Yes" and "No" cells (or however many they have) to preload, create the choice set, and present the choice set. That's totally doable because of the hashing system we have, multiple "Yes"'s won't be created so long as the cell's parameters are the same. Between you and Kujtim, I'm coming around to this point of view. The group can always be added later if necessary. I've added it to the "Author Considering" section in an above comment.

Not a showstopper to me, but I find it unintuitive to have to use a delegate as a method parameter AND and a property in order to detect a completed interaction.

I don't think using it will be too unintuitive. A choice set doesn't necessarily have a keyboard attached (whereas it does necessarily need the other delegate), only a searchable choice set needs that extra delegate. To add it as a property would complicate the SDLChoiceSet initializers even more than they are. I don't like having 6 initializers as it is, and doubling that to 12 (a possible searchable choice set for each existing initializer) seems to me less-bad than having it on the presentSearchableChoiceSet.

Not completely sure I'm following the conversation here, but agree this should be handled independently from the Interaction's response. Perhaps it could even be sidelined and then handled more generally - some kind of optional 'KeyboardInputProcessor' that could be used in the future if/when additional keyboard input fields are supported?

While I agree having it in a separate delegate is the way to go – that is my proposal, after all – I disagree that we need a new proposal for handling keyboard input, this proposal's discussion has gone on too long as it is IMO. Regardless, I think such a class would overcomplicate things for what we have and be less intuitive than my proposal.

The proposal states...I assume this is what's being referred to, whereas the intention is the comment on...

Gotcha, that downside is from an earlier version of this revision. You are correct, the intention is from that comment.

@ghost
Copy link

ghost commented May 1, 2018

I don't think we can strictly go to dynamic sets. I think it's a big help for lists that always remain the same (easier to reference as a whole)

That's not true because the choices still need to referenced separately. Interactions with <100 choices are fully manageable with dynamic sets with no additional effort. I don't know of anyone who's using interactions with more than 100 choices and I cannot think of a good reason to do that due to driver distraction.

If it's really demanded to be able to have intearctions with more than 100 choices than the API that was already proposed should be used allowing choice array >100 items, treating them as static choice sets. That would keep it more transparent to the developer without dealing with groups for >100 choices.

Anyway increasing the limitations for the next major release would solve this problem anyway.

With the current proposal it makes a lot more sense to be there, as the SDLChoiceSet object is quite different now. I see no reason to move it off the object.

Not sure what you mean. I compared the old and the new SDLChoiceSet object and cannot find the difference or a reason for keeping the delegate inside.

If we could remove BOTH, we could change the ChoiceSetLayout to have a voice option, but we cannot, and it must remain as is.

Skipping the rest of the paragraph and saying all of that doesn't apply. The manager layer wouldn't use the still remaining interactionmode enum from the proxy layer. There's no spec change required. BOTH is still available with the proposed methods but in a different and much simpler and cleaner way because they request only data which is necessary for the mode requested.

Due to the above reasons, I disagree with all that is in this section, and recommend sticking to my outlined methods.

Same here. See above reasons. You're reasons don't apply. BOTH is still available.

Changing the limited char set seems an odd and low-usage use case.

Deciding on the use cases is at the developers decision. I'm proposing to keep the potential possibility especially because it's so easy to do so.

I think this is more confusing. You're essentially combining three of my delegate methods into one super-method that I find significantly less clear. ... The implementation of mine would be a one-liner and is called much less often.

I'm following OnKeyboardInput notification and *all the event types thinking it's easily done by using the event type as a parameter of the method. I don't see all of them supported by your methods. Here's the list for reference:

        <element name="KEYPRESS" />
        <element name="ENTRY_SUBMITTED" />
        <element name="ENTRY_VOICE" />
        <element name="ENTRY_CANCELLED" />
        <element name="ENTRY_ABORTED" />

Regarding hashing choices I'm sorry for my note. I found that explained very implicitly in the proposal. I would appreciate this to be noted down specifically.

The fact that Ford already supports optional VR commands is an intentional feature, not a bug.

@joeljfischer
Copy link
Contributor

I compared the old and the new SDLChoiceSet object and cannot find the difference or a reason for keeping the delegate inside.

There's no reason for moving it outside. It's a required parameter on all interactions involving a choice set.

Skipping the rest of the paragraph and saying all of that doesn't apply. The manager layer wouldn't use the still remaining interactionmode enum from the proxy layer.

I believe my proposal is the best suited and clearest and I stand by that.

Deciding on the use cases is at the developers decision. I'm proposing to keep the potential possibility especially because it's so easy to do so.

Okay, I'll add that we should add a new optional keyboard delegate method -(NSArray<NSString> *)updateCharacterSetWithInput:(NSString *)currentInputText;

I'm following OnKeyboardInput notification and *all the event types thinking it's easily done by using the event type as a parameter of the method. I don't see all of them supported by your methods.

As noted in the proposal:

  • - (NSString *)updateAutocompleteWithInput:(NSString *)currentInputText; == KEYPRESS
  • - (void)userDidSubmitInput:(NSString *)inputText withSource:(SDLTriggerSource *)source; == ENTRY_SUBMITTED or ENTRY_VOICE
  • - (void)userDidCancelInputWithReason:(SDLKeyboardEvent)event; == ENTRY_CANCELLED or ENTRY_ABORTED

Regarding hashing choices I'm sorry for my note. I found that explained very implicitly in the proposal. I would appreciate this to be noted down specifically.

I didn't fix up the downsides section properly, which made it confusing, as Nick pointed out. It appears to only be implict in this proposal, as you note. But, that is the method of this version of the proposal.

@smartdevicelink smartdevicelink locked and limited conversation to collaborators May 2, 2018
@theresalech
Copy link
Contributor Author

The Steering Committee voted to defer this proposal, keeping it in review to allow more time for SDLC Members to review and discuss. A good summary of the items in discussion to reference can be found in this comment. It was also noted that the next vote on this proposal will likely be pushed to the 2018-05-23 Steering Committee meeting due to the author's upcoming schedule. Implementation timing will need to be assessed once a version of the proposal has been agreed upon.

@smartdevicelink smartdevicelink unlocked this conversation May 2, 2018
@theresalech
Copy link
Contributor Author

The Steering Committee voted to defer this proposal, keeping it in review to allow more time for SDLC Members and the proposal's author to review and discuss.

@ghost
Copy link

ghost commented May 15, 2018

Below are five points of changes proposed including pros/cons/reasons. These points are basically a summary of open items from above comments.

1. Choice group

I support the authors consideration fo removing the group class. The options are:

  1. support "dynamic" sets only.
    • Pros: Less effort, easy API for the app developer, sufficient for ~ 99.99 % of the user cases.
    • Cons: Presentations are limited to 100 choices
  2. add support for >100.
    • Pros: Full support to todays API
    • Cons: More effort for us to implement, risk of more complicated API for app developer

I propose to do option 1 (following authors consideration). App developers should not present >100 choices anyway...

2. No delegate in the set

I propose to remove the delegate property from the choice set class. Instead it should be requested in the method call (see comment)

Pros:

  • App developers can store set objects without the risk of loosing the weak delegate
  • No risk of crashes due to lost delegate
  • More flexible in choosing the delegate needed
  • Fits well for the method -presentChoiceSetWithKeyboard:delegate: (the delegate is combined)

Cons:

  • One more parameter in the method call

3. Keyboard delegate

I propose to use the following delegate (which is a compromise)

@protocol SDLKeyboardDelegate

/** Sent upon ENTRY_SUBMITTED (but not ENTRY_VOICE) */
- (void)userDidSubmitText:(NSString *)text;

/** This will be sent if the keyboard event ENTRY_CANCELLED or ENTRY_ABORTED is sent */
- (void)userDidCancelInputWithReason:(SDLKeyboardEvent)event;

/** Sent upon *any* keyboard event */
- (void)keyboardDidSendEvent:(nonnull SDLKeyboardEvent)event text:(nullable NSString *)text;

@end

Reason:

  • ENTRY_VOICE is necessary for voice input use cases
  • KEYPRESS may be used for many different use cases e.g. request backend for auto complete (which makes custom keyboard configuration impossible)

4. Custom keyboard configuration (incl. auto complete and limited charset)

I propose to not add custom keyboard and any other keyboard specific delegate method and use the keyboard delegate protocol proposed above

Reason:

  • keyboard properties might be updated asynchronously

Instead the app should update the keyboard properties through the manager

5. present methods

I propose to use all the -present... methods mentioned in this comment (trying to avoid another copy of the methods) with one exception:

-(void)presentKeyboardWithTitle:(NSString *)title delegate:(id<SDLKeyboardDelegate>)delegate;

Reason:

  • Title (aka. .initialText) is mandatory
  • Each method requires only those parameters that are needed for the requested mode/layout (voice, manual, list/icon, with search, keyboard only).
  • It's very clear to the app developer what parameters are necessary
  • "presentSearchableChoiceSet" is too specific to the use case of searching.

@theresalech theresalech changed the title [In Review] SDL 0157 - Mobile Choice Set Manager (Revised) [Accepted with Revisions] SDL 0157 - Mobile Choice Set Manager (Revised) May 16, 2018
@theresalech
Copy link
Contributor Author

The Steering Committee has voted to accept this proposal with revisions. The revisions can be found in this comment. Revisions will include both the items in the Accepted changes and Author considering sections.

@smartdevicelink smartdevicelink locked and limited conversation to collaborators May 16, 2018
@theresalech
Copy link
Contributor Author

@joeljfischer please advise when a new PR has been entered to update the proposal to reflect the agreed upon revisions. I'll then merge the PR so the proposal is up to date, and enter issues in the respective repositories for implementation. Thanks!

@theresalech
Copy link
Contributor Author

Proposal has been revised to reflect revisions, and issues have been entered:
Android
iOS

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants