Skip to content

Match ' QRT' in the comment as well as the existing QRT variants#827

Merged
accius merged 5 commits intoaccius:Stagingfrom
alanhargreaves:qrt
Mar 25, 2026
Merged

Match ' QRT' in the comment as well as the existing QRT variants#827
accius merged 5 commits intoaccius:Stagingfrom
alanhargreaves:qrt

Conversation

@alanhargreaves
Copy link
Copy Markdown
Contributor

@alanhargreaves alanhargreaves commented Mar 24, 2026

What does this PR do?

Adds another variant of 'QRT' to match a spot comment in POTA, SOTA and WWFF.

..., and of course just after creating the PR, I notice someone in WWFF put 'qrt' in their comments.

I deliberately chose to match against 'QRT', so we would pickup comments that had an end of string, or some kind of punctation following 'QRT'.

I noticed a SOTA spot being shown when the comment string was "Now QRT many thanks chasers".

Type of change

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

How to test

We don't see spots where the comment includes the string " QRT".

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

@alanhargreaves alanhargreaves marked this pull request as draft March 24, 2026 05:23
@alanhargreaves alanhargreaves marked this pull request as ready for review March 24, 2026 05:28
Copy link
Copy Markdown
Owner

@accius accius left a comment

Choose a reason for hiding this comment

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

Thanks for catching this — filtering QRT in any position in the comment is the right call.

A couple of notes on the implementation:

  1. Redundant .toUpperCase()comments is already uppercased on the line above (const comments = (...).toUpperCase().trim()), so the .toUpperCase() calls in the condition are unnecessary.

  2. includes(' QRT') is a bit too broad — it would match any word starting with QRT (e.g. hypothetical " QRTZ"). More importantly, a single regex can replace the entire chain of conditions and handle all positions/punctuation cleanly:

const comments = (s.comments || '').toUpperCase().trim();
if (/\bQRT\b/.test(comments)) return false;

This covers standalone QRT, QRT , QRT,, QRT, Now QRT many thanks chasers, etc. — all in one line, with word-boundary safety.

Applies to all three files (usePOTASpots, useSOTASpots, useWWFFSpots).

@alanhargreaves alanhargreaves changed the base branch from main to Staging March 25, 2026 00:11
@alanhargreaves
Copy link
Copy Markdown
Contributor Author

Good point. I also eliminated the extra variable.

@accius accius merged commit e6091aa into accius:Staging Mar 25, 2026
@alanhargreaves alanhargreaves deleted the qrt branch March 25, 2026 00:58
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