Repository navigation
Conversation
Tiny Code Reviewthe AI provider rate-limited the request This is advice, not a gate. Re-run with the |
unRekable
left a comment
There was a problem hiding this comment.
Code Review
🟡 1 finding (0 blocking).
The diff maps Telegram's checklist media to title-plus-item text with ListItem spans and a checked mark when a completion names the id, replacing the old 'Checklist' placeholder box, and adds a prove hook and lab scenario in the established telegram-markers pattern. The mapping, the byte-offset span arithmetic, and the synthetic TL sample (flags, flags2, id, peer_id, date, message) all check out against grammers-tl-types 0.10.0, and the driver scripts are LF template copies. The one real gap: the change removes the checklist's only route into Telegram, so the read-only list can no longer be acted on from the app, though the PR title promises ticking.
Residual risk
- The list text is assembled uncapped from list.list and its item titles into message.text; Telegram caps checklists server-side today, so the size the window gets rides on that cap holding.
- A caption on a checklist message would be silently dropped by the overwrite of message.text; no Telegram client sends one today, so nothing user-visible breaks now.
| // The dice is its own emoji; the roll is animated in Telegram's app only. | ||
| Some(MessageMedia::Dice(dice)) => message.text = dice.emoticon.clone(), | ||
| // The title, then each item on its own list line. A done item is checked. | ||
| Some(MessageMedia::ToDo(media)) => { |
There was a problem hiding this comment.
There was a problem hiding this comment.
The checklist stays a normal message, so the items still render. The link the old box opened is a link on the last line of that list. A normal Telegram message still has no menu permalink, which is the existing contract, and storing the link beside the text would need a protocol field. Ticking stays in Telegram, and the row can open the message.
unRekable
left a comment
There was a problem hiding this comment.
Code Review
🟡 1 finding (0 blocking).
The one new commit since the first review keeps the checklist's Telegram address on the row: the mapped text gains a trailing 'Open in Telegram' Style::Link span built from message_link, meant to replace the route the old Unsupported box offered. The prior major changed shape but is not resolved: that span carries a tg://openmessage URL the window's link opener refuses (open_link passes only mailto straight through and everything else must parse as http/https, and Destination::parse returns None for tg://), so a click does nothing in private chats and groups, and a Normal kind also gets no 'Open in Telegram' row-menu item, which comes only from MessageKind::Unsupported. The rest of the change — the item mapping, the prove hook in chatd's main, and the e2e driver — is sound and follows the repo's patterns.
Residual risk
- The 'Open in Telegram' line is ordinary message text, so reply quotes, notifications and the message list show it as plain words with no context.
- The lab's telegram-checklist driver proves only chatd's text mapping; nothing in CI exercises the click path this PR exists for, so the dead link ships green.
- Telegram's later todo-completion updates are not handled anywhere in the adapter, so a tick someone else adds keeps its old state until the row is re-fetched.
- For a channel checklist the span is an https://t.me link instead, which routes through the link question and the browser rather than Telegram's app — a roundabout route even when it works.
| } | ||
| let start = text.len() as u32; | ||
| text.push_str("Open in Telegram"); | ||
| spans.push(Span { start, end: text.len() as u32, style: Style::Link { url: link.to_owned() } }); |
There was a problem hiding this comment.
A checklist message lists its title and each item. A completed item is checked. The list is read-only. Closes #485
Ticking stays in Telegram. The list ends with the same link the old box opened, so the message can still be reached.
2a9d822 to
f880645
Compare
What changed and why
A Telegram checklist shows its title and each item. An item someone has completed is checked. The list is read-only: ticking an item still happens in Telegram.
Type
Platforms
Proof
Scenario: e2e/scenarios/telegram-checklist
Lab run:
Compatibility
No protocol change. The checklist is ordinary message text with list lines. Sending a tick is unchanged.
Risk and rollback
A checklist no longer appears as a box that only says Checklist. Revert this commit to show that box again.
Release note
A Telegram checklist shows its items, and a done item is checked.