Skip to content

feat: v1.2.0 SRS flashcards, tone controls, test suite, and CI improvements#7

Merged
Aster1630 merged 9 commits into
mainfrom
development
May 17, 2026
Merged

feat: v1.2.0 SRS flashcards, tone controls, test suite, and CI improvements#7
Aster1630 merged 9 commits into
mainfrom
development

Conversation

@olliemochi

Copy link
Copy Markdown
Contributor

What does this PR do?

Delivers v1.2.0, a batch of features, hardening, and developer experience improvements across the extension, settings UI, CI, and docs.

Why?

The extension had no test coverage, no spaced repetition in flashcards, no data portability for custom cards, and several UX gaps (no theme override, no per-check controls, no keyboard shortcuts). CI was also missing security scanning and the test suite entirely. This PR closes all of those gaps in one release.

Module(s) changed

  • Feed Sanitizer (content_scripts/feedSanitizer.js)
  • Ad Blocker (content_scripts/maliciousAdBlocker.js)
  • Writing Assistant (content_scripts/toneTranslator.js)
  • Flashcards (content_scripts/flashcard.js)
  • Config files (config/)
  • UI (ui/)
  • Server (server/)
  • Tests (tests/)
  • Docs / Translations (sources/, README.md)
  • GitHub / repo files

Testing done

  • npm test passes (43/43)
  • Tested in Firefox
  • Tested in Chrome
  • Tested on: YouTube (feed sanitizer + flashcard overlay), Gmail (standalone tone translator panel), Flashcard Manager page (export/import, SRS badge), Settings page (theme toggle, writing checks, filter URL list)

Checklist

  • PR title follows type: description format (feat / fix / chore / ci / docs / refactor / test / security)
  • No new external dependencies added to the extension itself (jsdom and vitest are devDependencies only)
  • No user data sent anywhere without opt-in
  • Config changes are backwards-compatible (old keys still work new keys fall back to defaults)
  • If CSS selectors changed: verified they work on the live site today
  • CHANGELOG.md updated if this is a user-facing change

olliemochi and others added 7 commits May 16, 2026 21:23
- Add a Vitest-based test harness and initial unit tests for core extension logic.
- Introduces package.json (version 1.2.0) with test scripts and vitest devDependency, and vitest.config.js (node environment, globals).
- Adds tests for CORS origin validation, ABP/uBlock filter parser, and local tone analysis (functions inlined from source for isolated testing).
- Includes a minor README wording tweak.
Introduce several UI features and styles across the settings and cards views:
- Add a segmented theme picker, writing-checks controls (checkboxes + range), and a configurable filter-URL list with add/remove/reset.
- Add import/export buttons and file input for custom cards, group section actions, and add a page footer component.
- Add new CSS utilities (segmented control, checks grid, url-list, btn-secondary, section-actions, page-footer) and minor layout tweaks (wrapping/gaps).
- Update credit links from Aster1630 to AetherAssembly in popup, settings and cards.
- Accessibility improvements: radio/group roles and aria-live/status messages, and aria-label on the import file input.
-  Add integrity check when updating external filter lists; if total selectors drop >30% vs cached data, keep cached selectors and write a warning status to storage to guard against truncated fetches or compromised sources.
- Update status message to use computed total.
- Add jsdom to devDependencies for tests.
- Add export (download JSON) and import (validate {q,a} entries) flows for custom cards, with user feedback and error handling.
- Expand defaults (theme, toneChecks, longSentenceThreshold, filterListUrls) and add theme application/selector, a generic showMsg helper, writing checks UI (toggles + threshold), filter URL management (add/remove/reset + rendering), minor connection-test formatting tweaks, and streamlined filter update messaging.
- Add a new CONTRIBUTING.md documenting architecture, local loading, tests, filter parser, coding/security guidelines, and commit/PR conventions. (Thanks @EvilLickCompany !)
- Update issue and PR templates to include Server and Tests options and additional checklist items (npm test, PR title format, CHANGELOG) (Thanks @EvilLickCompany !).
- Also bump manifest.json version to 1.2.0.

Co-Authored-By: MilozArtCorner <EvilLick@aetherassembly.org>
Flashcards:
- Simple SRS (ease/interval in chrome.sync, log results on reveal/skip/timeout)
- No repeat of last card
- Due count badge + styling
- Dialog ARIA + focus handling
- Alt+Shift+F shortcut
- Timeout counts as failed recall
- Auto-hide behavior

Tone Translator:
- Configurable local analysis (per-check toggles, long-sentence threshold)
- Panel ARIA + Esc-to-close
- 750ms server call cooldown
- Header button tooltip adjustment
Co-Authored-By: Aster <78175649+Aster1630@users.noreply.github.com>
@olliemochi olliemochi requested a review from Aster1630 May 17, 2026 03:01
@github-actions github-actions Bot added content-script Changes to content_scripts/ ui Popup or flashcard manager UI manifest manifest.json changes background background.js or utils.js changes docs Documentation or translation changes tests Changes to the test suite labels May 17, 2026
@olliemochi olliemochi self-assigned this May 17, 2026

@Aster1630 Aster1630 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Went through all the key files good release overall. A few things worth tracking, none of them blockers.

flashcard.js

SRS logic is clean and the ARIA work is a nice touch. A few things:

  • cardKey uses the first 40 chars of the question to build a storage key. Two cards with nearly identical questions would silently clobber each other's SRS data. A hash of the full question text would be safer.
  • SRS data is stored in chrome.storage.sync which has a 100KB total quota. SRS state doesn't really need to sync across devices, and chrome.storage.local has a much higher limit. Sync failure here would silently break SRS tracking.
  • No try/catch around the storage calls in getSRS, saveSRS, recordResult. A storage error fails silently.
  • The card widget is hardcoded dark (#1a1a2e) but this PR also adds a theme picker in settings the flashcard doesn't respect that. Probably fine to leave as a follow-up but worth filing an issue.
  • role="dialog" + aria-modal="true" with no focus trap. Tab can still escape the card. Should trap focus between the three buttons.

toneTranslator.js

The panel uses role="complementary" + aria-live="polite" on the whole panel. That means screen readers will announce every content update, which is going to be very noisy for anyone typing a long document. Would scope aria-live to just the suggestions element, not the entire panel.

maliciousAdBlocker.js

el.dataset.mtChecked = '1' means any element whose href or text changes dynamically after the first scan is never re-evaluated. This is a common SPA issue probably worth a comment or a follow-up issue since it's not a regression.

background.js

DEFAULTS is duplicated between background.js and popup.js with a "keep in sync" comment. That's a future footgun. Even a shared config/defaults.js import would be cleaner.

Tests

Tone analysis suite is solid. Missing coverage for:

  • The SRS functions (cardKey, recordResult, pickCard); the most complex new logic in this PR
  • The 30% integrity check in updateFilterLists() in background.js
  • isMalicious() in maliciousAdBlocker.js

Would be good to file issues for those. Not blocking.

CodeQL failure is a known config issue with the file type, not a real problem. Everything else is green. Approving.

@Aster1630 Aster1630 merged commit eb3abf8 into main May 17, 2026
10 of 11 checks passed
@Aster1630 Aster1630 deleted the development branch May 17, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

background background.js or utils.js changes content-script Changes to content_scripts/ docs Documentation or translation changes manifest manifest.json changes tests Changes to the test suite ui Popup or flashcard manager UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants