Le pedí a Cursor lo mejor de ambos mundos:
Cada línea puede agruparse si hay varios estados de un mismo sensor seguidos.
Hago lo mismo en Fable con las críticas que tenía para él para tener la mejor versión de cada lado.
Podremos comparar
La versión Fable 5 después del parche:
Bueno, pero he agotado mis cuotas de Claude de la tarde con todo esto
También prefiero el diseño de Fable 5, pero es una diferencia mínima.
En cambio, veo que solo gestiona un campo de fecha. Y es cierto que la propuesta de Cursor para las fechas era mejor.
Jajaja, sí, duele ^^ Y es imposible compartirlo …
Es cierto que al probar el diseño Fable 5 en la práctica, al final lo encuentro más cómodo de usar.
¡Así que es bastante interesante en realidad! Cuando seleccionas una fecha, en realidad « saltas » a esa fecha, pero ves los días alrededor, ¡así que es muy práctico!
pierre-gilles:
¡Es bastante interesante, en realidad! Cuando seleccionas una fecha, en realidad « saltas » a esa fecha, pero puedes ver los días alrededor, ¡así que es muy práctico!
Sí, hay que verlo al usarlo, pero es una idea interesante, sí.
¿El filtro de la parte superior de la página sigue fijo arriba, por cierto?
La fecha sigue pegada, pero no los filtros:
Ah sí ^^ No, por mi parte, me refería más bien a la cabecera de la página con los filtros + fechas + búsqueda:
Porque cuando buscas en un diario histórico, te gusta poder filtrar rápidamente ^^
Sí, estoy de acuerdo. Volveré a empezar tan pronto como tenga de nuevo crédito Claude
Te has pasado con el número de PR abiertas hoy
@Terdious el encabezado ahora es pegajoso, pero solo la selección de tipos de dispositivos.
Lo he probado y ¡es realmente limpio!
Pegajoso — sí, creo que es una buena idea, pero no para todo el cartucho: la fecha + la pieza + la búsqueda pegajosa ocuparían ~140 px de altura en móvil, casi un quinto de la pantalla. Lo que he hecho:
los filtros por categoría permanecen pegados arriba al desplazarse (una sola línea compacta, desplazable horizontalmente, con fondo opaco) — es la herramienta que más se manipula al recorrer el flujo;
los encabezados de día se pegan justo debajo , por lo que al desplazarse siempre se ve « qué día » + « qué filtros »;
la búsqueda y la fecha permanecen arriba de la página — se accede a ellas con un desplazamiento, y el botón « Volver al directo » / la etiqueta « N nuevos eventos » flotan de todos modos.
Pues creo que vamos a optar por la propuesta de Fable 5.
La PR:
master ← claude/smart-home-activity-history-h5lrne
ouvert 01:06PM - 03 Jul 26 UTC
### Pull Request check-list
To ensure your Pull Request can be accepted as fast… as possible, make sure to review and check all of these items:
- [x] If your changes affect the code, did you write the tests? (8 new server tests: lib + controller)
- [x] Are tests passing? (`npm test` device suites: 261 passing; front has no unit-test script)
- [x] Is the linter passing? (`npm run eslint` on both front/server)
- [x] Did you run prettier? (both front/server, all files pass `prettier --check`)
- [x] If you are adding a new feature/service, did you run the integration comparator? (`npm run compare-translations` on front — en/fr/de complete)
- [x] Did you test this pull request in real life? With real devices? (tested end-to-end with a seeded local instance — screenshots below workflow; not yet with real devices)
- [x] If your changes modify the API (REST or Node.js), did you modify the API documentation? (apidoc comments added on the new endpoint)
- [ ] If you are adding a new features/services which needs explanation, did you modify the user documentation?
- [x] Did you add fake requests data for the demo mode (`front/src/config/demo.js`) so that the demo website is working without a backend?
### Description of change
This PR adds a new **Activity** page (`/dashboard/history`, new "Activity" tab in the header) that shows a live, visual timeline of everything happening in the home: doors opening, motion detected, lights turned on/off, sensor values… It is designed to stay readable even for homes with 100–200 devices reporting states continuously.
**Front (the main part):**
- Visual timeline grouped by day ("Today", "Yesterday", then full dates), with a colored icon per event family, device name, human-readable action ("Opened", "Motion detected", "Turned on", "21.5 °C"…), room badge and time.
- **Burst grouping**: consecutive states of the same device feature are collapsed into a single line with a `×N` badge, expandable to see each timestamped occurrence — this is what keeps the feed readable with chatty sensors.
- Filter chips by event family (Openings, Motion & presence, Buttons & remotes, Lights & switches, Climate, Safety, Energy, Other), room selector and device search (server-side filtering, debounced).
- **Real-time**: new states arrive live through the existing websocket. When the user has scrolled down, events are not inserted (the content would move under their eyes): a floating "N new events" pill appears and scrolls back to top on click.
- Infinite scroll with cursor pagination (IntersectionObserver + "Load more" fallback), empty state, mobile responsive, en/fr/de translations, demo mode data.
**Server:**
- New endpoint `GET /api/v1/device_feature/states_history`: returns recent device states across all devices from DuckDB, most recent first, decorated with device feature / device / room metadata. Supports cursor pagination (`before` / `take`, capped at 500) and `categories` / `room_id` / `search` filters. The query is always constrained to existing device feature ids, so states of deleted features never consume rows of a page.
Screenshots (local instance with seeded data):
- Desktop timeline with live badge, filter chips and day sections
- "Openings" filter with ×N burst grouping and expandable occurrences
- Mobile view
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_012ZHMk4de6U51BGf6gnNqiR
---
_Generated by [Claude Code](https://claude.ai/code/session_012ZHMk4de6U51BGf6gnNqiR)_
## Summary by CodeRabbit
* **New Features**
* Added an Activity/History timeline at `/dashboard/history` with day grouping (“today/yesterday”), room/category filtering, search, live “new events” buffering, and infinite loading.
* Added an authenticated API endpoint to retrieve device feature state history with cursor pagination (including optional `before_id`).
* Extended demo data with rooms and historical device feature state events.
* **Documentation**
* Added/updated History page and navigation i18n strings across supported languages, including device value labels.
* **Tests**
* Added backend/controller and library tests covering metadata, filtering, ordering, pagination, and edge cases.
Si alguien quiere probarla, puede hacerlo esta mañana o al mediodía. Si no, planeo fusionarla a principios de la tarde.
Como mencioné antes, es un desarrollo de bajo riesgo: solo es una mejora estética. Podremos seguir mejorándolo, incluso una vez en producción, ya que no hay cambios en el modelo de datos.
¡Gracias a Claude Fable 5 por esta implementación!
Vale, está fusionado, saldrá en la próxima versión de Gladys
Esta función está disponible en Gladys Assistant 4.82:
Salut à tous,
Je sors aujourd’hui ce qui est, pour l’instant, l’une des plus grosses releases de l’année, et il y a une vraie raison à ça.
On est clairement à un tournant dans la façon de développer : les modèles d’IA gagnent en puissance, et les outils pour s’en servir au quotidien deviennent enfin matures. Depuis deux semaines, deux d’entre eux ont changé ma manière de travailler sur Gladys.
Claude Fable 5, le modèle phare d’Anthropic, celui qui a été temporairement restreint aux États-Unis…
Gracias a todos por su ayuda y sus comentarios