Skip to content

fix(web): Inbox replies lock and fail per ask, and pinned asks stop leaking to the composer - #1183

Merged
Jacksondr5 merged 6 commits into
j5/mainfrom
j5code/inbox-reply-fixes
Nov 23, 2026
Merged

Jacksondr5 merged 6 commits into
j5/mainfrom
j5code/inbox-reply-fixes

Conversation

@Jacksondr5

@Jacksondr5 Jacksondr5 commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Problem

Answering on the web Inbox and on a Captain's pinned ask had rough edges. Closes #1176.

  • Sending one answer locked every ask on the page.
  • An error showed in a page banner whose "Try again" re-read the list instead of resending.
  • Reply boxes stayed editable on a read-only connection or a closed ask.
  • An answer of only spaces could be sent.
  • On the pinned ask, a dropped file also landed in the Captain's composer, and Mod+S stashed the Captain's prompt. The tester confirmed both leaks live on j5/main 41f406f before this fix.

What changed

  • Per-ask lock and errors. A small useAnswerSends hook (apps/web/src/j5/a2a/answerSends.ts) keeps a set of asks being sent and an error per ask. Both the page and the dock use it, so two overlapping sends never unlock or overwrite each other. The dock's request ids are kept per exchange for the same reason.
  • Errors under the ask. The page banner is gone. A failed send shows its error under that ask, and the words stay; pressing Answer again resends with the same request id, so a lost reply can't answer twice. This copies upstream's composer: a failed send restores the words (apps/web/src/components/chat/useComposerSend.ts:1487) and reports the error through setThreadError (:1507), which ThreadErrorBanner draws as an error Alert (apps/web/src/components/chat/ThreadErrorBanner.tsx:89); sending again is the retry, with no separate button. AnswerSendErrorAlert draws the same Alert, on the Inbox page and the pinned ask. If the server took the answer and only the re-read failed, the words were already cleared on acceptance, so Answer can't resend; the page's Refresh re-reads.
  • Read-only boxes. The page's reply box is readOnly when this connection may not answer or the ask has closed. The dock's box is readOnly once its ask has closed.
  • Blank answers. A whitespace-only answer can't be sent. Any other answer is delivered exactly as typed, edge spaces and newlines included (Inbox AC8, the Captain's ruling): trimming only decides whether there are words.
  • Drop leak. The pinned ask's body is marked as its own file drop target. Upstream's thread drop handler (workspaceFileDrop.ts) still clears its overlay but no longer takes files dropped inside that element. A defaultPrevented check would be smaller but isn't equivalent: ProseMirror prevents the default when it inserts a drop's text or HTML, and upstream still attaches the files then.
  • Cmd+S leak. While focus is in the pinned ask, a newer capture composer.stash scope claims Mod+S and does nothing (claimedStashShortcut.ts). It hangs on the container's focus/blur, so it keeps working when Inbox: the reply box uses the composer's editor #1174 swaps the textarea for the composer editor.

Tests (each fails without its fix):

  • answerFileDrop.browser.test.ts
  • claimedStashShortcut.browser.test.tsx, which also checks that Mod+S outside the ask still stashes
  • answerSends.browser.test.tsx, which covers a failed send staying with its ask while another sends, and exact delivery

UI changes

Base j5/main 41f406f vs head, same seed repo, ask text, reply text and files, Chrome light, 1280×800. Agent-written thread titles and narration differ between runs.

State Before After
Ctrl+S in the pinned reply leaves the Captain prompt in place Ctrl+S in the pinned reply leaves the Captain prompt in place, before Ctrl+S in the pinned reply leaves the Captain prompt in place, after
Drops on pinned reply and question attach only to answer Drops on pinned reply and question attach only to answer, before Drops on pinned reply and question attach only to answer, after
Pinned reply and composer after drops, detail Pinned reply and composer after drops, detail, before Pinned reply and composer after drops, detail, after
Sending one answer leaves other ask usable Sending one answer leaves other ask usable, before Sending one answer leaves other ask usable, after
Inbox failed send: error under the ask, with Answer as the retry Inbox failed send: error under the ask, with Answer as the retry, before Inbox failed send: error under the ask, with Answer as the retry, after
Inbox failed-send reply area, detail Inbox failed-send reply area, detail, before Inbox failed-send reply area, detail, after
Pinned ask failed send: error alert, with Answer as the retry Pinned ask failed send: error alert, with Answer as the retry, before Pinned ask failed send: error alert, with Answer as the retry, after
Pinned ask failed-send reply area, detail Pinned ask failed-send reply area, detail, before Pinned ask failed-send reply area, detail, after
Answered ask keeps draft in read-only box Answered ask keeps draft in read-only box, before Answered ask keeps draft in read-only box, after

Before: sending one answer locks the other ask; a failed send shows the page banner.

reply-delivery-and-error-base.mp4

After: the other ask stays usable and its file can be removed while the first sends; the failure shows under that ask. (Recorded before the separate Try again button was replaced by the error alert above; the lock it shows is unchanged.)

reply-delivery-and-error-head.mp4

Live testing

Verdict: pass on web (crew tester; report artifacts/test-reports/inbox-reply-fixes/8f2a95d0d1.md). Real Haiku 5.5 Captains with approved one-seat Crews asked the questions on isolated test servers. Items 1–4 ran at c21db35; whitespace, the per-ask lock, errors and retry, and the read-only connection were re-run at 8f2a95d. The only change between those heads is exact delivery, which is why only those items were re-run.

  • Pinned-ask leaks: a file dropped on the reply or on the question text attaches only to the answer, the composer keeps its prompt, and the drop overlay clears (base: both, or the composer). Ctrl+S in the reply stashes nothing; Ctrl+S in the composer still stashes. Drops used browser DragEvent/File events, because the Browser panel has no OS drag.
  • Per-ask lock: with the first answer's command held pending, the second ask's Answer, Attach and Remove stay usable, and Remove worked (base: disabled). The hold is a controlled delay before the command runs, because a real send is too fast to capture.
  • Error under the ask: a rejection injected at the client's answer command (fault injection at the command boundary, not a real network outage) shows an error alert inside its ask, the words stay, and Answer stays enabled with no second button, on the Inbox page and the pinned ask. After restoring the command, pressing Answer delivered on both surfaces and closed each ask; the stored replies matched exactly (3e71cf6, report artifacts/test-reports/inbox-reply-fixes/3e71cf6c71.md).
  • Read-only: a closed ask with a draft keeps its words read-only (base: editable). A connection paired with a read-only device scope gets a read-only box and a disabled Answer.
  • Exact delivery: a whitespace-only answer is refused on both surfaces. " yes " (Inbox) and " yes " (pinned ask) were stored exactly so in the delivered message events (seq 62 and 68).

Not exercised: the packaged Electron app (desktop wraps web), a real OS drag, a real outage, or a failed re-read after a delivered answer, a separate Viewer person's box, and a closed pinned ask's retained draft.

Upstream impact

Checklist

Built by Claude Opus 5.5 in Claude Code (J5 Code crew seat).

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
j5-code Ready Ready Preview Nov 23, 2026 2:03am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 12 billable files and costs up to $3.00.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 41 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 57 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a52cb63 and 3e71cf6.

Files selected for processing: 12

  • FORK.md
  • apps/web/src/components/chat/workspaceFileDrop.ts
  • apps/web/src/j5/a2a/AdjudicationDock.tsx
  • apps/web/src/j5/a2a/AnswerAttachments.tsx
  • apps/web/src/j5/a2a/AnswerSendErrorAlert.tsx
  • apps/web/src/j5/a2a/HumanInboxPage.tsx
  • apps/web/src/j5/a2a/answerFileDrop.browser.test.ts
  • apps/web/src/j5/a2a/answerFileDrop.ts
  • apps/web/src/j5/a2a/answerSends.browser.test.tsx
  • apps/web/src/j5/a2a/answerSends.ts
  • apps/web/src/j5/a2a/claimedStashShortcut.browser.test.tsx
  • apps/web/src/j5/a2a/claimedStashShortcut.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 effective changed lines (test files excluded in mixed PRs). labels Nov 22, 2026
Jacksondr5 added a commit that referenced this pull request Nov 22, 2026
@Jacksondr5
Jacksondr5 added this pull request to stack #1187 November 22, 2026 21:35
Jacksondr5 and others added 5 commits November 22, 2026 21:02
…ed asks stop leaking to the composer

- Sending one answer locks only that ask; errors show under their ask,
  and Try again resends (or re-reads, once the server took the answer).
- Reply boxes are read-only on a read-only connection or a closed ask.
- Answers are trimmed, and words are still required.
- A file dropped on a Captain's pinned ask no longer also lands in the
  Captain's composer (upstream seam in workspaceFileDrop.ts, FORK.md
  case 127), and Mod+S typed in it no longer stashes the Captain's prompt.

Closes #1176

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p target

- Try again resends only while the ask can still take an answer; a
  closed (kept) ask is refused at the send itself.
- A reply box is read-only whenever its ask cannot be answered now.
- The pinned ask takes a dropped file anywhere on it while it can take
  files, and is marked as a drop target only then.
- The pinned ask's error offers Try again.
- FORK.md: this seam is case 128 (#1182 takes 127).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s case lands ahead of it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…one is refused

Per Inbox AC8 and the Captain's ruling: trimming decides whether an
answer has words, never what is delivered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wer sends again

Jackson's review: an outlined Try again beside the filled Answer button
looked wrong. Upstream's composer shows a failed send as an error (its
ThreadErrorBanner Alert) and keeps the words, and sending again is the
retry; the Inbox and the pinned ask now do the same, with one action.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Jacksondr5
Jacksondr5 force-pushed the j5code/inbox-reply-fixes branch from 0cc8b03 to 3e71cf6 Compare November 23, 2026 02:03
Jacksondr5 added a commit that referenced this pull request Nov 23, 2026
Jacksondr5 added a commit that referenced this pull request Nov 23, 2026
Jacksondr5 added a commit that referenced this pull request Nov 23, 2026
@Jacksondr5
Jacksondr5 merged commit 807471c into j5/main Nov 23, 2026
35 checks passed
@Jacksondr5
Jacksondr5 deleted the j5code/inbox-reply-fixes branch November 23, 2026 02:57
Jacksondr5 added a commit that referenced this pull request Nov 23, 2026
Jacksondr5 added a commit that referenced this pull request Nov 23, 2026
Jacksondr5 added a commit that referenced this pull request Nov 23, 2026
Jacksondr5 added a commit that referenced this pull request Nov 23, 2026

This branch was successfully deployed

1 active deployment
Preview — 3e71cf6c Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 effective changed lines (test files excluded in mixed PRs). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inbox: reply fixes (per-ask send lock, errors under the ask, read-only boxes, blank answers, pinned-ask leaks)

1 participant