generated from exteraGramPlugins/pluginBase
Publish plugin / publish (push) Successful in 3s
Pressing Summarize used to inject a status card immediately, at a guessed anchor, and move it once the fetch returned. Any failure before the model answered (fetch error, empty history, unreachable host, bad key, HTTP error) then left an error bubble in the chat and had already scrolled the user away from where they were reading. The pipeline is now fetch -> stream -> card. A bulletin acknowledges the press; every failure before the first chunk is a bulletin only and leaves the chat untouched. On the first chunk the card is created with its final anchor and virtual id and placed strictly after the newest analyzed message. If that message is not loaded, the chat is asked to load it and placement retries; the card never falls back to the chat bottom. Placement then hard-jumps the layout manager to the card's row: scrollToMessageId only smooth-scrolls from cell positions that are stale right after an insert. The provisional anchor and reanchor() machinery is gone. The row is reserved with INSERT .. DO NOTHING, so re-summarizing a saved range no longer blanks its text before the new answer arrives; a fresh row whose stream breaks is deleted instead of left empty. Also: - Finished summaries end with #aisummaries as a native TL_iv.textHashtag (rendered by RichMessageLayout like a hashtag entity) and carry a plain-text body with a TL_messageEntityHashtag. - Deleting a card (MessagesController.deleteMessages, all overloads) removes its saved row and the card, with a "Summary deleted" bulletin. - Settings show the saved summary count and approximate size, and a confirmed "Clear all summaries" action. - Version 1.1.0. Verified on device: no card before streaming, correct placement and jump, restore on reopen, deletion, and the hashtag rendering. Telegram's search is server-side, so local cards do not appear in its results. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>