Repository navigation
feat: Missing items are now automatically removed from personal selections once catalogue data is available - #4301
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Batch storage removal src/features/selection/storage/store.ts, src/features/selection/storage/store.test.ts |
removeSelections removes matching category and identifier pairs in one mutation. Tests cover latest stored data, no-op removals, and storage failures. |
Page cleanup and notice removal src/features/selection/components/page/*, src/features/selection/components/SelectionPage.tsx, src/features/selection/components/SelectionPage.test.tsx, messages/en.json, messages/fr.json |
The page invokes cleanup only for personal, valid selections when storage is available. Tests cover loader states, shared selections, and cleanup results. The missing-entry notice and its localized messages were removed. |
Unidentified README deletion README.md |
One line was deleted. The supplied change summary does not identify its content. |
Priority:
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant SelectionContent
participant useMissingSelectionCleanup
participant removeSelections
participant SelectionStorage
SelectionContent->>useMissingSelectionCleanup: Pass missing entries and cleanup condition
useMissingSelectionCleanup->>removeSelections: Remove missing category and identifier pairs
removeSelections->>SelectionStorage: Read latest data and apply matching removals
SelectionStorage-->>removeSelections: Return storage operation result
Merge Risk: 
Minimal · up to b7688
-
The change appears mergeable after normal checks.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title says missing items are now removed automatically from personal selections once catalogue data is available. The changeset matches this. It adds a useMissingSelectionCleanup hook that calls removeSelections for missing entries, adds a batch removeSelections in store.ts, removes the MissingEntriesNotice component and its prop plumbing, and updates the tests to expect silent cleanup. The title is specific and describes the primary change. Its length (107 characters) is on the long side but still readable.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 6 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- 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.
Comment @coderabbitai help to get the list of available commands.
|
@coderabbitai In my selection page, delete the UX for removing not found entries & warning about them, but keep in background the logic of cleaning up things |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 13 |
| Duplication | 0 |
🟢 Coverage 100.00% diff coverage · +0.00% coverage variation
Metric Results Coverage variation ✅ +0.00% coverage variation (-1.00%) Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (454fc01) 2937 2834 96.49% Head commit (95841e6) 2938 (+1) 2835 (+1) 96.49% (+0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#4301) 14 14 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
fd -i 'selection|select'
rg -n -i -C 3 'not found|notFound|not_found|remove missing|missing entries' --glob '!package-lock.json' --glob '!yarn.lock' --glob '!pnpm-lock.yaml' . | head -250Length of output: 21624 🏁 Script executed: #!/bin/bash
ast-grep outline src/features/selection --items all --type function --match 'Selection|useSelection'
rg -n -i -C 3 'missing|notfound|not.found|cleanup|prune|unresolved' src/features/selection src/domain/selection src/redux/services/selectionAPI.tsx
for file in src/features/selection/components/page/SelectionNotices.tsx src/features/selection/components/page/SelectionContent.tsx src/features/selection/components/page/useSelectionDocument.ts src/features/selection/components/grid/SelectionResults.tsx src/features/selection/components/grid/SelectionCard.tsx; do
ast-grep outline "$file"
sed -n '1,240p' "$file"
doneLength of output: 47074 🏁 Script executed: #!/bin/bash
for file in src/features/selection/components/page/MissingEntriesNotice.tsx src/features/selection/storage/store.ts; do
ast-grep outline "$file"
sed -n '1,260p' "$file"
doneLength of output: 8079
The current cleanup runs only when a removal button is clicked. I’ll move that behavior out of
You are interacting with an AI system. |
…tions in the background <!-- coderabbit-ai-generated:v1 -->
|
✅ The requested changes have been implemented and a pull request has been created: View PR |
📝 CodeRabbit Chat: Silently clean missing entries from personal selections in the background
|
@coderabbitai Simplify that, still too complex (and dead code must be deleted) |
|
Code simplification is not enabled for this repository. |
|
@coderabbitai Simplify this MR, still too complex (and dead code must be deleted) |
|
Code simplification is not enabled for this repository. |
|
@coderabbitai Reduce this MR, still too complex (and dead code must be deleted) |
|
Tip For best results, initiate chat on the files or code changes. @jy95 I’ll reduce the implementation and delete dead code. I’ll keep silent background cleanup and the existing safeguards.
You are interacting with an AI system. |
<!-- coderabbit-ai-generated:v1 -->
|
✅ The requested changes have been implemented and a pull request has been created: View PR |
📝 CodeRabbit Chat: Simplify selection cleanup and remove obsolete code
|
@coderabbitai Reduce this MR, still too complex (and dead code must be deleted) |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain
You are interacting with an AI system. |
…solution code <!-- coderabbit-ai-generated:v1 -->
|
✅ The requested changes have been implemented and a pull request has been created: View PR |
📝 CodeRabbit Chat: Simplify selection cleanup and remove redundant resolution code
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
🟢 Coverage 100.00% diff coverage · 0.00% coverage variation
Metric Results Coverage variation ✅ 0.00% coverage variation (-1.00%) Diff coverage ✅ 100.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (454fc01) 2937 2834 96.49% Head commit (3b4762c) 2936 (-1) 2833 (-1) 96.49% (0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#4301) 13 13 100.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
@coderabbitai I don't like current code that rely too much on "if" paths, run cleanup anyway so code is less complex |
|
Tip For best results, initiate chat on the files or code changes. @jy95 I’ll let cleanup run instead of adding checks to avoid harmless calls. I’ll remove the attempt tracking and cleanup-specific optimization branches. I’ll keep the shared-selection boundary and storage validation. These prevent cleanup from deleting unrelated personal entries or overwriting invalid data.
You are interacting with an AI system. |
<!-- coderabbit-ai-generated:v1 -->
|
✅ The requested changes have been implemented and a pull request has been created: View PR |
📝 CodeRabbit Chat: Simplify selection cleanup and update tests
|
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯ FAIL src/features/selection/components/SelectionPage.test.tsx > reports cleanup setItem failures without an unbounded render loop ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯ Test Files 1 failed | 228 passed (229) |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain
When
I inspected the code but did not run tests in this sandbox. The fix remains unverified until the coding workflow runs them.
You are interacting with an AI system. |
…pdates <!-- coderabbit-ai-generated:v1 -->
|
✅ The requested changes have been implemented and a pull request has been created: View PR |
📝 CodeRabbit Chat: Preserve document references on storage metadata updates
Summary by CodeRabbit