Skip to content

Conversation

dharmesh-hemaram
Copy link
Member

@dharmesh-hemaram dharmesh-hemaram commented Oct 17, 2025

This pull request introduces significant improvements to the status bar functionality, Chrome extension action handling, and messaging infrastructure. The main themes are a refactor of the status bar to use Chrome action APIs for feedback, the introduction of a port-based messaging system for extension communication, and enhancements to the extension manifest and batch processing logic.

Status Bar Refactor and Integration with Chrome Action APIs:

  • The StatusBar class in status-bar.ts is refactored to interact directly with Chrome's action APIs for visual feedback, such as badge text, icon, and title, instead of manipulating DOM elements. Methods like enable, disable, wait, error, and done now update the extension's action state via the new ActionService. The previous DOM-based implementation and the ManualStatusBar class are removed.
  • The status bar package now depends on the core-service package, enabling it to use the new ActionService. [1] [2]
  • The status bar is enabled or disabled based on configuration state in the content scripts, improving user feedback during extension operation. [1] [2]

Chrome Action API and Messaging Enhancements:

  • The ActionMessenger class is expanded to support new methods (enable, disable, setBadgeTextColor) and all methods now operate on a per-tab basis using the sender's tab ID.
  • The ActionService is refactored to use a new PortService for messaging, providing non-blocking, port-based communication with the background script. New methods for enabling/disabling the action and setting badge text color are added. [1] [2]
  • The runtime message listener now passes the sender to ActionMessenger methods, ensuring correct tab-specific updates.
  • A new Runtime.onConnect method is introduced to handle port connections from content scripts, supporting the new port-based messaging system.
  • The background script now listens for onConnect events, further integrating the port-based communication model.

Extension Manifest and Model Updates:

  • The extension manifest's action field is updated to provide icons at multiple resolutions and a default title, improving appearance and accessibility in the browser UI.
  • The IExtension interface is updated with a new __addonRecheck property for tracking addon rechecks.

Batch Processor and Content Script Adjustments:

  • The batch processor's status bar updates are simplified to align with the new status bar API, and redundant parameters are removed from wait calls. [1] [2] [3]

Summary of Most Important Changes:

Status Bar Refactor and Chrome Action Integration

  • Refactored StatusBar to use Chrome action APIs (badge text, icon, title) for feedback, removing DOM manipulation and the ManualStatusBar.
  • Added dependency on core-service to the status bar package for access to the new ActionService. [1] [2]
  • Updated content scripts to enable/disable the status bar according to configuration state. [1] [2]

Chrome Action API and Messaging Improvements

  • Expanded ActionMessenger and ActionService to support per-tab action updates, enable/disable functionality, and badge text color. Introduced port-based messaging with PortService. [1] [2] [3]
  • Updated runtime messaging to support sender context and port-based communication, including new onConnect handling. [1] [2] [3]

Extension Manifest and Model

  • Enhanced extension manifest with multi-resolution icons and a default title for better browser integration.
  • Added __addonRecheck property to the IExtension model.

@Copilot Copilot AI review requested due to automatic review settings October 17, 2025 07:29
@dharmesh-hemaram dharmesh-hemaram moved this from New to In progress in Auto Clicker - AutoFill Oct 17, 2025
@nx-cloud
Copy link

nx-cloud bot commented Oct 17, 2025

View your CI Pipeline Execution ↗ for commit 29f8bd5

Command Status Duration Result
nx affected --target=typecheck --parallel=3 --v... ✅ Succeeded 24s View ↗
nx affected --target=test --parallel=3 --verbos... ✅ Succeeded 26s View ↗
nx affected --target=lint --parallel=3 --verbos... ✅ Succeeded 21s View ↗

☁️ Nx Cloud last updated this comment at 2025-10-17 08:50:18 UTC

Copy link
Contributor

@Copilot 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 refactors the status bar from a DOM-based UI to use the Chrome Action badge/title, and introduces a Port-based messaging path for action updates.

  • Replace DOM status bar with ActionService-driven badge/title updates.
  • Add PortService and background onConnect handling for one-way, low-latency messages.
  • Extend ActionMessenger and manifest to support per-tab action control and improved icon/title.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
packages/shared/status-bar/tsconfig.lib.json Adds reference to core/service to allow using ActionService in status-bar.
packages/shared/status-bar/tsconfig.json Adds project reference to core/service.
packages/shared/status-bar/src/lib/status-bar.ts Rewrites StatusBar to drive Chrome Action badge/title instead of DOM elements.
packages/shared/status-bar/src/index.ts Adds chrome types reference for TS consumers.
packages/core/service/src/lib/service.ts Introduces PortService for runtime.connect-based messaging.
packages/core/service/src/lib/action.service.ts Refactors ActionService to use PortService (fire-and-forget) and adds new methods.
packages/core/extension/src/lib/background/chrome/runtime.ts Adds runtime.onConnect routing for Port-based messages.
packages/core/extension/src/lib/background/chrome/messenger/action.messenger.ts Updates ActionMessenger to accept sender and support new methods.
packages/core/common/src/lib/model/core-model.ts Adds __addonRecheck field to extension model.
apps/acf-extension/src/manifest.json Expands action icon sizes and sets a default title.
apps/acf-extension/src/content_scripts/index.ts Disables status bar when no configs are present.
apps/acf-extension/src/content_scripts/config.ts Initializes status bar with totals; removes DOM status bar setup.
apps/acf-extension/src/content_scripts/batch.ts Aligns batch waits with new status bar API.
apps/acf-extension/src/background/index.ts Wires Runtime.onConnect to existing message handlers.

@codacy-production
Copy link

codacy-production bot commented Oct 17, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 94558c21 0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (94558c2) Report Missing Report Missing Report Missing
Head commit (29f8bd5) 1761 206 11.70%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#706) 86 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

@sonarqubecloud
Copy link

@dharmesh-hemaram dharmesh-hemaram merged commit 5f3aad4 into main Oct 17, 2025
9 checks passed
@dharmesh-hemaram dharmesh-hemaram deleted the status-bar-update branch October 17, 2025 08:59
@github-project-automation github-project-automation bot moved this from In progress to Done in Auto Clicker - AutoFill Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant