whisper-money/resources/js
Víctor Falcón ee69c51a84
feat(transactions): make new-transaction marker cross-device (#611)
## What

The "new since last visit" highlight (#609) stored its marker in
`localStorage` (`transactions-last-visit`), so it was **per-device**:
each device kept its own last-visit timestamp and re-flagged the same
rows. This moves the marker to a per-user server column so a single
"last visit" is shared across all your devices.

## How

- New nullable `transactions_last_visited_at` column on `users` (same
pattern as `last_active_at` / `paywall_seen_at`).
- `TransactionController@index` reads the stored marker, renders the
list with the **old** value (`lastVisitAt` prop), then advances it
forward to the newest `created_at` it served.
- Frontend drops the `localStorage` read/write and just freezes the
`lastVisitAt` prop at mount; `isNewSince` per-row logic is unchanged.

## Why newest-served `created_at` and not `now()`

Advancing to `now()` would mark a back-dated synced row (old
`transaction_date`, lands on a later page that wasn't served) as seen,
so it would never be highlighted — the exact "hiding" failure the
per-row design avoids. Advancing only to what was actually served keeps
the feature's "err on showing, never hiding" stance. The marker only
ever moves forward.

## Notes

- Same filter caveat as before: opening the list with a filter applied
advances the marker using the filtered payload. Carried over from the
original `localStorage` behavior; not a regression.
- Removed the now-dead `loadLastVisit` / `saveLastVisit` /
`newestCreatedAt` helpers and their tests.

## Tests

- `NewTransactionsMarkerTest` (feature): null marker on first visit +
stores newest served; later visit sees previous marker + advances
forward; marker never moves backward.
- `new-transactions.test.ts` (`isNewSince`), Pint, ESLint, Prettier all
pass.
2026-06-29 19:11:37 +02:00
..
components feat(transactions): highlight new transactions since last visit (#609) 2026-06-29 16:08:14 +00:00
contexts Move transaction filtering from client-side to server-side (#126) 2026-02-16 12:49:04 +01:00
hooks feat(dashboard): add accounts manager dialog with visibility toggle and reorder (#604) 2026-06-27 16:11:25 +00:00
layouts fix(layout): keep bottom padding while floating nav is visible (#537) 2026-06-15 18:23:26 +02:00
lib feat(transactions): make new-transaction marker cross-device (#611) 2026-06-29 19:11:37 +02:00
pages feat(transactions): make new-transaction marker cross-device (#611) 2026-06-29 19:11:37 +02:00
providers fix: move community link to user menu (#442) 2026-05-27 17:39:26 +02:00
services refactor(encryption): strip client-side transaction encryption (#514) 2026-06-20 16:13:26 +00:00
types feat(banking): enable Interactive Brokers for all users (#593) 2026-06-26 11:03:21 +02:00
utils feat(currency): add NZD (New Zealand Dollar) (#504) 2026-06-08 09:18:17 +02:00
app.tsx fix(sentry): drop browser-extension noise before sending events (#568) 2026-06-20 12:47:05 +02:00
ssr.tsx Remove plaintext-transactions feature flag & E2E references (#116) 2026-02-13 11:10:21 +01:00