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

Add SuggestionSearch for Specification #58

Merged
merged 12 commits into from
Jan 30, 2024

Conversation

wba2hi
Copy link
Contributor

@wba2hi wba2hi commented Dec 6, 2023

Closes: #16

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>
@wba2hi
Copy link
Contributor Author

wba2hi commented Dec 6, 2023

Implemented it for "non-specification"-mode as well.
For the "non-specification"-mode the suggestions are taken from the DataBroker itself instead of using VssVehicle().heritage.
This has the positive sideeffect, that if the DataBroker is started with a custom VSS Specification (e.g. vss-extended.json -> https://github.com/SoftwareDefinedVehicle/iveco-scratchpad/blob/main/data/vss-extended.json) the new paths are recognized automatically

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

@Chrylo
Copy link
Contributor

Chrylo commented Dec 14, 2023

Love the new disconnect icon. :)

@Chrylo
Copy link
Contributor

Chrylo commented Dec 14, 2023

Screenshot 2023-12-14 at 16 51 42
  • Awesome but can we easily align the borders so that they have the same rounded ones? Also the width should align. :)
  • Also if we have no result the UI still shows a small margin between the boxes. We can live with this if it is a pain to fix.

@Chrylo
Copy link
Contributor

Chrylo commented Dec 14, 2023

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.

@Chrylo
Copy link
Contributor

Chrylo commented Dec 14, 2023

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) {
Copy link
Contributor

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? :)

Copy link
Contributor Author

@wba2hi wba2hi Jan 16, 2024

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?

Copy link
Contributor

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 :)

Copy link
Contributor Author

@wba2hi wba2hi Jan 29, 2024

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?

Copy link
Contributor

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).

@wba2hi
Copy link
Contributor Author

wba2hi commented Jan 16, 2024

* Awesome but can we easily align the borders so that they have the same rounded ones? Also the width should align. :)

Done

* Also if we have no result the UI still shows a small margin between the boxes. We can live with this if it is a pain to fix.

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.

@wba2hi
Copy link
Contributor Author

wba2hi commented Jan 16, 2024

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.

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)

@Chrylo
Copy link
Contributor

Chrylo commented Jan 30, 2024

Good Look & Feel LGTM

Tested the search which fits our expectations (for now).

@Chrylo Chrylo merged commit 79e7a19 into eclipse-kuksa:main Jan 30, 2024
5 checks passed
@Chrylo Chrylo deleted the feature-16 branch January 30, 2024 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestApp: Add SuggestionSearch for Specifications
2 participants