Skip to content

fix(bots): send every answer when the last open question is answered - #51361

Merged
brennanb2025 merged 8 commits into
mainfrom
brennanb2025/bot-ask-last-answer-sends
Nov 28, 2026
Merged

brennanb2025 merged 8 commits into
mainfrom
brennanb2025/bot-ask-last-answer-sends

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When a bot asks you several questions at once, you answer each one on its card. Before, answering the last question only saved that answer; you then had to find and click Send, and if you had typed the last answer and pressed Enter, a second Enter did nothing. Now, answering the last open question sends all your answers right away, the same way the chat question card and the phone already do.

Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​143 $\color{#cf222e}{\Huge{\mathbf{−}}}$​52 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​91
Prod 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​58 $\color{#cf222e}{\Huge{\mathbf{−}}}$​42 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​16

What Changed

  • Before: on a bot item's "Needs you" card with several questions, each answer (a quick reply or words typed in the comment box and sent with Enter) was held on the card until you pressed Send. After a typed last answer, focus stayed in the now-empty comment box, so Enter did nothing.
  • After: the answer that fills the last open question, whether a quick reply or the comment box's Enter, posts every held answer as one comment. A partly answered set still never sends by itself; Send still posts it on purpose and skips the open questions. Answers held on the device stay held until the host has the comment, so a refused send can still be recovered.
  • What the card shows is what gets sent. A question shown folded with a check counts as answered. The one question shown open to change, or one whose new answer you've started typing in the comment box, counts as unanswered until you finish it (Enter, or its own pick once the box is empty), so an old answer is never sent by accident.
  • Mechanism: useBotItemQuestionSteps (desktop) now routes both a pick and the box's answer through one holdOrSend step that holds the answer, then posts all answers when every open line has a settled one. This is what the phone's own steps hook already did.

Why

The chat question card submits when its last question is answered, and the phone's bot item card posts when the last line is answered. The desktop bot item card was the only one that needed an extra Send, and with typed answers the keyboard got stuck. Matching one pattern across chat, phone and desktop means Enter always finishes the job. The alternative, keeping Send as a required last step and making Enter in an empty box press it, would leave the desktop card behaving differently from the other two.

Linked Issue

Internal UX fix; no issue.

Visual Proof

Three questions already answered; the last one answered by typing and pressing Enter (top), or by picking a quick reply (bottom). Before, the card stops at Send and a second Enter in the empty box does nothing; after, everything sends at once.

Before After
Typed last answer + Enter
Picked last answer

Testing

  • use-bot-item-question-steps.test.tsx: the ask now has three questions so partial sets stay held. New cases: filling the last open line by a pick or by the box's Enter posts every answer once with nothing skipped; a line shown open to change, or with words started in the box naming it, holds the set until its new answer (the box's link to its line survives a remount; a chip pick doesn't use up those words); picking a reopened line's own reply again lets the set post; the box's Enter on another line keeps a reopened line waiting.

  • Several-questions fixtures updated so their flows end the new way; the before/after shots above come from component fixtures rendered on Linux, on main and on this branch.

  • Unit tests, typecheck, lint and format ran on Linux.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

  • Every added test fails without this change and avoids the test anti-patterns

Performance

None, because the only new work is one check over the open lines when an answer is held, which happens once per click or Enter.

Risk

The riskiest part is sending sooner than before: someone who used to answer every question and then reread before pressing Send now sends on the last answer. Partial sets, typed drafts and held answers behave as before, and a refused send keeps its answers to recover. No saved data or protocol changes; the phone and older paired clients are unaffected. Back out with a plain revert.

Level: Low

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Renderer-only change; no platform, SSH or path impact. Mobile already behaves this way.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status: clean on 3321abbce4b.

Problem: on a bot item card with several questions, answering the last one by typing and pressing Enter saved that answer, but then left focus in an empty comment box where Enter did nothing. You had to find and click Send.

User-facing change: the answer that fills the last open question, whether a quick reply or the comment box's Enter, now sends every answer at once. The chat question card and the phone already work this way. What the card shows is what gets sent. A question folded with a check counts as answered. The question shown open to change, or one with unsent words in the comment box, waits for its new answer. A partial set never sends by itself, and Send still sends one on purpose.

Fixed during review: an old answer could slip out in four ways. (1) Reopening a question and drafting a replacement, then answering the last question; this also failed after a remount, or after reopening another question. (2) Re-picking a reopened question's same reply left a complete set unsent. (3) Enter on another question cleared a reopened question's hold. (4) A reply pick ignored unsent words in the box for that same question. Each case has a test that fails without its fix.

Settled by agreement: two further cases, where the old answer is already back on screen folded with a check before the send, are intended under the rule above. An independent reviewer confirmed this.

Deferred: none.

Verified: unit tests, typecheck, lint and format pass on Linux on this head. Before/after component screenshots of a typed and a picked last answer are in the PR body. The perf screen found nothing: each click or Enter checks at most the questions on one card.

@brennanb2025
brennanb2025 marked this pull request as ready for review November 28, 2026 07:27
@coderabbitai

coderabbitai Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The question-step logic now submits held answers when all open question lines are settled. Reopened lines and drafts can keep a line unsettled. Send can still submit a partial set. Tests and view fixtures now cover these rules, including picks, typed answers, attachments, and pending submissions.

Merge Risk: Minimal · up to 3321a

Answering the last open question on the desktop bot-item card now posts all held answers as one comment, while Send still posts a partial set. The supplied evidence shows no concrete defect, and the tests cover the cases where an old answer could be sent by accident. The change is safe to merge after the normal checks.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(bots): send every answer when the last open question is answered" matches the main change in the changeset. The desktop bot item question card now posts all held answers once the last o…
Description check Passed The description follows the repository template and covers the required sections. It has an ELI5, a What Changed section with before and after behavior and mechanism, a Why section with alternatives c…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(bots): send every answer when the last open question is answered" matches the main change in the changeset. The desktop bot item question card now posts all held answers once the last open question is answered, and the raw summary confirms the use-bot-item-question-steps logic change and the related test and fixture updates. The title is specific and concise, and it follows a conventional commit style.

Full details: Description check

Explanation

The description follows the repository template and covers the required sections. It has an ELI5, a What Changed section with before and after behavior and mechanism, a Why section with alternatives considered, Visual Proof with before and after images, Testing steps, a Performance line, a Risk section with a level and rollback method, and the Agent skill upstream boundary checkbox. The Linked Issue section says there is no issue, which is acceptable for an internal UX fix under the maintainer special case. The AI Disclosure section is empty, but the template says to skip it for internal team members. The final lint, typecheck, test, and build checkbox is unchecked, and the Testing section states that unit tests, typecheck, lint, and format ran on Linux, so the gap is small. The PR objectives also say that manual testing was not done, while the description's checkbox for manual testing is unchecked, which is consistent.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b8ba0585-167d-4f82-94f5-3d41e0aa2c91
Commits

Reviewing files that changed from the base of the PR and between afc217f and 3321abb.

Files selected for processing: 5

  • src/renderer/src/components/bots/items/BotItemCommentCard.test.tsx
  • src/renderer/src/components/bots/items/BotItemQuestionStep.tsx
  • src/renderer/src/components/bots/items/BotItemViewSeveralQuestions.fixture.tsx
  • src/renderer/src/components/bots/items/use-bot-item-question-steps.test.tsx
  • src/renderer/src/components/bots/items/use-bot-item-question-steps.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@brennanb2025
brennanb2025 merged commit 12cfe21 into main Nov 28, 2026
83 of 84 checks passed
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