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

Config Input design #14

Closed
Keyrxng opened this issue Nov 9, 2024 · 8 comments
Closed

Config Input design #14

Keyrxng opened this issue Nov 9, 2024 · 8 comments

Comments

@Keyrxng
Copy link
Contributor

Keyrxng commented Nov 9, 2024

Look at this config, it's huge. How is a config like this expected to be displayed?

Are we going to have to build custom setups for some plugins or is it expected to just fill the editor and scroll?

Seeing all of this without explicit info about what it is (within the UI) might be a lot to take in.

- skipBotEvents: false
    uses:
      - plugin: ubiquity-os-marketplace/text-conversation-rewards@development
        with:
          logLevel: "debug"
          evmNetworkId: 100
          evmPrivateEncrypted: "giLxu7IVSTpEFO89DaeCgnkKemYf2aFlK9EUQkbt71YmFOcQdIkCT8JDpX5zV5Sg1TqBeziZ486U0E3a6nD3emg0x9oeG3ILRUTlOE4I3RBZ0yTadsnV4RvewJMCMZJaYDuom-rHzog8p9InBwaHBszFeWItttSwS7o" # https://github.com/ubiquibot/conversation-rewards/pull/111#issuecomment-2348639931
          erc20RewardToken: "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d"
          incentives:
            requirePriceLabel: true
            contentEvaluator:
              multipliers:
                - role:
                    - "ISSUE_SPECIFICATION"
                  relevance: 1
            userExtractor:
              enabled: true
              redeemTask: true
            dataPurge:
              enabled: true
            formattingEvaluator:
              enabled: true
              multipliers:
                - role:
                    - ISSUE_SPECIFICATION
                  multiplier: 3
                  rewards:
                    wordValue: 0.1
                    html:
                      br:
                        score: 0
                        countWords: true
                      code:
                        score: 5
                        countWords: false
                      p:
                        score: 0
                        countWords: true
                      em:
                        score: 0
                        countWords: true
                      img:
                        score: 5
                        countWords: true
                      strong:
                        score: 0
                        countWords: false
                      blockquote:
                        score: 0
                        countWords: false
                      h1:
                        score: 1
                        countWords: true
                      h2:
                        score: 1
                        countWords: true
                      h3:
                        score: 1
                        countWords: true
                      h4:
                        score: 1
                        countWords: true
                      h5:
                        score: 1
                        countWords: true
                      h6:
                        score: 1
                        countWords: true
                      a:
                        score: 5
                        countWords: true
                      li:
                        score: 0.5
                        countWords: true
                      ul:
                        score: 0
                        countWords: true
                      td:
                        score: 0
                        countWords: true
                      hr:
                        score: 0
                        countWords: true
                      pre:
                        score: 0
                        countWords: false
                      ol:
                        score: 0
                        countWords: true
                - role:
                    - ISSUE_AUTHOR
                    - ISSUE_COLLABORATOR
                    - PULL_COLLABORATOR
                  multiplier: 1
                  rewards:
                    wordValue: 0.1
                    html:
                      br:
                        score: 0
                        countWords: true
                      code:
                        score: 5
                        countWords: false
                      p:
                        score: 0
                        countWords: true
                      em:
                        score: 0
                        countWords: true
                      img:
                        score: 5
                        countWords: true
                      strong:
                        score: 0
                        countWords: false
                      blockquote:
                        score: 0
                        countWords: false
                      h1:
                        score: 1
                        countWords: true
                      h2:
                        score: 1
                        countWords: true
                      h3:
                        score: 1
                        countWords: true
                      h4:
                        score: 1
                        countWords: true
                      h5:
                        score: 1
                        countWords: true
                      h6:
                        score: 1
                        countWords: true
                      a:
                        score: 5
                        countWords: true
                      li:
                        score: 0.5
                        countWords: true
                      ul:
                        score: 0
                        countWords: true
                      td:
                        score: 0
                        countWords: true
                      hr:
                        score: 0
                        countWords: true
                      pre:
                        score: 0
                        countWords: false
                      ol:
                        score: 0
                        countWords: true
                - role:
                    - ISSUE_CONTRIBUTOR
                    - PULL_CONTRIBUTOR
                  multiplier: 0.25
                  rewards:
                    wordValue: 0.1
                    html:
                      br:
                        score: 0
                        countWords: true
                      code:
                        score: 5
                        countWords: false
                      p:
                        score: 0
                        countWords: true
                      em:
                        score: 0
                        countWords: true
                      img:
                        score: 5
                        countWords: true
                      strong:
                        score: 0
                        countWords: false
                      blockquote:
                        score: 0
                        countWords: false
                      h1:
                        score: 1
                        countWords: true
                      h2:
                        score: 1
                        countWords: true
                      h3:
                        score: 1
                        countWords: true
                      h4:
                        score: 1
                        countWords: true
                      h5:
                        score: 1
                        countWords: true
                      h6:
                        score: 1
                        countWords: true
                      a:
                        score: 5
                        countWords: true
                      li:
                        score: 0.5
                        countWords: true
                      ul:
                        score: 0
                        countWords: true
                      td:
                        score: 0
                        countWords: true
                      hr:
                        score: 0
                        countWords: true
                      pre:
                        score: 0
                        countWords: false
                      ol:
                        score: 0
                        countWords: true
                - role:
                    - PULL_SPECIFICATION
                    - PULL_AUTHOR
                    - ISSUE_ASSIGNEE
                    - PULL_ASSIGNEE
                  multiplier: 0
                  rewards:
                    wordValue: 0
                    html:
                      br:
                        score: 0
                        countWords: true
                      code:
                        score: 5
                        countWords: false
                      p:
                        score: 0
                        countWords: true
                      em:
                        score: 0
                        countWords: true
                      img:
                        score: 5
                        countWords: true
                      strong:
                        score: 0
                        countWords: false
                      blockquote:
                        score: 0
                        countWords: false
                      h1:
                        score: 1
                        countWords: true
                      h2:
                        score: 1
                        countWords: true
                      h3:
                        score: 1
                        countWords: true
                      h4:
                        score: 1
                        countWords: true
                      h5:
                        score: 1
                        countWords: true
                      h6:
                        score: 1
                        countWords: true
                      a:
                        score: 5
                        countWords: true
                      li:
                        score: 0.5
                        countWords: true
                      ul:
                        score: 0
                        countWords: true
                      td:
                        score: 0
                        countWords: true
                      hr:
                        score: 0
                        countWords: true
                      pre:
                        score: 0
                        countWords: false
                      ol:
                        score: 0
                        countWords: true
              wordCountExponent: 0.85
            permitGeneration:
              enabled: true
            githubComment:
              post: true
              debug: false
          dataCollection:
            maxAttempts: 10
            delayMs: 1000
@rndquu
Copy link
Member

rndquu commented Nov 15, 2024

How is this config displayed in #13? I haven't yet managed to run that PR successfully.

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Nov 15, 2024

How is this config displayed in #13? I haven't yet managed to run that PR successfully.

It looks like this right now because null is a supported default which disables all of the modules which is a contrast to how defaults work for most other plugins so "reset to default" here is suboptimal.

The default HTML tags are not exhaustive but text-conversation-rewards does support all tags exhaustively afaik so I'd imagine the UI would need to accommodate for that.

Imo we need a method for creating an individual multipliers entry which supports most HTML tags and we can assign values to each tag, which roles this entry applies to and then pushes it to the multipliers array. We have four entries but I'd imagine something like what we have now but just for adding an entry and requires a complete and return or add another sort of setup?

image

@Keyrxng Keyrxng mentioned this issue Nov 22, 2024
@rndquu
Copy link
Member

rndquu commented Nov 26, 2024

The text-conversation-rewards plugin is really monstrous to edit, especially for a partner.

I suppose in the end we should:

  1. Introduce predefined configs (Predefined configs #22)
  2. Allow editing all config fields, but I'm not sure if such typing can be transformed into a meaningful html UI

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Nov 26, 2024

This is the current state of affairs with that plugin in particular - notice the size of the scrollbar.

#25 (comment)
image

#28 Should read from something like ubiquity-os-marketplace/.ubiquity-os/installer/templates/**.yml and simply "copy/paste" the predefined configs (with the exception of full_defaults as that'll be schema based)

@rndquu
Copy link
Member

rndquu commented Nov 27, 2024

There's this npm package (demo) which allows editing yaml files with meaningful hints when editing parameters. This is not as user friendly as html forms but (keeping in mind we'll have predefined configs) perhaps it makes sense to:

  1. Allow partners to select only predefined configs on initial onboarding
  2. Allow partners to edit yaml files via https://www.npmjs.com/package/monaco-yaml if they really need fine grained control

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Nov 27, 2024

Allow partners to select only predefined configs on initial onboarding

Right now we only have Minimal === three plugins, Full_Default === all plugins and Custom === single plugin select and edit, so I guess they'd need to choose Full_Default and then manually remove/edit and we'd replace Custom with https://www.npmjs.com/package/monaco-yaml essentially?

Otherwise we'd need to create a template for each plugin. Manifest.template might be a nice addition for plugins which is the dev recommended raw yaml config for the plugin?


I've built the UI to be generic but would it be completely out of the question to have a dedicated view for particularly complex plugins? Once a new plugin is shipped to -marketplace a view can be created if it's problematic like conversation-rewards is otherwise the generic UI is used?

@rndquu
Copy link
Member

rndquu commented Nov 29, 2024

we'd replace Custom with https://www.npmjs.com/package/monaco-yaml essentially?

That's a proposition, but the answer is "yes"

Otherwise we'd need to create a template for each plugin. Manifest.template might be a nice addition for plugins which is the dev recommended raw yaml config for the plugin?

Default plugin template can be derived from plugin-input.ts so introducing a new abstraction for the template is kind of redundant.

I've built the UI to be generic but would it be completely out of the question to have a dedicated view for particularly complex plugins? Once a new plugin is shipped to -marketplace a view can be created if it's problematic like conversation-rewards is otherwise the generic UI is used?

That's not scalable. We won't build individual UIs for 1000 3rd party plugins.

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Nov 29, 2024

Default plugin template can be derived from plugin-input.ts so introducing a new abstraction for the template is kind of redundant.

Full-Default === no customization, all plugins installed
Custom === if installed user config else default for that single plugin
Minimal === non-default, no customization, developer defined config params existing as templates/minimal.yaml and copy/pasted into the user' config repo

manifest.template would have been like Minimal but per plugin dev defined, I thought may have been a good idea vs devs or us filling /templates with various yaml files and you could have a sort of drag and drop setup.

That's not scalable. We won't build individual UIs for 1000 3rd party plugins.

Yeah I guessed that ty, I'm sure we'll find an optimal solution.

@0x4007 0x4007 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2024
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

No branches or pull requests

3 participants