Conversation
…ndling fix: optimize DOM observation with debounce for email input detection chore: update version to 1.3.1 and use constant for toast duration
Performance: - Remove polling loop; MutationObserver handles detection - Fix ResizeObserver memory leak on SPA nav - Extract getActiveEmail() helper; remove 4x duplication - Add suggestion caching (invalidate on URL change) - Debounce MutationObserver (100ms) to reduce CPU thrashing Fixes: - Version 1.1.0 → 1.3.0 (match changelog) - Toast duration configurable via TOAST_DURATION - Context menu shows full email (user@domain.com) - Remove all 16 console statements Feature: - Add main account email to inline popup - Blue highlighted button at popup top - Hover preview + one-click select - Consistent with prev alias/suggestions UI Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Thank you for creating this pull request and helping make the project better. We will review / merge it when we are online. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughActive-email resolution is centralized across background flows, website suggestions are cached by page URL and email, and inline Gmail alias selection gains a main-account control. Failure paths are quieter, input detection uses debounced DOM observation, environment-specific access is configured, and settings/package versions are updated. ChangesRuntime and inline alias flow
Settings and release version
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ContextMenu
participant Background
participant SessionStorage
ContextMenu->>Background: refresh suggestions for pageUrl
Background->>SessionStorage: read contextMenuWebsiteCache
SessionStorage-->>Background: cached suggestions or cache miss
Background->>SessionStorage: store suggestions for pageUrl and activeEmail
Background-->>ContextMenu: create titled suggestion menu items
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| JavaScript | Jul 20, 2026 2:43p.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@entrypoints/content/index.ts`:
- Around line 713-715: Update the history-loading catch block around historyList
so storage failures render a distinct error/retry state instead of the
noResultsFound empty state. Keep noResultsFound exclusively for successful loads
with no history, and provide the user with a retry action or equivalent recovery
path.
- Around line 371-373: Update the disableInlineForCurrentSite error handling so
a rejected persistence operation is surfaced to the user through the existing
retryable UI error or toast mechanism instead of being silently ignored.
Preserve the current disable flow and connect the catch path to the appropriate
visible error feedback.
- Around line 1283-1285: Update the catch block in the icon initialization flow
to remove the partially initialized icon container and reset the input marker
state before swallowing the error. Use the existing container and marker symbols
assigned immediately before the catch, ensuring failed initialization cannot
remain detectable or trigger duplicate injection.
- Around line 133-135: The account lookup catch in the surrounding content
initialization flow must not continue with the default email after storage
failure. Update the catch to return an unavailable/error state or preserve only
a verified last-known account, ensuring the placeholder "your.email@gmail.com"
cannot reach alias persistence and avoiding silent continuation that masks the
failure.
- Around line 1235-1237: Preserve alias-save failures across both layers: in
entrypoints/content/index.ts lines 1235-1237, update the alias-save catch path
to propagate a stable failure result and display a retryable UI error; in
entrypoints/background.ts lines 358-359, return or report the persistence
failure instead of swallowing it as success. Use the existing alias-save
contract symbols and keep successful saves unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: c554e2ec-678d-4dbe-95b8-a10379d80dfa
📒 Files selected for processing (3)
entrypoints/background.tsentrypoints/content/index.tsentrypoints/popup/components/Settings.tsx
DeepSource JS-0356: 'error' defined but never used in catch handler. Remove parameter name since error is silently ignored. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@entrypoints/background.ts`:
- Around line 34-50: The getActiveEmail helper in entrypoints/background.ts
diverges from the shared account contract by ignoring the first email_accounts
entry and not normalizing the selected address. Reuse the resolver and
normalizer used by the shared account flow in entrypoints/content/index.ts,
preserving the configured account fallback and avoiding duplicated selection
logic.
- Around line 565-585: Update the contextMenuWebsiteCache shape and logic around
generateSuggestionsForWebsite to store activeEmail alongside url and
suggestions, and reuse cached suggestions only when both cached.activeEmail
matches activeEmail and cached.url matches info.pageUrl. Include activeEmail in
the storage.session.set cache entry.
In `@entrypoints/popup/components/Settings.tsx`:
- Line 673: Update the initial fallback value in the version state used by
Settings to match the current release version 1.3.1, including the corresponding
fallback at the additional referenced location, or reuse the shared
release-version source so manifest-access failures display the correct version.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 23141ecf-df07-4827-a562-de0beed0f6a6
📒 Files selected for processing (4)
entrypoints/background.tsentrypoints/content/index.tsentrypoints/popup/components/Settings.tsxpackage.json
🚧 Files skipped from review as they are similar to previous changes (1)
- entrypoints/content/index.ts
eplus-bot
left a comment
There was a problem hiding this comment.
Approved by @eplus-bot after all pull request checks passed.
CI run: https://github.com/ePlus-DEV/gmail-alias-toolkit/actions/runs/29715020518
|
Approved by @eplus-bot after all pull request checks passed. Approval refresh: #9 CI run: https://github.com/ePlus-DEV/gmail-alias-toolkit/actions/runs/29751786752 |
If account storage is inaccessible, return null from fetchSuggestions instead of silently continuing with placeholder 'your.email@gmail.com'. This prevents: - Aliases being saved under wrong account - Silent masking of storage failures - Suggestions generated with unverified email Impact: Better error isolation; popup won't show if account can't be verified. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
When disabling inline helper for current site fails, provide visual feedback instead of silently ignoring: - Disable button during operation - On success: close popup (current behavior) - On failure: show error state with: * Button remains enabled for retry * Reduced opacity indicates error * Tooltip updated with error message Impact: User aware of disable failures; can retry action. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
When saving alias to history/website map fails, provide visual feedback: - Check message response from background.ts for errors - Track save success/failure across all tasks - On failure: highlight input with error styling for 3 seconds - Add tooltip explaining that alias was filled but save failed - Add gmail-alias-input-error CSS class with red background/border Impact: User aware of persistence failures; can investigate storage issues. Background.ts already returns error responses on failure (no changes needed). Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
If icon injection fails after DOM append, remove partially initialized state to prevent duplicate injection attempts and orphaned elements: - Remove iconContainer from DOM - Reset input marker state (__gmailAliasIcon, __gmailAliasPosition, __gmailAliasCleanup) - Disconnect ResizeObserver if created - Remove event listeners added to window Impact: Failed injections no longer leave orphaned DOM or marker state. Prevents duplicate injection on retry. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@entrypoints/content/index.ts`:
- Around line 1354-1362: Move nullable cleanup references for iconContainer and
state outside the try block, then assign them during initialization. In the
catch block, guard iconContainer before removing it and state before
disconnecting the observer or removing listeners, while preserving the existing
input property cleanup.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6037911c-4ace-4992-a1db-fd668abf92a0
📒 Files selected for processing (2)
entrypoints/content/email-helper.cssentrypoints/content/index.ts
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 1 unresolved review comment. A stacked PR containing fixes has been created.
Time taken: |
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
eplus-bot
left a comment
There was a problem hiding this comment.
Approved by @eplus-bot after all pull request checks passed.
CI run: https://github.com/ePlus-DEV/gmail-alias-toolkit/actions/runs/29747890736
eplus-bot
left a comment
There was a problem hiding this comment.
Approved by @eplus-bot after all pull request checks passed.
CI run: https://github.com/ePlus-DEV/gmail-alias-toolkit/actions/runs/29748718448
Preview removedThe temporary website preview for this pull request has been removed. |
eplus-bot
left a comment
There was a problem hiding this comment.
Approved by @eplus-bot after all pull request checks passed.
CI run: https://github.com/ePlus-DEV/gmail-alias-toolkit/actions/runs/29751786752
|
Thanks for helping make Gmail Alias Toolkit better! |
Summary
Type of Change
Areas Touched
Testing
yarn compileyarn testyarn buildScreenshots or Recording
Notes for Reviewers
Summary by CodeRabbit