Skip to content

Conversation

@noisysocks
Copy link
Contributor

@noisysocks noisysocks commented Aug 12, 2025

Asana Task/Github Issue: https://app.asana.com/1/137249556945/project/1209121419454298/task/1211025931603094?focus=true

Description

Fixed context menu including fake widgets that caused issues with native app integration. The Duck.ai toggle feature registers a fake widget with ID _omnibar-toggleAi, but useContextMenu() was only filtering out the debug widget, so fake widgets were being passed to the native app via contextMenu notifications.

Changes:

  • Updated useContextMenu() to filter out widgets with IDs starting with _ instead of just filtering debug
  • Renamed debug widget ID from debug to _debug for consistency
  • Added integration test to verify only real widgets appear in context menu

Testing Steps

Checklist

Please tick all that apply:

  • I have tested this change locally
  • I have tested this change locally in all supported browsers
  • This change will be visible to users
  • I have added automated tests that cover this change
  • I have ensured the change is gated by config
  • This change was covered by a ship review
  • This change was covered by a tech design
  • Any dependent config has been merged

The context menu was including fake widgets (like _omnibar-toggleAi for Duck.ai toggle)
which caused issues with native app integration. This change:

- Updates useContextMenu() to filter out all widgets with IDs starting with '_'
- Renames debug widget ID from 'debug' to '_debug' for consistency
- Adds integration test to verify only real widgets appear in context menu

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@noisysocks noisysocks requested review from a team, mgurgel and shakyShane as code owners August 12, 2025 01:17
@netlify
Copy link

netlify bot commented Aug 12, 2025

Deploy Preview for content-scope-scripts ready!

Name Link
🔨 Latest commit 5009e5d
🔍 Latest deploy log https://app.netlify.com/projects/content-scope-scripts/deploys/689a961a8fa0b6000835fbba
😎 Deploy Preview https://deploy-preview-1888--content-scope-scripts.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

Temporary Branch Update

The temporary branch has been updated with the latest changes. Below are the details:

Please use the above install command to update to the latest version.

@github-actions
Copy link

[Beta] Generated file diff

Time updated: Tue, 12 Aug 2025 01:18:03 GMT

Apple
    - apple/pages/new-tab/dist/index.js

File has changed

Integration
    - integration/pages/new-tab/dist/index.js

File has changed

Windows
    - windows/pages/new-tab/dist/index.js

File has changed

@noisysocks noisysocks changed the title Fix context menu by filtering fake widgets starting with underscore NTP: Fix context menu by filtering fake widgets starting with underscore Aug 12, 2025
@noisysocks
Copy link
Contributor Author

noisysocks commented Aug 12, 2025

Tested in macOS and reviewed code, lgtm 👍

@noisysocks noisysocks added the bug Something isn't working label Aug 12, 2025
@noisysocks noisysocks added this pull request to the merge queue Aug 12, 2025
Merged via the queue into main with commit 10cb102 Aug 12, 2025
23 checks passed
@noisysocks noisysocks deleted the randerson/fix-context-menu-fake-widgets branch August 12, 2025 06:16
jonathanKingston pushed a commit that referenced this pull request Aug 18, 2025
…1888)

The context menu was including fake widgets (like _omnibar-toggleAi for Duck.ai toggle)
which caused issues with native app integration. This change:

- Updates useContextMenu() to filter out all widgets with IDs starting with '_'
- Renames debug widget ID from 'debug' to '_debug' for consistency
- Adds integration test to verify only real widgets appear in context menu

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
github-merge-queue bot pushed a commit that referenced this pull request Aug 22, 2025
* Initial Android adsjs bundle

* Rename output script to something more sensible

* Add inject name

* lint fix

* PoC messaging adsjs

* Removal of ports argument

* Change up wrapping

* Fix up typing

* Enable share on iframes and fix support issues

* Revert "Enable share on iframes and fix support issues"

This reverts commit 51f7413.

* Inject name conditional (#1884)

* Add enum devices debugging

* Disable device enumeration remotely

* Fix lint

* Add frame flexibility

* Move to webCompat

* Conditional frame matching

* Test case

* Frame test changes, still not working

* Fix up frame testing

* Simplify test checks

* Remove bundle for debugging

* Add injectName conditional matching

* Improve comment

* build(deps): bump immutable-json-patch from 6.0.1 to 6.0.2 (#1873)

* build(deps): bump immutable-json-patch from 6.0.1 to 6.0.2

Bumps [immutable-json-patch](https://github.com/josdejong/immutable-json-patch) from 6.0.1 to 6.0.2.
- [Changelog](https://github.com/josdejong/immutable-json-patch/blob/main/CHANGELOG.md)
- [Commits](https://github.com/josdejong/immutable-json-patch/commits)

---
updated-dependencies:
- dependency-name: immutable-json-patch
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix replace state tests

* Add failure case if the library behaviour is now reverted

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Kingston <jkingston@duckduckgo.com>

* build(deps-dev): bump eslint from 9.32.0 to 9.33.0 in the eslint group (#1886)

Bumps the eslint group with 1 update: [eslint](https://github.com/eslint/eslint).


Updates `eslint` from 9.32.0 to 9.33.0
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](eslint/eslint@v9.32.0...v9.33.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-version: 9.33.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: eslint
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump @rive-app/canvas-single from 2.30.4 to 2.31.1 (#1885)

Bumps [@rive-app/canvas-single](https://github.com/rive-app/rive-wasm) from 2.30.4 to 2.31.1.
- [Changelog](https://github.com/rive-app/rive-wasm/blob/master/CHANGELOG.md)
- [Commits](rive-app/rive-wasm@2.30.4...2.31.1)

---
updated-dependencies:
- dependency-name: "@rive-app/canvas-single"
  dependency-version: 2.31.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix context menu by filtering fake widgets starting with underscore (#1888)

The context menu was including fake widgets (like _omnibar-toggleAi for Duck.ai toggle)
which caused issues with native app integration. This change:

- Updates useContextMenu() to filter out all widgets with IDs starting with '_'
- Renames debug widget ID from 'debug' to '_debug' for consistency
- Adds integration test to verify only real widgets appear in context menu

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>

* NTP: Omnibar design fixes i2 (#1889)

* Remove focusRing state and update popup focus styles:

- Show rest state by defualt
- Show focus state only when input/textarea is selected and empty
- Show suggestions state only when suggestions list is open

* Make close button clear input and hide suggestions in one click

* Adjust padding around X button in SearchForm

* Refocus input after clearing search term

* Fix spacer height to accommodate largest tab without animation

* Use --ntp-surface-tertiary (with correct value from Figma) when using
default background and --ntp-surface-background-color when using a
custom background

* Use dark mode icons in TabSwitcher

* Adjust omnibar and tab switcher background when using a custom
background

* Update ntp-controls-raised-backdrop color variables

* Update SearchColorIcon and AiChatColorIcon SVG gradients and colors

* feat: Add Duck.ai icon for RMF, update a couple other RMF icons (#1892)

* feat: Add Duck.ai icon for RMF, update a couple other icons

* fix: example

* rm: overflow2 example

* Replace newlines with spaces when switching from Duck.ai to Search tab. (#1894)

This matches how SERP behaves

* NTP: Refine omnibar background, outline, and elevation styles (#1893)

* Refine popup background, outline, and elevation styles

* Update CloseSmallIcon

* Fix lint warnings (#1890)

* Refactor variable names and improve type safety in customizer and build scripts

Co-authored-by: randerson <randerson@duckduckgo.com>

* Don't typecast to any

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* Force search mode when Duck.ai is disabled in Omnibar (#1895)

* build(deps): bump @rive-app/canvas-single from 2.31.1 to 2.31.2 (#1902)

Bumps [@rive-app/canvas-single](https://github.com/rive-app/rive-wasm) from 2.31.1 to 2.31.2.
- [Changelog](https://github.com/rive-app/rive-wasm/blob/master/CHANGELOG.md)
- [Commits](rive-app/rive-wasm@2.31.1...2.31.2)

---
updated-dependencies:
- dependency-name: "@rive-app/canvas-single"
  dependency-version: 2.31.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump esbuild from 0.25.8 to 0.25.9 (#1903)

Bumps [esbuild](https://github.com/evanw/esbuild) from 0.25.8 to 0.25.9.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG.md)
- [Commits](evanw/esbuild@v0.25.8...v0.25.9)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-version: 0.25.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump actions/checkout from 4 to 5 (#1901)

Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add initial ping message

* Fix tests

* Remove frame limitation

* Add breakageReporting to bundle

* Add apiManipulation to the new bundle

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Cris Barreiro <cbarreiro@duckduckgo.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Robert Anderson <randerson@duckduckgo.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Valerie Kraucunas <vkraucunas@duckduckgo.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants