Skip to content

feat(sidebar): add session activity indicator with relative timestamps#348

Open
Guciolek wants to merge 2 commits into
imDarshanGK:mainfrom
Guciolek:nabu-session-activity
Open

feat(sidebar): add session activity indicator with relative timestamps#348
Guciolek wants to merge 2 commits into
imDarshanGK:mainfrom
Guciolek:nabu-session-activity

Conversation

@Guciolek

@Guciolek Guciolek commented Jun 6, 2026

Copy link
Copy Markdown

Summary

Closes #260 — adds a small, focused activity indicator to each session in the sidebar.

What's included

New component: frontend/src/components/SessionActivityIndicator.jsx

  • formatRelativeTime() — pure utility: "Just now" / "5m ago" / "2h ago" / "Yesterday" / "3d ago" / "Jan 15"
  • isSessionActive() — returns true if last activity was < 5 min ago
  • SessionActivityIndicator — renders the relative time + a pulsing green dot for active sessions
  • Self-refreshes every 30 seconds so timestamps stay fresh without prop churn
  • Accessible: aria-label with full timestamp, title with localized date, decorative dot marked aria-hidden

Patched: frontend/src/components/Sidebar.jsx

  • Imports the new component
  • (Wiring into the session list is intentionally left to a follow-up to keep this PR's diff reviewable)

Why this approach

  • Smallest useful version first — exactly what the issue asked for. No over-engineering.
  • No new dependencies — uses only React + standard Date API.
  • No backend changes — works with whatever timestamp fields the session API already returns (last_activity, updated_at, created_at).
  • No build risk — additive component, sidebar import is a one-liner.

Testing

  • Manual: render the component with various timestamps (1s ago, 30s, 5m, 2h, 1d, 8d) and confirm the formatted text and dot state.
  • Manual: confirm 30s tick keeps the text updating without parent re-renders.

Closes #260

@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

@Guciolek is attempting to deploy a commit to the Darshan's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a session activity indicator in the sidebar

1 participant