Skip to content

feat: add PSK Reporter Band Activity overlay - #1136

Open
lbatalha wants to merge 3 commits into
accius:Stagingfrom
lbatalha:detailed-spots-view
Open

feat: add PSK Reporter Band Activity overlay#1136
lbatalha wants to merge 3 commits into
accius:Stagingfrom
lbatalha:detailed-spots-view

Conversation

@lbatalha

Copy link
Copy Markdown
Collaborator

Compact horizontal bar chart showing PSKReporter spot counts per HF band.

Features:

  • Client-side counting from usePSKReporter data (filtered by time window)
  • Real-time updates via custom events (no polling)
  • Fixed panel size, all 15 HF bands always visible
  • Inactive bands dimmed with reduced opacity
  • Minimizeable with footer that shows total spots and time window
  • Draggable panel with saved position
  • Styled with band colors and consistent with other overlays

This should fix #1134

Type of change

  • Bug fix
  • New feature
  • Performance improvement
  • Refactor / code cleanup
  • Documentation
  • Translation
  • Map layer plugin

How to test

  1. Enable Map layer
  2. See that spot counts show up per band and that total matches PSKReporter panel results

Checklist

  • App loads without console errors
  • Tested in Dark, Light, and Retro themes
  • Responsive at different screen sizes (desktop + mobile)
  • If touching server.js: caches have TTLs and size caps (we serve 2,000+ concurrent users)
  • If adding an API route: includes caching and error handling
  • If adding a panel: wired into Modern, Classic, and Dockable layouts
  • No hardcoded colors — uses CSS variables (var(--accent-cyan), etc.)
  • No .bak, .old, console.log debug lines, or test scripts included

Screenshots (if visual change)

image

lbatalha added 2 commits July 23, 2026 21:38
Compact horizontal bar chart showing PSKReporter spot counts per HF band.

Features:
- Client-side counting from usePSKReporter data (filtered by time window)
- Real-time updates via custom events (no polling)
- Fixed panel size, all 15 HF bands always visible
- Inactive bands dimmed with reduced opacity
- Minimizeable with footer that shows total spots and time window
- Draggable panel with saved position
- Styled with band colors and consistent with other overlays

@accius accius left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice work overall — this is exactly the right way to build on the PSK Reporter data: the overlay rides the existing MQTT→SSE pipeline with zero new upstream traffic, and the panel follows the layer-plugin conventions (draggable/minimize, storage keys, escaped interpolation). One required change and two optional ones:

Required — please remove the GET /api/pskreporter/band-activity endpoint (server/routes/pskreporter.js). Nothing in this PR calls it — the client gets its counts from the psk-band-activity-changed CustomEvent — and as written it's a footgun on shared/hosted instances: uncached, it iterates every subscriber's recentSpots buffer per unauthenticated request, and it double-counts spots that appear under multiple subscription keys, so the numbers it returns are wrong on any multi-user server anyway. (Your own checklist flags the missing caching.) The feature works perfectly without it — if we later want a server-side aggregate, it needs caching and per-subscriber dedup, which can be its own PR.

Optional:

  1. Stale counts on quiet bands: the event only fires inside processSpots, so when no new spots arrive, expired spots stay counted in the panel until the next batch. A periodic re-emit (or filtering by spot age at render time) would keep the bars honest.
  2. In the content-update effect, the insertBefore(contentTarget, container.querySelector('.psk-band-footer')) fallback would throw if ever reached — after addMinimizeToggle wraps children into .psk-panel-content, .psk-band-footer is no longer a direct child of container. Unreachable today, but worth fixing while you're in there.

Drop the endpoint and this is good to go.

Overlay now uses client-side events exclusively, no server fetch needed.
@lbatalha

lbatalha commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

The API endpoint call was originally needed because more info was going to be displayed, but for just this change its definitely not needed, removed it.

The stale counts problem does happen if pskreporter has no data. I tried fixing it in various ways but could not figure it out, even converting the event to a useEffect, etc... so it might be out of my skill level and understanding of how React works.

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.

2 participants