Open Bug 1926053 Opened 2 years ago Updated 1 month ago

Add tests for opening context menus from the tabs in the new sidebar panels

Categories

(Firefox :: Sidebar, task, P3)

task

Tracking

()

ASSIGNED

People

(Reporter: kcochrane, Assigned: smag.vav, Mentored)

References

Details

(Keywords: good-first-bug, Whiteboard: [fidefe-sidebar][outreachy-sidebar-2026])

Attachments

(1 file, 1 external file, 1 obsolete file)

Adding this as a follow-up to bug 1924126. It seems that simulating Shift+F10 in a test wasn't triggering the context menu for some reason. We should investigate why that is and add tests for this at a later time.

Whiteboard: [fidefe-sidebar]
Depends on: 1924126
Severity: -- → N/A
Priority: -- → P3

Hii, can I claim this

Flags: needinfo?(kcochrane)
Assignee: nobody → ndukaprincek
Mentor: kcochrane
Status: NEW → ASSIGNED
Flags: needinfo?(kcochrane)
Keywords: good-first-bug
Whiteboard: [fidefe-sidebar] → [fidefe-sidebar][outreachy-sidebar-2026]

Hi, I left a comment on Phab a while ago, could you please check it?

Flags: needinfo?(kcochrane)
Mentor: kcochrane → nsharpley
Flags: needinfo?(kcochrane)
Attachment #9569587 - Attachment is obsolete: true

This good-first-bug hasn't had any activity for 2 months, it is automatically unassigned.
For more information, please visit BugBot documentation.

Assignee: ndukaprincek → nobody
Status: ASSIGNED → NEW

Hi! I’m an Outreachy applicant for the Dec 2026 - Mar 2027 round.

I’d like to work on this mentored bug.
Could the mentor please point me to the existing sidebar context menu code and where to add the new tests?

Thanks!

Attached file Code of the new test —

I added a new test test_keyboard_context_menu to verify opening the sidebar context menu via Shift+F10.
The test includes an explicit focusability check, which passes:

PASS test_keyboard_context_menu - sidebarMain has focus after explicit focus()
PASS test_keyboard_context_menu - sidebarMain is actually focusable in test environment

So in the automated test environment sidebarMain can be focused programmatically.
However, after simulating EventUtils.synthesizeKey("KEY_F10", { shiftKey: true }), the sidebar-contextmenu-ready event never arrives, and the test times out:

FAIL test_keyboard_context_menu - Test timed out
When testing manually in Firefox, the sidebar itself cannot be focused (only buttons inside it can be focused). Pressing Shift+F10 opens the page context menu, not the sidebar menu.

It’s possible that I am not calling the event correctly — if so, please correct me. Otherwise, this looks like a limitation or bug in Firefox code: the sidebar is not a focusable element for keyboard context menus.

Flags: needinfo?(nsharpley)

Hi Ivan, thanks for working on this and apologies for the delay. Here are some steps to get your code in review so I can provide feedback:

  1. Download and build the Firefox source code
  2. Start working on this bug - you've already done this part!
    • If you have any problems with this bug,
      please comment on this bug and set the needinfo flag for me.
      Also, you can find me and my teammates on the #sidebar channel on
      Element/Matrix
      Monday to Friday.
  3. Build your change with mach build and test your change with
    mach test toolkit/components/telemetry/tests/.
    Also check your changes for adherence to our style guidelines by using mach lint
  4. Submit the patch for review using Phabricator.
    Mark me as a reviewer (nsharpley) so I'll get an email to come look at your code.
  5. After a series of reviews and changes to your patch,
    I'll mark it for checkin or push it to autoland.
    Your code will soon be shipping to Firefox users worldwide!
Flags: needinfo?(nsharpley)

Added test_keyboard_context_menu to browser_sidebar_context_menu.js to verify
that the sidebar context menu can be opened with Shift+F10.

The test currently fails with a timeout because the 'sidebar-contextmenu-ready'
event never fires after EventUtils.synthesizeKey(F10, { shiftKey: true }).
Manual verification confirms that the sidebar itself cannot be focused and
Shift+F10 opens the page context menu instead of the sidebar menu.

This is submitted for review to determine whether sidebar-main.mjs should be
modified to add keyboard support (similar to the fix in bug 1924126 for
sidebar-tab-row), or whether the test should be adjusted.

Assignee: nobody → smag.vav
Status: NEW → ASSIGNED
Summary: Add tests for opening context menus in the new sidebar → Add tests for opening context menus from the tabs in the new sidebar panels

This bug was filed as a follow up to https://bugzilla.mozilla.org/show_bug.cgi?id=1924126 which adds the shift + F10 keyboard shortcut to open the context menu on a tab in the sidebar panel. If you open the history panel, for example, then tab/arrow to reach a tab and press shift + F10 it opens the context menu. This is what this bug is intending to test.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: