Skip to content

Improve active-timers syncing and add home-specific timer script#12

Merged
Fingolfin7 merged 2 commits intomasterfrom
codex/improve-responsiveness-of-timers-page
Apr 13, 2026
Merged

Improve active-timers syncing and add home-specific timer script#12
Fingolfin7 merged 2 commits intomasterfrom
codex/improve-responsiveness-of-timers-page

Conversation

@Fingolfin7
Copy link
Copy Markdown
Owner

Motivation

  • Ensure the active-timers UI remains consistent with server state and supports pages that show partial/limited timer lists.
  • Reduce unnecessary DOM traversal and improve time formatting to include days/hours for long-running timers.
  • Provide a specialized, lightweight client-side refresh for the home page that can reload only the timers fragment when needed.

Description

  • Apply filter_by_active_context to list_active_sessions in core/api.py so the active-sessions API respects the same context filtering as other session endpoints.
  • Update core/static/core/js/dynamic_timers.js to scope DOM queries to #active-timers .card[id^="timer-"], add formatTime that includes days/hours, implement getLocalTimerIds and syncActiveTimers which polls /api/list_active_sessions/ and reloads the page when the server-side active timers differ from the client.
  • Add a new core/static/core/js/home_timers.js that mirrors the duration updates but is home-page aware: it checks capacity via data-max-visible, refreshes the timers fragment via $(selector).load() when needed, and guards concurrent refreshes with refreshInFlight.
  • Update core/templates/core/home.html to load home_timers.js instead of dynamic_timers.js and add data-max-visible="5" to #active-timers for partial-list behavior.

Testing

  • No automated tests were run as part of this change.

Codex Task

@Fingolfin7 Fingolfin7 merged commit f9fcd09 into master Apr 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant