Repository navigation
Answer a single-choice view card from an IM chat - #19
Conversation
A show_view card with one single-choice options component reached Telegram as text only, with no buttons, so the user could see it but not answer it there. Such a view now goes out in the question-card layout, with a button per option where the platform has buttons and a bare number elsewhere. Both answer it through rt.answerView, the view-reply body moved out of the endpoint. Any other view keeps its text card.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 734503ea39
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const walk = (node) => { | ||
| if (node === null || typeof node !== 'object') return | ||
| if (['options', 'confirm', 'form', 'submit', 'slider', 'choice', 'toggle', 'number'].includes(node.type)) answers.push(node) | ||
| if (node.type === 'text' && typeof node.text === 'string' && node.text.trim() !== '') texts.push(node.text.trim()) |
There was a problem hiding this comment.
Preserve non-text context in single-choice view cards
When a view combines a single-choice options component with a callout, metric, table, or another display component, choiceOf accepts it but collects only literal text nodes. The new rendering branch then bypasses viewCardText, silently dropping that other context from the IM message. For example, a warning in a callout followed by Proceed/Cancel becomes just the choices, allowing the user to answer without seeing the warning. Preserve a textual representation of the display components, or keep views whose context cannot be represented on the existing text-only path.
Useful? React with 👍 / 👎.
Fault 1 of menu-card-persistence-20261111 (job approved by Igor).
What changed:
Scope: ds-bot/src/host/im/index.js, ds-bot/src/host/channel.js, ds-bot/test/im.test.js.
Tests: 5 new in im.test.js. 4 of them fail on the unpatched source; the form-view test guards the unchanged behaviour and passes on both.
Full npm test: 2276 tests, 2248 pass, 6 fail, 22 skipped. The 6 are the known environment failures that also fail on bare v0.3.5 (link.js build, env sanitization, connectors-gateway, phone), the known rounds flake, and "queued deliveries are kept whole" (follow-through.test.js:620), which passed 3 of 3 on rerun both patched and unpatched.
Lint (oxlint 1.76.0): exit 0, 0 errors. build-client --check: exit 0.
Not proven: no smoke bench and no live Telegram run.