Lorsque je veux mettre une 21ème épingle, je ne peux pas sauvegarder le tableau de bord
(Lorsque je la supprime c’est bon je peux sauvegarder)
Salut @Chris75 ,
Merci pour le retour et les captures, et désolé pour le délai de réponse !
Ta 21ᵉ épingle n’a rien de particulier : le widget « Vue de la maison » est limité à 20 épingles . Le vrai bug, c’est que l’éditeur te laisse en poser une 21ᵉ sans rien dire. Ensuite, à la sauvegarde, Gladys refuse le tableau de bord avec un message générique (« êtes-vous sûr d’avoir rempli tous les champs ? ») qui n’aide pas du tout à comprendre le problème.
J’ai ouvert une issue GitHub pour le corriger : #3357
L’idée est de relever la limite et de faire en sorte que l’éditeur te prévienne clairement quand tu l’atteins, au lieu de bloquer la sauvegarde sans explication.
En attendant, tu peux contourner le problème de deux façons :
répartir tes valeurs sur deux widgets « Vue de la maison » (par exemple un pour les températures et l’humidité, un pour les ouvrants) ;
ou afficher une partie des valeurs dans un widget « Pastilles d’état ».
Salut tout le monde !
Ce sujet est désormais en cours de développement .
Une PR a été ouverte pour plafonner les épingles, chips et actions dans l’éditeur, et passer la limite des épingles du widget Maison à 50 :
master ← claude/house-view-pins-limit-3357
opened 09:25AM - 13 Nov 26 UTC
### Description
The server accepted at most 20 pins per house-view widget, and … also at most 20 chips and 20 actions (`.max(20)` in `server/models/dashboard.js`). The editors let the user add as many as they liked. With a 21st entry, the save failed with the generic *"The dashboard is not valid, are you sure you filled in all the fields?"*, which never says which widget or field is wrong.
**Fix**
- **One shared constant**, `DASHBOARD_BOX_MAX_ITEMS` in `server/utils/constants.js` (`HOUSE_VIEW_PINS`, `CHIPS`, `ACTIONS`). The Joi box schema and the three box editors both read it, so the editor and the server always agree on the limit.
- **House-view pins: the limit goes from 20 to 50.** 20 is easy to reach once a whole house is mapped: one temperature, one humidity and one opening per room is already 21 for the forum user. The chips and actions bars are compact by design and keep 20.
- **House-view editor** (`EditHouseViewBox.jsx`): at the cap, a click on the image places nothing, the crosshair cursor turns back to the default arrow, and a message under the image gives the maximum. Moving and removing pins still work, and removing one makes room again.
- **Chips and actions editors** (`EditChipsBox.jsx`, `EditActionsBox.jsx`): at the cap, the "Add" button is disabled and a message gives the maximum. The add handlers also check the cap themselves.
- Unfinished entries (no type, target or feature yet) count toward the cap. They are dropped on save, so the saved list can only be shorter than the editor's.
- New i18n keys (`maxPinsReached`, `maxChipsReached`, `maxActionsReached`) in all four language files.
- **Living spec updated in the same diff** (`docs/specs/dashboard-flexible-layout-and-widgets.md`):
- B: the shared constant and the editor caps.
- B2: the actions limit.
- E: the new pin limit and how the editor behaves at the cap.
Out of scope: the `photo` box has the same uncapped-editor pattern (`max(100)`), but the issue does not mention it, so it is untouched. The generic 422 message on save is also unchanged: with the editors capped, users cannot reach it through these lists any more.
**Tests**
- Server (`dashboard.update.test.js`): for house-view pins, chips and actions, a box at exactly the maximum is accepted and one entry over is refused.
- Cypress (`DashboardBoxListCaps.cy.js`): in the real editor, each box starts one entry short of its cap. The test adds the last one and checks the message and the blocked add. For the house view it also checks that a further click places nothing and that removing a pin makes room again.
**Checks run locally** (rebased on the current `master`, which includes #3345):
- server: `prettier-check` ✅, `eslint` ✅ (0 errors; same 83 existing warnings as on `master`), `npm run coverage` ✅ 9315 passing, 0 failing. Every added or changed server line is executed.
- front: `prettier-check` ✅, `eslint` ✅ (0 errors), `compare-translations` ✅, `build` ✅
- `npm run cypress:run` ✅ 29 specs, 147/147 passing
### Related request
Closes #3357
Forum: https://community.gladysassistant.com/t/bug-widget-maison/10806
### Checklist
- [x] If a forum topic or GitHub issue exists, the description links it (`Forum: https://community.gladysassistant.com/t/...` or `Closes #...`)
- [x] Tests pass: `cd server && npm run coverage` (Codecov requires 100% coverage on changed lines) and Cypress (`npm run cypress:run`) if the UI changed
- [x] Linter and prettier pass on both front and server (`npm run eslint`, `npm run prettier`)
- [x] No undocumented breaking change
---
_Generated by [Claude Code](https://claude.ai/code/session_01MNjB35D3XBRHr5Hh25AMoX)_
N’hésitez pas à suivre la PR, à tester (optionnel, surtout pour les petites demandes) et à faire vos retours ici si besoin.