Skip to content

Develop2#32

Closed
tshasan wants to merge 103 commits intomainfrom
develop2
Closed

Develop2#32
tshasan wants to merge 103 commits intomainfrom
develop2

Conversation

@tshasan
Copy link
Collaborator

@tshasan tshasan commented Apr 25, 2025

Rewrite

MitPete and others added 30 commits February 25, 2025 20:41
… flow

- Prevented repeated loading of zero-shot and embedding models in transformers.js
- Added performance timers and debug logs for model loading
- Enabled optional `useFake` flag for offline embedding fallback
- Ensured getEmbedding only loads once and is reused across pipeline
- Improved background.js init: loads model first, then batches
- Refactored StorageManager.js to handle batching with skipEmbedding option
- Cleaned up duplicate history handling and CSV updates
- Proper third-party and about:blank domain filtering
- Models now load once and stay cached across batch operations
- Blocked subdomain-based tracking (e.g., tr.snapchat.com)
- Improved logging and CSV protection
- Ensured clean IndexedDB and historyData tracking only real user visits
- Added analytics.js for tracking user interactions and will host exstension logic
katesawtell and others added 27 commits April 18, 2025 12:13
* added prompts

* Correct filename casing to resolve import issues on case-sensitive systems

* fixed prompt function, took out refernece to nonexisting asset, moved fetch history to front end

* putting info from background onto slides

* got it to not repeat domains

* all slide info in one file

* rest of handler slides

* fix time range, add in prompts, fix time spent and peak browsing time

* Styling

* more style

* top sites now shows up, still shows up if less than 3 sites

* added setting button, will add setting pg content  later

* more prompts to match background handlers ! changed function that grabs prompt

---------

Co-authored-by: tshasan <taimurhasan@proton.me>
Co-authored-by: divaldez7464 <divaldez7464@users.noreply.github.com>
Co-authored-by: katesawtell <katesawtell@users.noreply.github.com>
* radar graph

* time of day graph

* not applicable
- Added JSDoc comments to various modules and functions for better clarity and maintainability.
- Introduced new scripts in package.json for generating and serving documentation.
- Updated background script to expose handler functions for easier debugging.
- Refactored database initialization and storage functions to improve error handling and logging.
- Enhanced concurrency handling in utility functions based on environment capabilities.
- Updated configuration constants for better clarity and added new constants for ML engine configuration.
- Improved the logic for counting co-occurrences and trends in browsing history.
- Added new functions for fetching unique websites and visit counts per hour.
- Cleaned up and organized handler exports for better module management.
Enhance documentation and improve code structure
@tshasan tshasan requested a review from Copilot April 25, 2025 07:23
@tshasan tshasan closed this Apr 25, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR rewrites and refactors the background handler functions and related configuration for the Firefox Recap extension, enhancing data processing and updating documentation and CI workflows.

  • Refactored module handler exports and individual functionality for visit and domain analysis
  • Updated CI workflow and ESLint configuration, and refreshed the README documentation
  • Removed unused models/transformers.js file

Reviewed Changes

Copilot reviewed 77 out of 81 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/background/handlers/index.js Re‑exports all background handler functions
src/background/handlers/*.js (multiple files) Implements data aggregation for visits, unique websites, trends, etc.
src/background/handlers/fetchAndStoreHistory.js Fetches history, applies ML classification, and stores data atomically
src/background/background.js Initializes database and exposes handler functions globally
eslint.config.mjs Updates ESLint config to include Node globals and updated settings
README.md Revamps extension documentation and usage instructions
.github/workflows/ci.yml Updates CI pipeline with Node v18 and revised build/test steps
Files not reviewed (4)
  • .babelrc: Language not supported
  • jsdoc.json: Language not supported
  • manifest.json: Language not supported
  • package.json: Language not supported
Comments suppressed due to low confidence (1)

src/background/handlers/fetchAndStoreHistory.js:42

  • [nitpick] The variable 'i' is not descriptive; consider renaming it to 'historyItem' for improved readability.
for (const i of raw) {

for (const i of raw) {
if (!(await shouldBlockDomain(i.url))) valid.push(i);
}
if (!valid.length) return console.debug('No valid history items found.');
Copy link

Copilot AI Apr 25, 2025

Choose a reason for hiding this comment

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

Consider returning 0 instead of just logging a debug message when no valid history items are found, so that the function consistently returns a number as promised.

Suggested change
if (!valid.length) return console.debug('No valid history items found.');
if (!valid.length) {
console.debug('No valid history items found.');
return 0;
}

Copilot uses AI. Check for mistakes.
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.

4 participants