a2ui-project / a2ui-project/a2ui

[FEATURE]: Rendered components should be traceable back to the A2UI Component

Ouverte
#2,434 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
P2
Langage dominant
TypeScript
Étoiles
16.4k
Forks
1.3k
Merge moyen
2 j 13 h
PR mergées (30 j)
134

Description

In developing the [A2UI Composer](https://github.com/a2ui-project/composer), a few feature requests have come up where the user would want to select a rendered component and act on it.

The problem is, there's no way for us trace from a rendered component to the A2UI component it corresponds to.

I'm not sure how this would work in all cases, but at least for web-based renderers, if the outermost DOM element that represents the A2UI component had a `data-a2ui` property whose value is **exactly** the A2UI Component's ID, then that makes it easy. Not only is there a direct mapping, but its easy to query for DOM elements.

(For rendereed components which are from a "loop", then a few options are available; perhaps they all have the same `data-a2ui` value, with an additional `data-a2ui-instance` property to distinguish them? Or, depending on how they're rendered, perhaps there's a surrounding `div` or `span` that gets the `data-a2ui` property? Or, in the case of a list, maybe the `ol` or `ul` element gets the `data-a2ui`? Options :-))

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Look at the web-based renderers in the codebase to understand how components are currently rendered to DOM. Identify where the outermost DOM element is created and add a `data-a2ui` attribute with the component's ID. For looped components, decide on an approach (like adding `data-a2ui-instance`) and implement consistently. Test by rendering components and verifying the attributes appear correctly in the browser's developer tools.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
frontend, web-dev
Type d'issue
Fonctionnalité
Difficulté
3/5
Temps estimé
1-2 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
65/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.