KacperFKorban / GUInep

Automatic UI forms for Scala 3 functions
https://kacperfkorban.github.io/GUInep/
Apache License 2.0
14 stars 0 forks source link

Support tuples in addition to functions #22

Open KacperFKorban opened 6 months ago

KacperFKorban commented 6 months ago

The ides is to be able to write code like the following:

def comment(comment: String) = ???

def getImageURL: URL = ???

guinep.web(getImageURL -> comment)

This would generate a form that also includes the non-function parameters in the form as (static) data. So in this case the form would contain an image followed by a text input box and a submit button.

This encoding would also allow for the creation of alternative actions/forms. e.g.

def good() = ???
def bad() = ???

def getImageURL: URL = ???

guinep.web(getImageURL -> (good, bad))

This example should then generate a form with an image followed by two action buttons - good and bad. This might be useful for automation for data labeling for example - labelling the image as good or bad.