You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.
The Trac JavaScript updates ticket text handling, form interactions, participant and workflow controls, notifications, and GitHub pull-request reporting. It replaces many jQuery operations with native DOM APIs and updates shared utilities.
Changes: Trac Interface and Workflow Updates
Layer / File(s)
Summary
Text processing and shared utilities wordpress.org/public_html/style/trac/wp-trac.js
Shared initialization, current-user access, escaping, mention matching, link generation, and attachment previews use updated utility and DOM handling.
Ticket forms and page interactions wordpress.org/public_html/style/trac/wp-trac.js
Ticket editing, form notices, validation, navigation, toolbar actions, tracker selection, and report-popup loading use native DOM APIs and updated guards.
Participants and workflow controls wordpress.org/public_html/style/trac/wp-trac.js
Participant filtering, keyword editing, and contributor-focus controls use native DOM traversal and listeners. Keyword state uses arrays, and keyword additions reject empty or duplicate values.
Notifications and report subscriptions wordpress.org/public_html/style/trac/wp-trac.js
Notification and report subscription controls use native events and fetch. Request failures and local subscription state updates are handled in the interface.
GitHub reporting and component suggestions wordpress.org/public_html/style/trac/wp-trac.js
GitHub pull-request loading uses fetch with failure and retry handling. Component suggestions and review labels use native DOM operations and guarded element access.
Copying a long ticket draft can disable the warning before leaving the original page. Fix that narrow draft-loss risk before merging, or accept it explicitly.
### Architecture Summary
Architecture risk:🟡 Medium · up to f2b03
The change affects 1 system.
Changed systems:wordpress.org
Architecture concerns
No architecture-level concerns identified.
Review details
Systems and components
observed — wordpress.org (service) was modified; 1 changed file maps to changed impact.
Before / after behavior
observed — Modified behavior in wordpress.org/public_html/style/trac/wp-trac.js: Removed the wpTracCurrentUser globals declaration.
observed — Modified behavior in wordpress.org/public_html/style/trac/wp-trac.js: escapeHtml now converts non-string values to strings, treating nullish values as empty, then escapes ampersands, angle brackets, quotes, and apostrophes.
observed — Modified behavior in wordpress.org/public_html/style/trac/wp-trac.js: linkTextNodes now returns for non-global or non-RegExp inputs and uses the tree walker filter to reject text inside links and skip blank text nodes; the old post-walk link check is removed.
observed — Modified behavior in wordpress.org/public_html/style/trac/wp-trac.js: wpTrac.currentUser now reads window.wpTracCurrentUser and defaults to null, rather than directly using the undeclared global.
Reliability and maintainability
inferred — Risk-relevant change factors for wordpress.org: blast_radius_1; direct_dependents_1
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 24.39% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 41 functions across 1 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title identifies the main change: substantial rework of the Trac JavaScript implementation. It is concise and related to the full rewrite and bug fixes.
Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
Create a new PR
Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Autopilot is currently an internal CodeRabbit preview.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Many bug fixes. Full rewrite in Vanilla JS and backwards compatible with jQuery. Some jQuery checks might be useless.
Improvements:
Performance:
mentionsRegExandgutenbergIssueRegExonce at module scope to avoid re-compilation on every run.startsWith()instead of dynamicRegExpin autocomplete filters for faster substring matching.DocumentFragmentinlinkTextNodes()and keyword workflow methods to reduce reflows.capital_P_dangit()into a single regular expression.escapeHtml()using direct string entity replacements instead of temporary DOM node creation.Error handling & network:
res.ok) tofetch()calls in reports and GitHub PR modules.finallyblock on network completion or failure.Bug fixes:
CSS.escape()for keyword selector queries.Assisted by Gemini 4 and 3.8 Flash
Summary by CodeRabbit