fix(cl2k): make the Poster Healer's scope and review queue reachable - #471
Merged
Conversation
The coverage strip landed on the Review page, but the question it answers — "which drives is this tool assessing for id mismatch?" — belongs where the module is configured. Add it as a read-only field at the top of Settings → Modules → Poster Healer. Reuses the existing /api/poster-self-heal/coverage endpoint, so it reports the heal's real scope rather than re-deriving it from config: a location claiming no types saves nothing but is still assessed, and Drives show the types that actually resolve to them. The field type is registered from the extension's own manifest at module scope, matching how cl2k registers its Save Locations fields. The registration test asserts IDENTITY, not truthiness: FieldRegistry.getField() returns an UnknownFieldType placeholder for an unregistered type, and scripts/check-field-types.js only scans the three core schema files — so a typo'd `type:` passes lint and renders a blank settings row. Verified by typo'ing the schema and watching the test go red.
…the layout The page had NO sidebar entry — its only route in was a badge on the CL2K Maker page that renders when the open count is non-zero. So a run reporting work "left for manual review" pointed at a page with no way to reach it, and when the count was zero even the badge disappeared. Add it under Poster, like CL2K Maker. Also split the page: what the healer looks at on the left, what needs action on the right, instead of stacking the coverage strip above the queue.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a live Poster Self-Heal coverage field, integrates it into the settings schema, and displays it in the Poster Healer review page with updated navigation and layout. ChangesPoster self-heal coverage
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PosterHealReviewPage
participant PosterSelfHealCoverageField
participant posterSelfHealAPI
participant apiCore
PosterHealReviewPage->>PosterSelfHealCoverageField: render assessed locations
PosterSelfHealCoverageField->>posterSelfHealAPI: request coverage with AbortSignal
posterSelfHealAPI->>apiCore: fetch coverage with caching disabled
apiCore-->>posterSelfHealAPI: return coverage or error
posterSelfHealAPI-->>PosterSelfHealCoverageField: update coverage state
PosterSelfHealCoverageField-->>PosterHealReviewPage: render coverage panel
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 `@frontend/src/extensions/poster_self_heal/CoverageField.test.jsx`:
- Around line 100-110: Update the AbortSignal test around
PosterSelfHealCoverageField to inspect the latest mockAPI.coverage invocation
rather than the first, or clear mockAPI.coverage before the test; ensure the
signal is asserted non-aborted before unmount and aborted afterward.
In `@frontend/src/utils/api/posterSelfHeal.js`:
- Around line 7-9: Update the coverage method in the poster self-heal API so
options are spread before the mandatory useCache: false setting. Ensure
caller-provided options remain supported while preventing them from overriding
cache bypass.
🪄 Autofix
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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8e1c9684-91db-4c40-b17c-ad5180267251
📒 Files selected for processing (6)
frontend/src/extensions/poster_self_heal/CoverageField.jsxfrontend/src/extensions/poster_self_heal/CoverageField.test.jsxfrontend/src/extensions/poster_self_heal/manifest.jsxfrontend/src/extensions/poster_self_heal/settings_schema.jsfrontend/src/pages/poster/PosterHealReviewPage.jsxfrontend/src/utils/api/posterSelfHeal.js
coverage() spread caller options AFTER useCache: false, so a caller could pass useCache: true and cache live config state — serving a stale picture of what the healer is about to assess. Spread options first; useCache last. Adds posterSelfHeal.test.js covering option forwarding, the mandatory bypass, and the no-argument call. The bypass test was verified red against the old order. Also read the LAST coverage() call in the AbortSignal test rather than the first. Correct either way today — restoreMocks clears mock state between tests, verified with a probe — but this no longer depends on that setting staying enabled.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Three related visibility fixes for the Poster Healer, the middle one being an outright bug.
Related issue
N/A — found while chasing a run that reported items for review with nothing reachable to review.
Type of change
Testing
npm run lint,npx prettier --check "src/**/*.{js,jsx,css,json,md}"(whole tree),npx stylelint "src/**/*.css",npm run build→ all exit 0npx vitest run→ 46 passed (8 new)ruff check .→ exit 0New
CoverageField.test.jsxcovers the rendered states (folders + Drives listed, the no-Drive warning, a folder claiming no types still shown, nothing-configured, a failed fetch reported rather than rendering blank, an abort staying silent) and asserts the field passes anAbortSignalthat unmount actually aborts.One test worth calling out
The field-type registration test originally asserted
expect(FieldRegistry.getField(field.type)).toBeTruthy(). That assertion cannot fail:getField()returns anUnknownFieldTypeplaceholder for an unregistered type. I only found out by typo'ing the schema'stype:to check — 8/8 still passed, andnpm run lintalso returned 0, becausescripts/check-field-types.jsonly scans the three core schema files and never sees extension types.So a mistyped extension field type would have shipped as a blank row in Module Settings with nothing failing anywhere. The test now asserts identity against the component, and I re-ran the typo to confirm it goes red.
Screenshots
Not captured. The settings strip renders inside ModuleSettingsPage's own section card (no second outer card, matching
Cl2kCoverageField); the Review page becomes alg:flex-rowsplit with a fixed-width left column that stacks on narrow screens.Checklist
backend/util/config.py) — N/A, the field carries no config value and never callsonChangecd frontend && npm run build)DAPSreferences introducedmainonlyThe field type is registered from the extension's own manifest at module scope, mirroring how
cl2kregisters its Save Locations fields — so no shared file is touched and the branch-isolation invariant holds.posterSelfHeal.jsnow forwards options so callers can pass a signal, which works because #468 landed on main and merged down.Summary by CodeRabbit
New Features
Bug Fixes