Integration widgets: display an image and a clickable list in the same widget?

Hello everyone,

I am developing an external integration for Gladys 5: « Artisan Map » (GitHub - tlse-vins/gladys-carte-des-artisans: Intégration Gladys Assistant de la Carte des artisans : artisans près de chez vous (widget et action de scène) · GitHub). It searches for artisans around the house using the public Sirene data. It offers two widgets:

  • a list (card-list) : each business is clickable and opens the details with the address, phone number, and the links « View the card » / « Route » ;
  • a map (image PNG generated in the container) : the house, the search radius, and the numbered businesses.

What I would like to do: display the map at the top of the same widget, then below the same clickable list, numbered like the points on the map.

What is blocking me: according to the spec dashboard-widgets.md and normalizeWidgetContent, a widget only accepts a single « focal » component (chart, card-list, or image). With image + card-list, the second is ignored. As a workaround, I display the results under the map with a status, but its lines do not accept links or actions. Today, I therefore use a « List / Map » button that replaces one with the other.

My question: would it be possible to add one of these solutions?

  1. allow the combination image + card-list in the same widget (for example the image above, with a limited height) ;
  2. or allow a link (or an action) on the lines of a status ;
  3. or any other solution you would consider cleaner in the logic of the widgets.

If one of these options seems acceptable to you, I can try to propose a PR. I would appreciate your advice on the best approach.

Thank you.

Hi @Tlse-vins, thanks for the message and the mockup, it’s very clear!

I prefer to answer you frankly: I’m not going to evolve the widgets in that direction, and I think the problem isn’t the limit you’re encountering, but what you’re trying to fit into a widget.

A widget is not a product

A dashboard widget is a piece of information that you read at a glance, and possibly a button you press: today’s solar production, the status of the vacuum cleaner, the next movie releases. What you’re building is something else: a search, a list of results, a map, detailed cards, routes, a toggle between two views. It’s a complete application, and you’re twisting the widget vocabulary to make it fit into a dashboard card.

The limits you’re encountering (a single focal component, no link on a status, the List / Map button as a workaround) aren’t gaps to fill. They’re there exactly for that: to prevent a widget from becoming a page. If I allow image + card-list, the next request will be chart + card-list, then tabs, then filters, and we’ll have recreated an interface engine in the dashboard.

It won’t work on mobile

On a phone, the dashboard is a single column about 350px wide. Your card becomes a fixed image of 350 × 200px, without zoom, with numbered dots of a few pixels. Below come the list, then the buttons, then the search form: several scrolling screens in the middle of the dashboard, between the living room temperature and the shutters. Even if I lifted the limit, the result would be unusable where Gladys is most consulted.

What belongs in a widget

The “dashboard” version of your integration, in my opinion, is a single card-list: the nearest craftsmen for a trade and a radius chosen in the widget settings, with the detail panel (address, phone, “View the card”, “Route”). No search, no toggle. That, the current vocabulary does very well, and it remains readable on a phone.

And for the rest

The search tool with its map corresponds to custom integration screens (this topic), which are not yet specified. That’s where your use case will fit, not in the dashboard.

For the map itself, the planned track in the spec is a map component: the integration sends points, Gladys draws the map, with the theme, dark mode, and zoom.

A question by the way: what does the “Sponsored” badge on your mockup correspond to?

Thanks for your frank and detailed response, that’s exactly what I needed.

You’re right about mobile: I had only tested on desktop, and the map would be useless there. So I’ll go back to the dashboard spirit: a single card-list widget, with the profession and radius chosen in the settings, and the detail panel (address, phone, “View the card”, “Route”). I’ll remove the typed search, the toggle, and the map widget. The scene action “Find a craftsman” remains as is.

The search and the map will wait for the custom integration pages and the map component. I’ll follow the topic and I’ll be able to give concrete feedback on the spec when it progresses.

For the “Sponsored” badge: on the cartedesartisans.fr website, a craftsman can pay to appear in a “Sponsored” box when searching for their profession in their area. The rules are the same everywhere: a maximum of 3 companies, always marked “Sponsored”, in a separate block at the top of the list. Normal results don’t change: labeled companies first, then the closest ones. This block never appears in the scene action, and no user data is transmitted: the home position never leaves the container. If this type of content causes problems for the store, let me know and I’ll remove it from the Gladys integration.