Sort unread topics by recency for n shortcut. #1625
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.50) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 380 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.356
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #1625"
general
weight: 0.35
yummyPancake2607
Fixes #1582.
<!-- See README for documentation, or ask in #zulip-terminal if unclear -->
What does this PR do, and why?
Before, using the
nkeybinding (NEXT_UNREAD_TOPIC) jumps to the next unread topic alphabetically within a stream. But it should be sorting unread topics by recency.this pull request fixes this issue #1582 by using recency-based sorting
1.
helper.py: Updatedsort_unread_topicsto accept an optionaltopic_msg_idsdictionary. Modified the sortingkeyto evaluate the maximummessage_idwithin each topic (-max(...)), ensuring that the most recently active topics go to the top (bubble). The alphabetical topic name sorting (from earlier) is still being used as a secondary tie breaker.2.
model.py: Updated calls tosort_unread_topicsinnext_unread_topic_from_message_idto passself.index["topic_msg_ids"]External discussion & connections
<!-- [x] all that apply, specifying topic and adding numbers after # for issues/PRs -->
topicHow did you test this?
<!-- [x] all that apply -->
Self-review checklist for each commit
Visual Changes
Navigating with
nin Explore mode. The selection correctly jumps from the recently active(checkmark) testtopic to the next most recent unread topic (test), rather than sorting alphabetically, like earlier.The header shows being in the test checkmark in the first screenshot (this is before pressing n)
In the second ss, after pressing n, the ui changes and the header now shows test without the checkmark and the message history of unread messages for that topic beneath it.
<img width="441" height="685" alt="image" src="https://github.com/user-attachments/assets/79999e1f-b169-4224-b44e-7e25f22328b1" />
<img width="441" height="685" alt="image" src="https://github.com/user-attachments/assets/35c5c6cf-2e4d-45c8-9c6f-0c2d8aa91d4a" />