alpine-collective/alpinejs-devtools

Improve "component name" in component list

HugoDF opened this issue · 0 comments

See discussion: #189

Instead of currently rendering the component's "computed name" to be a single field:

<My Component>

We could render (render each of the relevant attributes that help identify the component):

<div x-title="My Component">

Initially we can start with the currently supported attributes see https://github.com/alpine-collective/alpinejs-devtools/blob/master/packages/shell-chrome/src/utils.js#L230-L243:

  • x-title
  • x-id
  • id
  • name
  • wire:id
  • phx-view="name" (live view name)
  • aria-label
  • x-data function name
  • role

We could probably make it configurable through the settings + limit the number of attributes we're displaying (tag name + x-data + 2-3 attributes), some attributes like id and wire:id will tend to be unique, that should be enough to allow users to know which component is which.