feat: v1.2.0 SRS flashcards, tone controls, test suite, and CI improvements#7
Conversation
- 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>
Aster1630
left a comment
There was a problem hiding this comment.
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:
cardKeyuses 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.syncwhich has a 100KB total quota. SRS state doesn't really need to sync across devices, andchrome.storage.localhas a much higher limit. Sync failure here would silently break SRS tracking. - No
try/catcharound the storage calls ingetSRS,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.
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
content_scripts/feedSanitizer.js)content_scripts/maliciousAdBlocker.js)content_scripts/toneTranslator.js)content_scripts/flashcard.js)config/)ui/)server/)tests/)sources/,README.md)Testing done
npm testpasses (43/43)Checklist
type: descriptionformat (feat / fix / chore / ci / docs / refactor / test / security)