Skip to content

Telegram: see a checklist's items and tick them - #843

Closed
itz4blitz wants to merge 2 commits into
mainfrom
issue/485-telegram-checklist
Closed

itz4blitz wants to merge 2 commits into
mainfrom
issue/485-telegram-checklist

Conversation

@itz4blitz

Copy link
Copy Markdown
Collaborator

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

  • fix
  • feature
  • perf
  • refactor
  • chore
  • docs

Platforms

  • windows
  • macos
  • linux
  • android
  • ios

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.

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Tiny Code Review

⚠️ Code review unavailable · run

the AI provider rate-limited the request

This is advice, not a gate. Re-run with the agent:review label or a /review comment.

@unRekable unRekable left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)) => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Major: This arm leaves message.kind as Normal, and for Telegram the window's message_link returns None for Normal messages (the CONTRACT comment in gui/conversation/actions.rs says Telegram offers neither 'Open in ' nor 'Copy link'), so the open-in-Telegram affordance the old Unsupported { link } box carried is gone. Ticking happens only in Telegram and this PR adds none, so after this a checklist cannot be reached from tinyclient to act on at all; keep the link reachable (a text render plus the stored link needs protocol support, otherwise keep the box) or say in the thread why dropping the only path to tick is accepted.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 unRekable left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() } });

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Major: This span carries tg://openmessage?..., which the window's link opener refuses: open_link passes only mailto: straight through and every other scheme must parse as http/https (Destination::parse returns None for tg://), so clicking 'Open in Telegram' does nothing in private chats and groups; the row menu offers no open item either, because actions::message_link returns None for a Telegram Normal message. The old Unsupported box worked because it called cx.open_url directly — either let a link to the network's own app pass through that way, or restore that affordance alongside the text.

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.
@itz4blitz

Copy link
Copy Markdown
Collaborator Author

Superseded by and merged in #903 (d387971 — Release 2026-11-20 combined PR).

@itz4blitz itz4blitz closed this Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants