kendraio-app icon indicating copy to clipboard operation
kendraio-app copied to clipboard

Document `ui:widget: "remote-image"`

Open gsambrotta opened this issue 3 months ago • 4 comments

Summary The remote-image widget is available in Kendraio forms via uiSchema, but it is not currently documented. Developers and flow creators can see it used in some flows, but there’s no explanation of what it does or how to configure it. This makes it difficult to use the widget effectively.


Background

  • In config.ts, remote-image is registered as:

    { name: 'remote-image', component: FormlyRemoteImageInputComponent }
    
  • This means it is powered by the FormlyRemoteImageInputComponent (found under app/form-controls/formly-remote-image-input/).

  • Compared to k-image (which simply displays an image from a model field), remote-image is intended to render an image loaded from a remote URL, with extra logic for handling display.


What needs to be documented

  1. What the widget does

    • Explain that it displays an image from a remote URL field in the form.
    • Clarify whether it is read-only or supports editing/input.
    • Describe any special behaviors (e.g. loading state, fallbacks).
  2. How to use it in a form

    • Show a JSON schema example with a field (e.g. thumb_url)
    • Show the uiSchema configuration with "ui:widget": "remote-image"
    {
      "type": "form",
      "jsonSchema": {
        "type": "object",
        "properties": {
          "thumb_url": {
            "title": "Thumbnail URL",
            "type": "string"
          }
        }
      },
      "uiSchema": {
        "thumb_url": {
          "ui:widget": "remote-image"
        }
      }
    }
    
  3. When to use remote-image vs k-image

    • remote-image: fetches/displays images from a URL, may support input
    • k-image: display-only, simpler, used to render an existing image

Acceptance criteria

  • New section in the documentation (docs/forms/uiSchema.md or similar)
  • Example form snippet included
  • Explanation of purpose and usage
  • Comparison with k-image

gsambrotta avatar Sep 25 '25 12:09 gsambrotta

@gsambrotta Thanks, the issue above is OK with me for now.

For the future, I’m not convinced it’s good practice for issues to be in a long Large Language Model style with "Summary" and "Background" sections because extra text usually takes more time and can cause rework. In this case, it’s already done and if the example works, I suggest to leave it as is. For future issues, please could we concisely state the goal with a self-contained acceptance criteria, without extra "key questions" sections and without extra background or "summary" sections?

lukestanley avatar Sep 25 '25 13:09 lukestanley

@lukestanley @gsambrotta @CodeKrakken a long time ago I fought long and hard, before you were both here, to get k-image removed entirely and replaced with kendraio-image. I never want names shortened to k-... and always kendraio-... if it needs to reference the project at all anyway. Please can you check where if k-image is actually used anywhere and also if kendraio-image is a direct replacement? And afterwards please update everywhere that k-image is used to kendraio-image to reflect that. Please create another issue for this if necessary. Cheers!

dahacouk avatar Oct 10 '25 10:10 dahacouk

@lukestanley @gsambrotta @CodeKrakken a long time ago I fought long and hard, before you were both here, to get k-image removed entirely and replaced with kendraio-image. I never want names shortened to k-... and always kendraio-... if it needs to reference the project at all anyway. Please can you check where if k-image is actually used anywhere and also if kendraio-image is a direct replacement? And afterwards please update everywhere that k-image is used to kendraio-image to reflect that. Please create another issue for this if necessary. Cheers!

I've made https://github.com/kendraio/kendraio-app/issues/568 for this.

lukestanley avatar Oct 10 '25 12:10 lukestanley

@gsambrotta Please can this issue and any related documentation be updated to use kendraio-image?

lukestanley avatar Oct 10 '25 12:10 lukestanley