Repository navigation
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
|
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:
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Project selection and search global.wordpress.org/public_html/wp-content/mu-plugins/roles/js/rosetta-roles.js |
Models normalize selection IDs and synchronize project and sub-project state. Search filters by query tokens, ranks results, and prioritizes checked items when no search is active. |
Selection and search interface global.wordpress.org/public_html/wp-content/mu-plugins/roles/js/rosetta-roles.js, global.wordpress.org/public_html/wp-content/mu-plugins/roles/rosetta-roles.php, global.wordpress.org/public_html/wp-content/mu-plugins/roles/cross-locale-pte.php, global.wordpress.org/public_html/wp-content/mu-plugins/roles/views/edit-translation-editor.php, global.wordpress.org/public_html/wp-content/mu-plugins/roles/css/rosetta-roles.css, global.wordpress.org/public_html/wp-content/mu-plugins/roles/css/rosetta-roles-rtl.css |
Views synchronize checkbox and ARIA states, handle keyboard search, and render up to 100 sub-projects or a no-results item. Templates, localized settings, script dependencies, and styles support the interface. |
IndexedDB project-data caching global.wordpress.org/public_html/wp-content/mu-plugins/roles/js/rosetta-roles.js |
Project loading checks IndexedDB and compression support. It reads timestamped gzip data and uses remote data when cache loading fails. Database recovery and cache writes are included. |
Access-list initialization and submission global.wordpress.org/public_html/wp-content/mu-plugins/roles/js/rosetta-roles.js, global.wordpress.org/public_html/wp-content/mu-plugins/roles/cross-locale-pte.php, global.wordpress.org/public_html/wp-content/mu-plugins/roles/rosetta-roles.php, global.wordpress.org/public_html/wp-content/mu-plugins/roles/views/edit-translation-editor.php |
Initialization normalizes access IDs and gives the global selection precedence when present. Submission synchronizes the field and can confirm removal when an existing translator selection becomes empty. |
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant ProjectLoader
participant IndexedDB
participant RemoteSource
ProjectLoader->>IndexedDB: Read timestamped gzip data
IndexedDB-->>ProjectLoader: Return cached projects or retrieval failure
ProjectLoader->>RemoteSource: Load projects after cache failure
RemoteSource-->>ProjectLoader: Return project data
ProjectLoader->>IndexedDB: Store compressed project data
Possibly related PRs
- WordPress/wordpress.org#1110: Adds no-results styling and updates the stylesheet version, which overlap with this PR’s search-result presentation changes.
- WordPress/wordpress.org#1111: Normalizes
lastUpdatedin PHP settings, which this PR also uses for cache timestamp validation.
Merge Risk: 
Minimal · up to a0e21
-
Saved selections activate correctly, category selection can be undone, and blocked cache access falls back to remote data. No merge-blocking issue remains identified.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title accurately identifies the main changes: fixing selection synchronization, addressing memory leaks, and modernizing project caching. It is concise and specific enough for the pull request changes.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
|
I asked Gemini for some numbers: estimate based on ~2000 subprojects: 1. CPU & Main-Thread Execution Time
2. Memory & Garbage Collection (RAM)
3. Rendering Pipeline & Frame Budget
4. Storage & Payload Size
5. Scalability & 60 FPS Capacity Limits
6. The 80/20 Architectural Sweet SpotWhile extreme optimizations—such as multi-threaded Web Workers, inverted index libraries, or virtual list windowing—are theoretically possible, implementing them would double or triple codebase complexity, mandate external build pipelines, and introduce accessibility hurdles for screen readers. By resolving every critical architectural bottleneck (memory leaks, synchronous thread freezes, storage quota overflows, and DOM thrashing) within roughly 500 lines of standard ES6 and Backbone, the refactored code captures over 90% of all potential performance gains while remaining lightweight, transparent, and easy to maintain for WordPress contributors. 7. Codebase Footprint & Maintainability
|
Refactors the Rosetta project role selector to modern ES6+ and native DOM APIs, eliminating jQuery/localStorage bottlenecks in favor of atomic IndexedDB caching and tokenized search.
Key Improvements
view.remove()), accelerates search to 1.5–2.5 ms, and batches DOM rendering into a single reflow (DocumentFragment, stable 60 FPS).localStoragewith binary Gzip IndexedDB streams (CompressionStream, singlepayloadrecord) and automated schema recovery.string_score.js(-1 HTTP request) in favor of native inline token matching (getMatchScore).$windowhandlers with an internal Backbone event bus and encapsulates the#project-alltoggle.Key Bug Fixes
normalizeId) and ensures category selection operates on all items (getAllModels(),_subProjectIds) rather than active search filters._isUncheckingAll) and flushes debounced selections synchronously on form submit.Assisted by Gemini 3.8 Flash
Summary by CodeRabbit
Summary