-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add SuggestionSearch for Specification #58
Conversation
Move Disconnect Button into TopBar Signed-off-by: Andre Weber <andre.weber3@etas.com>
Closes: eclipse-kuksa#16 Signed-off-by: Andre Weber <andre.weber3@etas.com>
app/src/main/kotlin/org/eclipse/kuksa/testapp/databroker/view/suggestions/SuggestionTextView.kt
Outdated
Show resolved
Hide resolved
Implemented it for "non-specification"-mode as well. For "non-specification"-mode it MUST still be possible to enter any text as a VSS Path. No hard constraints here. This should be taken into account when testing |
Love the new disconnect icon. :) |
Switching between the modes is a bit slow now. May be something we can't do much about with the amount of data to auto complete. |
In specification mode the initial content is empty. May we can already show the first element? Probably related to the fact that we are truncating the "Vehicle" for the elements to save some space. I think we should revert this to be consistent with the VSS mode. The search also seems to be influenced by this. |
pathSet.add(it) | ||
|
||
var value = it | ||
while (value.indexOf(".") > -1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
value.indexOf(".")
Can we give this a variable name? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate on this, e.g. an example on how you think it might look better?
var value = "..."
var index = value.indexOf(".")
while (index > -1) {
value = value.substringBeforeLast(".")
pathSet.add(value)
index = value.indexOf(".")
}
This should work but feels redundant.
I think if we encapsulate the logic in a separate method as suggested by you the "perceived complexity" should also be reduced. Maybe that's already sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that looks fine. Could be OK for now to keep the createVssPathHierarchy inside the Activity class but maybe we could write an extension for the GetResponse or List<Types.DataEntry> to convert it into a VssPathHierarchy TreeSet? The activity class is already growing :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like an extension for "GetResponse" because this is pretty unspecific (I would go for it as a last resort). I don't like an extension for "List<Types.DataEntry>" because this feels overspecific (I really hate List-Extensions for some reason)
Do you think it might make sense to maybe expose this function simply as a public API from DataBrokerConnection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this is more like a "generateSuggestions(List)" method. Then we could put it into the ViewModel?We could even think about creating a VssPath model to make it more clearer where the suggestions are generated from because the algorithm is explicitly checking for "." to split (optional or something for the future).
app/src/main/kotlin/org/eclipse/kuksa/testapp/KuksaDataBrokerActivity.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/eclipse/kuksa/testapp/databroker/view/DataBrokerConnectionView.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/eclipse/kuksa/testapp/databroker/view/DataBrokerView.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/eclipse/kuksa/testapp/databroker/view/DataBrokerView.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/eclipse/kuksa/testapp/databroker/view/DataBrokerConnectionView.kt
Outdated
Show resolved
Hide resolved
app/src/main/kotlin/org/eclipse/kuksa/testapp/databroker/view/DataBrokerView.kt
Outdated
Show resolved
Hide resolved
Done
I tried some stuff, but eventually I left it as is. The issue is, that we only check for expansion of the "Suggestions-Card" and not if there are any elements in it thus showing an "empty-view" with it's paddingTop which creates this gap. If we want to check if the filter returns a non-empty collection we need to move it outside of the LazyListScope, however this makes the UI behave more sluggish. |
I see what you mean. I removed the AnimatedContent and the content is there "instantaneously", can you check it again please? To be honest I think the AnimatedContent makes it feel more like it is lagging, than offers a "nice animation" (at least on my Pixel 3) |
Good Look & Feel LGTM Tested the search which fits our expectations (for now). |
Closes: #16