Draft: Read sidebar assignees from the store in autocomplete
What does this MR do and why?
@ autocomplete filters its member list by the current assignees and reviewers:
/assign @hides the current assignees, and/unassign @lists only them./assign_reviewer @and/unassign_reviewer @do the same for reviewers.
On pages with the legacy issuable sidebar, it reads the assignees from SidebarMediator.singleton.store:
gfm_auto_complete.jsreadsstore.assignees.content_editor.vuepasses the mediator toautocomplete_helper.js, which readsstore.assigneesandstore.reviewers.
Both only need the store. This MR makes them read SidebarStore.singleton directly, and passes the store to the content editor as sidebarStore.
Why
The Vue 3 loader builds a module twice when Vue 2 and Vue 3 code both reach it. Each copy then has its own static singleton field.
sidebar_mediator.jsreaches Vue, so it gets two copies. When the MR page runs on Vue 3, the page sets the field on the Vue 3 copy, and a Vue 2gfm_auto_completereads its own copy, which is stillnull. Then/unassign @lists nobody, and/assign @offers the current assignees again, with no error.sidebar_store.jsimports no Vue, so the loader builds it once, and its ownsingletonfield is shared.
After this MR, only the page code that mounts the sidebar imports sidebar_mediator.js: sidebar_bundle.js, on the MR page and the incident page.
SidebarStore.singleton is the same object as SidebarMediator.singleton.store, because the mediator creates the store with new Store(options), and that returns the singleton. So the behaviour does not change.
Context
This came up in the review of !262801 (merged), which shares page-wide state between Vue 2 and Vue 3 copies. That MR keeps SidebarMediator.singleton shared through pageSingleton. With this MR, autocomplete no longer needs it. When both MRs are merged, the mediator and service can go back to their code on master.
This MR does not depend on !262801 (merged), and targets master.
How to set up and validate locally
- Open a merge request with assignees.
- In a comment, type
/unassign @. Only the current assignees are listed. - In a comment, type
/assign @. The current assignees are not listed. - Switch the comment to the rich text editor, and repeat both steps.
Local checks run, on Vue 2 and with VUE_VERSION=3: 228 suites passed in each lane.
spec/frontend/content_editorspec/frontend/gfm_auto_complete_spec.js,ee/spec/frontend/gfm_auto_complete_spec.jsspec/frontend/sidebar
Screenshots
/unassign @ in a comment on the MR page lists only the current assignee, before and after this MR:
Before (56681b5d) |
After (2a075a02) |
|---|---|
![]() |
![]() |
How the screenshots were taken
- I ran a temporary feature spec in GDK. It is not committed.
- Before: the merge-base
56681b5d. After: the MR head2a075a02. - The MR has one assignee,
ada_assignee. The project has another member,otto_other. - User path:
- Open the MR.
- In the comment box, type
/unassign @.
- The spec also checks that
otto_otheris not listed. It passed on both commits. - Full page, light mode.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
References
- Found in the review of !262801 (merged), which shares page-wide state between Vue 2 and Vue 3 copies
- Part of #623999 — Vue 3 migration of global bundles and
main

