fix: correct category-reset domain scoping regression from #127 - #128
Conversation
Pulls in codeslash-dev/SLASHED#468 (205f9ab): the per-category reset button merged in #127 scoped its overrides by raw substring matching against the active domain's own pattern list, which over-matches since DOMAIN_PATTERNS substrings overlap across domains (e.g. layout's "-bg-" also appears in color tokens like --sf-color-bg--active). Resetting Layout could silently wipe out unrelated Colors overrides. Now scoped via domainOf(k) === domain, the same classifier already used for the sidebar override badges. Rebuilt assets/admin-app/app.js to match.
|
Warning Review limit reached
Next review available in: 15 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: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ 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 |
PR Summary by QodoFix category reset to use domainOf() scoping (avoid cross-domain override deletes)
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
Context used✅ Compliance rules (platform):
1 rule 1. Vendored App.svelte modified
|
domainOverridesInTokenTab still filtered by raw DOMAIN_PATTERNS substring matching after 205f9ab switched the "Reset N" count to domainOf(k) === domain, so the two could disagree for overlapping tokens (e.g. --sf-color-bg--active matches layout's "-bg-" pattern but domainOf() resolves it to colors). Use the same domainOf() predicate here so both counts always agree. (caught by automated review on codeslash-dev/SLASHED-Plugins#128)
Pulls in codeslash-dev/SLASHED#468 (ccdcbe0): DomainPanel.svelte's domainOverridesInTokenTab badge still filtered by raw DOMAIN_PATTERNS substring matching after the "Reset N" count switched to domainOf(k) === domain, so the two counts could disagree for overlapping tokens (e.g. --sf-color-bg--active). Now both use the same domainOf() predicate. Rebuilt assets/admin-app/app.js to match. (caught by automated review on #128)
|
Re Qodo's two findings:
Generated by Claude Code |
…ework Pulls in codeslash-dev/SLASHED#468 (081e9d8): domainOverridesCount and handleResetDomain each recomputed the same domainOf() filter independently; extracted the shared domainOverrideKeys derived so both stay in sync. Rebuilt assets/admin-app/app.js to match. (nitpick from automated review on #128)
Summary
domainPatterns.some(p => k.includes(p))), which over-matches becauseDOMAIN_PATTERNSsubstrings overlap across domains — e.g. layout's"-bg-"pattern also matches color tokens like--sf-color-bg--active. Resetting the Layout category could silently delete unrelated Colors overrides.codeslash-dev/SLASHED#468(caught by automated review there) by scoping viadomainOf(k) === domaininstead — the same classifier already used for the sidebar's per-domain override badges, so the reset button only ever touches keys that actually belong to the active category.admin-app/src/App.sveltefrom the framework and rebuiltassets/admin-app/app.jsto match.Type
Checklist
feat:,fix:,docs:, …)npm test— not run in this session (npm run verifywas run and passes)npm run verifypasses (version metadata in sync)assets/admin-app/app.jsregenerated vianpm run build:admin-app)CHANGELOG.mdupdated under## [Unreleased]assets/admin-app/app.js)Notes
Only
admin-app/src/App.sveltechanged on the source side (vendored from the framework, not hand-edited here) — no plugin-specific files needed changes for this fix.Generated by Claude Code