Ask 1Password to skip merge request pages
What does this MR do and why?
On merge request pages, the 1Password browser extension can freeze the Changes tab for several seconds on large merge requests. The extension's content script watches the whole page and walks every subtree that gets added to it. Because streaming adds thousands of diff nodes one at a time, the extension ends up re-walking the same content once for every ancestor level it appears under. On a merge request with 301 files, this blocked the main thread in Firefox for about 9.5 seconds total, including a single freeze of about 5 seconds. On a merge request with 1,000 files, the total blocked time was about 23 seconds, with one freeze lasting about 14.5 seconds.
1Password supports one page-level opt-out: when the page body carries the data-1p-ignore attribute, the extension skips registering its field, form, and sign-in-button detection on that page. This MR adds that attribute to the merge request page template, covering every tab of the merge request page and every diff view. There are no credential fields on a merge request page, so 1Password users lose no functionality. The change does not touch how diffs are streamed and is intentionally the smallest possible fix. The attribute only has an effect on the page body: placing it on a narrower container, such as the diffs pane or the streaming root, was tested and made no measurable difference, because the extension only checks for it on the body and on individual form fields.
This is a stopgap, not a full fix. About 2 seconds of extension overhead remain on the 301-file case, because 1Password's element watcher keeps observing and walking the streamed content even once nothing is subscribed to detect fields on it. Removing that remaining cost for every observer, not just 1Password, requires a structural change to how streaming inserts content, tracked in the follow-up MR linked below.
References
Screenshots or screen recordings
No UI change. The numbers below were measured on the real Changes tab of a local instance, using Firefox 152 with the 1Password extension, headless at 1440x900. "Blocked" is total main-thread time spent in frames longer than 50 ms while streaming; "longest" is the longest single freeze; n is the number of runs per case.
| Merge request | Path | n | Blocked before | Blocked after | Longest before | Longest after | Wall before | Wall after |
|---|---|---|---|---|---|---|---|---|
| 301 files | Overview then Changes | 4 | 9,276 ms | 3,103 ms | 4,833 ms | 742 ms | 15.3 s | 8.3 s |
| 301 files | Direct /diffs load | 3 | 9,573 ms | 3,399 ms | 4,731 ms | 663 ms | 16.0 s | 10.2 s |
| 1,000 files | Overview then Changes | 2 | 23,423 ms | 8,822 ms | 14,504 ms | 2,806 ms | 28.7 s | 15.1 s |
| 301 files, attribute on diffs container instead of body | Overview then Changes | 4 | 9,276 ms | 9,363 ms | 4,833 ms | 4,883 ms | 15.3 s | 14.5 s |
| Reference: same pages without 1Password | Overview then Changes | 2 | 1,182 ms (301 files), 4,678 ms (1,000 files) | 306 ms, 1,339 ms | 7.5 s, 12.8 s |
Progressive rendering also improves. On the 301-file merge request, the number of files visible 1/2/3/4 seconds after switching to the Changes tab went from 0/21/29/29 before this change (rendering stalled at 29 files until around the 5 second mark) to 0/38/128/291 after it. Without the extension present at all, the same points are 0/47/166/301. On the 1,000-file merge request, rendering stayed stuck at 27 files from the 3 second mark to the 6 second mark before this change, and streams continuously after it.
How to set up and validate locally
- Install the 1Password browser extension in Firefox.
- Open a merge request with a few hundred changed files, then switch to the Changes tab. Before this change, the page freezes for several seconds while files stream in.
- With this change, the page body carries
data-1p-ignoreon every merge request tab, and streaming stays responsive. - Confirm the attribute is not present on other pages, for example the project overview page.
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.