Remove reviewed-artifact filter from current-branch inbox lookup
Intent: Ensure the query that checks whether the current branch is still in the inbox does not exclude branches whose artifact has already been reviewed. This keeps the currently-viewed branch in context even after it is marked read.
Affected files: crates/pika-news/src/storage.rs
@@ -1259,10 +1259,6 @@ impl Store {
FROM branch_inbox_states bis
WHERE bis.npub = ?1
AND bis.state = 'inbox'
- AND (
- bis.last_reviewed_artifact_id IS NULL
- OR bis.last_reviewed_artifact_id != bis.artifact_id
- )
AND bis.branch_id = ?2
The first query in the review-context function fetches the row for the branch the user is currently viewing. The last_reviewed_artifact_id predicate previously filtered it out once the user marked it read, which broke the position/total calculation.
Removing the predicate means the row is returned as long as state = 'inbox', regardless of whether the artifact has been reviewed. Dismissal (which changes state) is the only action that removes it.