feat: add a local-known summary and safer defaults to claim review#68
feat: add a local-known summary and safer defaults to claim review#68enlorik wants to merge 2 commits into
Conversation
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
6fa35aa to
161ef4b
Compare
1ea2915 to
39c2823
Compare
72c2965 to
c21d2bb
Compare
- ClaimReviewItem gains matchedLocalEvidenceTitles (index-aligned with IDs) - ClaimReviewMapper populates titles alongside IDs from the same evidence sequence - ClaimReviewGroupsPanel: already-known group is now collapsible (threshold ≤ 3 items starts expanded, >3 starts collapsed); keyed so a new review result that crosses the threshold recreates the ExpansionTile with the correct initiallyExpanded; already-known tiles are always unchecked/disabled regardless of selectedIds; matched note titles (or ID fallback) displayed below each claim; better-source groups show a helper explanation line - 27 new tests covering expansion defaults (1/2/3 expanded, 4/5 collapsed), expand/collapse interaction, threshold-crossing regressions, disabled tile safety, matched-evidence display, ID fallback, missing-title safety, better-source helper text, and ordinary group rendering Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
747b4d9 to
e248658
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e248658c08
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ), | ||
| ); | ||
| } | ||
| if (item.matchedLocalEvidenceIds.isNotEmpty) { |
There was a problem hiding this comment.
Restrict matched-note text to real matches
When local evidence exists, low-similarity newClaim results can still carry a bestMatch (TextSimilarityClaimDeduplicationService returns it even with reason "No sufficiently similar content found"), but this new condition renders any non-empty evidence list as Matches your notes. In that scenario a genuinely new claim is shown as matching an existing note, which is misleading and contradicts the classification/reason; the display should be limited to classifications where the evidence is actually a high-confidence local match or use less definitive wording.
Useful? React with 👍 / 👎.
| // the previous session leaking into the new one. | ||
| final collapsedByDefault = group.items.length > _alreadyKnownCollapseThreshold; | ||
| return _AlreadyKnownGroupSection( | ||
| key: ValueKey(collapsedByDefault), |
There was a problem hiding this comment.
Reset expansion state for each review result
Keying the already-known section only by collapsedByDefault means two consecutive reviews on the same side of the threshold reuse the same ExpansionTile state. If a user expands one long already-known result and then asks another question that also has more than 3 known claims, the new result stays expanded and ignores initiallyExpanded: false, so the intended default collapse does not apply to common large→large review sessions.
Useful? React with 👍 / 👎.
P2-1: matched-note line was shown for newClaim items when matchedLocalEvidenceIds is non-empty — misleading because the dedup service returns a low-similarity bestMatch even for genuinely new claims. Now guarded to alreadyKnown and betterSource only, where the match is a confirmed high-confidence hit. P2-2: ValueKey(bool) meant two consecutive large reviews (both >3 items) shared the same key, so the second review reused stale expansion state and never applied initiallyExpanded: false. Now keyed on Object.hashAll of the bool plus all item IDs, so any change in the item set forces widget recreation. Tests: +2 (newClaim suppression regression, large→large expansion reset) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Add a local-known summary and safer defaults to the claim review panel
The claim review panel treated every group the same way, so a question with a lot of already-known claims could bury the actually useful new/better-source claims below a wall of stuff you already have. Turned "Already in notes" into its own compact, collapsible section (collapses by default past 3 items) and added the matched local note title/id under each already-known claim so you can see what it's matching against instead of just trusting the classification. Also added a short line under "Better sources" explaining why a claim you already know about is still worth a look (it may have a better or missing source). Nothing about selection defaults or saveability changed -- already-known claims were never selected or saveable, this just makes that clearer. Went from 495 to 503 tests, new file
claim_review_groups_panel_test.dartcovers the collapse behavior, matched-evidence display/fallback, and that already-known items stay unselected/disabled even if selection state somehow includes one.flutter analyzeis clean.