← Back to Pull requests

Improve support for todo widgets #1610

Open
unknown opened this pull request with 299 lines diff across 3 files
View on GitHub
unknown unknown commented on Jan 28, 2026 13:59 UTC
Author

Improve support for todo widgets

Fixes #1575

---

Goal of the work

The todo widget in zulip-terminal relies on widget submessages to represent user actions such as toggling, adding, and renaming items.
This PR improves support for todo widgets by completing missing UI interactions and ensuring todo actions are sent correctly to the server.

---

What was missing or broken

Before this change:

  • Some todo widget actions were not fully supported in the UI.

  • Widget submessages were not consistently sent via the correct Zulip endpoint.

  • Users could not reliably add or rename todo items through dedicated popups.
  • ---

    What this PR changes

    This PR is intentionally split into small, focused commits:

    1) Send widget submessages via the correct endpoint


  • Widget submessages are now sent using POST /api/v1/submessage.
  • Result: todo actions are correctly delivered to the server.

    ---

    2) Support toggling todo tasks


  • Added UI support for toggling (striking/unstriking) todo items.
  • Result: users can reliably mark tasks as complete or incomplete.

    ---

    3) Add todo text input popup


  • Introduced a popup UI for adding new todo items.
  • Result: users can add todo items interactively from the terminal UI.

    ---

    4) Add todo rename popup


  • Added a popup UI for renaming/editing existing todo items.
  • Result: todo items can be edited without leaving the widget.

    ---

    5) Support adding todo tasks


  • Wired add-todo UI actions to widget submessages.
  • Result: newly added todo items persist and sync correctly.

    ---

    User-visible behavior

    When focused on a todo widget:

  • Toggle item: press 1–9

  • Add item: press a, type the text, press Enter

  • Rename/edit item: press t, type the new text, press Enter
  • ---

    Screenshots

    Add todo popup
    <img width="823" height="377" alt="Add todo popup"
    src="https://github.com/user-attachments/assets/0f41360d-08c2-4f4b-b943-cf76ae6fd81d" />

    Rename / edit popup
    <img width="823" height="377" alt="Rename todo popup"
    src="https://github.com/user-attachments/assets/dcca06d1-1a5e-4b45-abdd-f74ee4e61569" />

    ---

    How to test

  • Open a message containing a todo widget

  • Toggle items using number keys

  • Add a new item using a

  • Rename an item using t
  • Diff: 299 lines (+224 / -75) across 3 files Reviewer: yummyPancake2607 Review duration: 397486m
    All Vouch review confidence checks passed
    Residual risk 0.26 = Change Risk (0.47) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 299 lines diff across 3 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    44%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    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
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.341
    Real PR Conversation Timeline
    1 comments
    "Review active on #1610"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 47% (MEDIUM) · Higher = larger blast radius
    47%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 44.7% · Lower = rushed or shallow review
    44.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 26% · Safe to merge
    26%