Skip to content

Answer a single-choice view card from an IM chat - #19

Merged
neotechnet merged 1 commit into
stack/installed-0.3.5from
fix/telegram-options-view
Nov 12, 2026
Merged

neotechnet merged 1 commit into
stack/installed-0.3.5from
fix/telegram-options-view

Conversation

@neotechnet

Copy link
Copy Markdown
Owner

Fault 1 of menu-card-persistence-20261111 (job approved by Igor).

What changed:

  • A show_view card whose only interactive part is one single-choice options component now goes to IM chats in the question-card layout. Platforms with buttons get one button per option (v::); a bare number answers it on every platform.
  • The answer goes through a new rt.answerView in channel.js. The view-reply endpoint body moved into it unchanged; the endpoint now calls it.
  • Every other view (form, confirm, submit, inputs, multi-select) keeps its text-only card.

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.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-11T23:08:47.796857Z 734503e PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@neotechnet
neotechnet merged commit 36368fd into stack/installed-0.3.5 Nov 12, 2026
14 checks passed
@neotechnet
neotechnet deleted the fix/telegram-options-view branch November 12, 2026 01:44
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.

1 participant