Admin reimagine (1/2): tabbed Settings, Tools merged in, global Rules - #10
Conversation
…header - Global rules: per-post-type field->meta rules in Settings → Rules, applied to ALL posts of the type from their own meta; GlobalRulesRefresher runs daily and on save. Complements per-source scrape rules. - Activity page header wrapped in .ai-head to match the other pages.
|
Warning Review limit reached
Next review available in: 46 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds a global rules engine: new ChangesGlobal Rules Feature and Settings Tabs Refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/Admin/Admin.php`:
- Around line 776-779: The Rules tab flow is accepting a stale or unknown
`rtype` and later persisting it, which can point edits at the wrong config entry
and leave `GlobalRulesRefresher` iterating an orphaned type. Tighten the
validation around the `Admin` save/render path so any `rtype` not present in
`$public_types` is rejected or remapped before use, not just empty values; make
the fallback in the `rtype` selection logic and the save handling at the later
validation block use the same allowed-type check.
In `@src/Maintenance/GlobalRulesRefresher.php`:
- Around line 60-64: Preserve per-source overrides in
GlobalRulesRefresher::refresh by not blindly writing every Rules::apply result
to all posts. Update the loop around values_for(), Rules::apply(), and
update_post_meta() to detect keys/posts owned by scrape-source-specific rules
and skip or respect those entries before saving. Add a clear ownership check or
exclusion path so global refresh only updates meta that is not governed by
per-source overrides.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f2fdb260-d65f-4a9a-9875-c3fba17f480e
📒 Files selected for processing (9)
assets/css/admin.csssrc/Admin/Admin.phpsrc/Admin/views/activity.phpsrc/Admin/views/settings-rules.phpsrc/Admin/views/settings.phpsrc/Admin/views/tools.phpsrc/Maintenance/GlobalRulesRefresher.phpsrc/Plugin.phpsrc/Settings.php
💤 Files with no reviewable changes (2)
- src/Admin/views/tools.php
- src/Admin/views/settings.php
…espects per-source rule overrides
|
Both addressed in
|
First pass of the admin reimagining you asked for.
Settings is now tabbed — General · Rules · Tools
Global Rules (the "Both" you chose)
event_status/expire_eventon your existing Events too.GlobalRulesRefresherapplies them daily and shortly after you save; cron unscheduled on deactivate.Consistency
.ai-headpattern the other pages use.Tests
Full suite 86 green, lint clean.
Still to come (next PR)
Broader visual-consistency pass + simplifying/merging the remaining pages (e.g. Activity into Dashboard), per "every page should align."
Summary by CodeRabbit
New Features
Bug Fixes