fix: fall back to claim-level citation titles in the generated Sources section#67
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3cdeb4cedc
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d95887fa55
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! 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". |
2a7bf4a to
15fe643
Compare
6fa35aa to
161ef4b
Compare
4237854 to
091e9a0
Compare
…s section When a selected claim references a URL not present in the provider's top-level citations list, use the matching entry from the claim's own citationTitles instead of falling back to the bare URL. - titleByUrl built from provider citations (non-empty titles only) - putIfAbsent walk over each selected item's citationUrls/citationTitles pair adds claim-level titles for URLs the provider list doesn't cover - Safe bounds check: citationTitles shorter than citationUrls never throws - Provider-level title always wins over a conflicting claim-level title - Sources deduplication, deterministic order, and sourceCount are unchanged Tests: - _item() helper accepts citationTitles parameter - 6 focused unit tests covering all fallback/precedence/edge-case scenarios - 1 save-persistence test: saved draft retains claim-level source title - 1 append-persistence test: appended draft retains claim-level source title Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
72c2965 to
c21d2bb
Compare
|
@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". |
Improve source display in claim review and markdown drafts
Went digging into the claim review source display work and most of it was already solid - multi-URL display and titles in the review panel, and URL dedup in the generated Sources section were already there from earlier passes.
SelectedClaimsDraftBuilderonly resolved Sources titles from the provider's top-level citation list, so it was relying on every claim'scitationTitlesalways being a subset of that list. That happens to hold today since both are built from the sameanswer.citations, but it's an implicit assumption rather than an enforced one, so I made the builder fall back to a claim's owncitationTitleswhen a URL isn't in the provider list, instead of silently dropping to the bare URL. Added two tests (saved note keeps source title, appended note keeps source title) covering that fallback directly. Went from 489 to 491 tests,flutter analyzeis clean. Didn't touch the Brave provider, didn't add any network calls, and didn't redesign the review UI beyond this.