Browser Extension Architecture
Relevant source files
The following files were used as context for generating this wiki page:
The Ever Teams browser extension is a component of the Ever Teams platform, designed to integrate time and task management directly into the user's browsing experience. It is currently in an active "Work in Progress" (WIP) stage.
The extension is built using the Plasmo Framework, a specialized framework for creating browser extensions with React and TypeScript. This choice provides a modern development environment with features like auto-reloading, automated manifest generation, and a structured project layout. The extension is part of the larger ever-teams monorepo.
Sources: README.md, apps/extensions/README.md, CREDITS.md
Technology Stack and Tooling
The extension leverages a modern web development stack, centered around the Plasmo framework.
| Technology/Library | Purpose |
|---|---|
| Plasmo | Core framework for building the browser extension. |
| React | UI library for building the extension's user interface (e.g., the popup). |
| TypeScript | Provides static typing for improved code quality and maintainability. |
| Tailwind CSS | A utility-first CSS framework for styling the UI. |
| pnpm | The recommended package manager for Plasmo projects. |
Sources: apps/extensions/package.json, apps/extensions/README.md
Key Dependencies
The following table lists the primary dependencies for the extension.
| Package | Version | Description |
|---|---|---|
plasmo | ^0.85.2 | The core browser extension framework. |
react | 18.2.0 | Library for building user interfaces. |
react-dom | 18.2.0 | Serves as the entry point to the DOM and server renderers for React. |
tailwindcss | ^3.2.4 | Utility-first CSS framework for styling. |
react-timer-hook | ^3.0.5 | A custom hook for managing timers (likely for time tracking). |
Sources: apps/extensions/package.json:12-18
High-Level Architecture
The extension follows a standard browser extension architecture, conceptually divided into a popup UI, a background service worker, and content scripts. The Plasmo framework abstracts much of the boilerplate for these components.
The diagram below illustrates the conceptual components of the extension.
Sources: apps/extensions/README.md
State Management
A critical architectural point is the management of application state. Currently, state is managed within the background service worker. However, this is identified as a bug and a target for refactoring. The plan is to move all state management from the service worker to the browser's local storage. This ensures data persistence and avoids issues related to the service worker's lifecycle.
The diagram below shows the planned state management refactor.
Sources: apps/extensions/README.md:8-9
Build and Development
The extension's development and build processes are managed by the Plasmo CLI and integrated into the monorepo's yarn scripts.
| Script | Command | Description |
|---|---|---|
dev | yarn plasmo dev | Starts the development server with hot-reloading for the extension. |
build | yarn plasmo build | Creates a production-ready build of the extension. |
These scripts are defined in the extension's local package.json and can be triggered from the monorepo root via the build:extensions script.
Sources: apps/extensions/package.json:8-10, package.json:30
Manifest and Permissions
Plasmo automatically generates the manifest.json file from configuration within package.json. The key configuration is the host_permissions.
"manifest": {
"host_permissions": [
"https://*/*"
]
}
This configuration grants the extension broad access to read and modify data on all websites (https://*/*). This is a powerful permission required for features that might need to interact with various project management tools (like GitHub, JIRA, etc.) but also carries security implications that should be managed carefully.
Sources: apps/extensions/package.json:49-53
Current Status and Roadmap
The extension is in an early development phase with several known issues and planned improvements.
| Type | Description |
|---|---|
| Bug | Adding a new task does not save correctly in the state. |
| Bug | There is an issue with saving the time for a task. |
| Refactor | All state needs to be moved from the service worker into local storage. |
| Refactor | The activeTask and allTasks state fields have duplicated data and should be consolidated. |
| UI/UX | General UI/UX improvements and a potential redesign are needed. |
| Feature | Add the ability to change a task's estimated time and save it. |
| Feature | Add a "clear" button (X) next to the active task input. |
| Feature | Implement a new view for "Check team" to see team member details and work statuses. |
Sources: apps/extensions/README.md:6-14
Conclusion
The Ever Teams browser extension is architected on the modern Plasmo framework, providing a solid foundation with React and TypeScript. While currently in a preliminary stage, the project has a clear, albeit challenging, roadmap. The highest priority is a critical architectural refactor to move state management from the ephemeral service worker to persistent local storage. Resolving this, along with other identified bugs and feature gaps, will be essential for delivering a stable and functional product.