feat(tasklist): show full prompt for truncated task details#192
Open
H-TTTTT wants to merge 1 commit into
Open
Conversation
Task detail prompts longer than the detail budget are truncated to keep the message under Telegram's 4096-byte editMessageText limit (grinev#172). Truncated prompts are now surfaced with a 'Show full prompt' button on the task detail view. Tapping it replies with the complete prompt, split across messages when it exceeds the Telegram limit, so long prompts are no longer silently lost. Fixes grinev#147
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tapping a scheduled task whose prompt exceeds the detail budget currently shows only a truncated prompt (added in #172 to keep
editMessageTextunder Telegram's 4096-byte limit). The rest of the prompt is silently lost.This adds a
📄 Show full promptbutton to the task detail view (only when the prompt was actually truncated). Tapping it replies with the complete prompt, split across multiple messages when it exceeds the Telegram limit.Changes
buildTaskDetailsKeyboardnow accepts{ showFullPrompt }and renders atasklist:prompt:<id>button only when the prompt exceeds the detail budget.tasklist:prompt:<id>callback handler inscheduled-task-callback-handler.ts:detailstage for the matching task (inactive alert otherwise).isTaskDetailPromptTruncated+ byte-awarechunkTextByByteLengthhelpers (consistent with the existing byte-awaretruncatePromptForDetails).tasklist.button.show_promptandtasklist.full_prompt_headeracross all 7 locales (ar, de, en, es, fr, ru, zh).Why not edit the existing message?
The full prompt can be far larger than 4096 bytes, so it cannot replace the detail view via
editMessageText. Sending it as follow-up message(s) keeps the detail card intact while revealing the full prompt.Verification
npm run build(tsc --noEmit) — cleannpm run lint(eslint --max-warnings=0) — cleannpm test— 1158 tests pass (124 files), including 5 new tests covering: button shown when truncated, hidden when short, full-prompt reply, multi-message chunking, and inactive-stage rejection.Fixes #147