mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-11 14:00:29 +00:00
a0113b9648
Fixes #1687. Also addresses the locale half of #1685. The per-row Resource button in Alerts > History rendered its panel as a page-level sibling in HistoryTab, between the filters card and the table. Reproduced at 1280px: scrolled 3200px into the history, clicking the button opened the panel 2595px above the top of the viewport. The only visible effect was the row list shifting down as the panel was inserted above it, so the button read as dead and the reporter could not reach the incident detail or the absolute timestamps it carries. Render the panel inline under the row instead, matching the neighbouring Timeline button, in both the desktop table and the phone card list. Because several alerts can share one resource, the panel state now carries the originating rowKey and each row renders it only on a match, which also keeps exactly one panel open at a time. Re-triggering the same row closes it. The resource resolver moves from a HistoryTab prop onto the history state. useAlertHistoryState already receives getResource; re-exposing it avoids threading the lookup through the table section, group row, alert row and mobile list now that the panel mounts in four places rather than one. Row timestamps were built with a hardcoded 'en-US' locale while the rest of this feature already formats through the viewer's locale, so a European reader saw "05:19 AM" for 05:19. They also showed clock time only, with the date available just in the day group header, which scrolls out of sight in a long history. Both surfaces now format through the viewer's locale and carry the full absolute date and time as a title, with the formatters owned by the history state so table and mobile cannot drift. Verified against mock data at 1280px and 390px: the panel opens in view under the clicked row and card, a non-owning row renders nothing, timestamps render 23:50 with a "Thursday, 6 August 2026 at 23:50:18" title across all 98 rendered rows, and there is no horizontal overflow at phone width. Contract-Neutral: Contract deltas staged in alerts.md (inline resource-incident panel placement, rowKey targeting, locale-aware row timestamps) and frontend-primitives.md rule 35 plus its prose (resource resolver moves from the tab prop chain to the history state). Residual demand is an 'alerts frontend surface proof' from a fixed policy list that does not name the three test files this change actually exercises: __tests__/useAlertHistoryState.test.tsx, __tests__/AlertHistoryMobileList.test.tsx and __tests__/HistoryTab.test.tsx, all staged with new assertions covering the panel placement, the toggle, and the timestamp title. Editing an unrelated listed proof file would be fabrication.