Fix home page recent-activity polling to not load all tasks

t-641·WorkTask·
·
·
Parent:t-642·Created11 hours ago·Updated9 hours ago

Description

Edit

On the home page (/tasks), after initial load there's a multi-second pause, then the HTMX hx-get="/partials/recent-activity-new" fires and loads ALL tasks into the recent activity section. This is because the handler (recentActivityNewHandler in Omni/Task/Web/Handlers.hs) filters tasks by updatedAt > sinceTime, but on first load since=0 (epoch), so ALL tasks match.

Fix the handler to limit results:

  • In recentActivityNewHandler, add a LIMIT to the results (e.g., max 20 tasks returned)
  • The since parameter should still work for incremental updates, but cap the result count
  • The initial page already loads 5 recent tasks server-side, so the polling endpoint only needs to return tasks newer than those

Specific fix in Omni/Task/Web/Handlers.hs line ~394-401:

let newTasks = take 20 $ filter (\t -> taskUpdatedAt t > sinceTime) sortedTasks

Also consider: on first page load, the since value from data-newest-ts should be set to the timestamp of the most recent task shown, not 0. Check that the initial newestTimestamp calculation on the HomePage is correct.

Key files: Omni/Task/Web/Handlers.hs (recentActivityNewHandler), Omni/Task/Web/Pages.hs (HomePage, newestTimestamp) Namespace: Omni/Task.hs

Timeline (9)

🔄[system]Open → InProgress9 hours ago
💬[system]9 hours ago

Pipeline: dev completed (run=dev-t-641-1771441494, cost=0.0c)

🔄[system]InProgress → Verified9 hours ago
💬[system]9 hours ago

Pipeline: verification skipped (No namespace set, skipping build verification), promoting

🔄[system]Verified → Done9 hours ago
💬[system]9 hours ago

Pipeline: integrated into live at ce8994a962f36f0d6d7d6e4c9054a97f1d96f9aa