Skip to content

fix(chat): let the user cancel an in-flight prompt optimize - #20004

Merged
iamwhatever merged 1 commit into
kirodotdev:mainfrom
Pearcekieser:fix/prompt-optimize-cancel
Oct 24, 2026
Merged

iamwhatever merged 1 commit into
kirodotdev:mainfrom
Pearcekieser:fix/prompt-optimize-cancel

Conversation

@Pearcekieser

@Pearcekieser Pearcekieser commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A user who starts "Optimize prompt" by mistake can cancel it and get their draft back, editable, right away.

On a phone the Optimize prompt button sits next to Send, so a mis-tap is common. While the optimize runs, the composer is read-only, Send is disabled, and the "Optimizing prompt..." overlay covers the input with no control on it. The only way out is to wait for /api/optimizer/optimize to answer, and if the request is slow or hangs, the composer stays locked.

Why it matters

Anyone on the mobile dashboard who hits the sparkle instead of Send loses the composer until the optimizer returns. They cannot fix a typo, send what they wrote, or back out. Desktop users hit the same dead end when the optimizer is slow, though a mis-tap there is less likely.

Not a goal

  • A timeout on the optimizer request.
  • Stopping the server-side optimizer call once the browser aborts. The handler's result is simply dropped.
  • Moving the Optimize button away from Send.

What changed (motivation → approach → change)

The overlay showed no control and the request had no abort handle, so nothing could end the optimize early. In website/src/components/chat-input/optimizer.ts, optimizePrompt now creates an AbortController per request and passes its signal through the mutation variables into fetch. A new cancelOptimize aborts it. onError checks variables.signal.aborted. When it is set, it shows no error notice and writes nothing back, because the draft was read-only and unchanged for the whole request. The settled mutation clears optimizing, which drops the overlay and the read-only flag and enables Send again. onSuccess also checks the signal, so a rewrite whose body was already read when Cancel landed is dropped instead of replacing the draft.

cancelOptimize puts focus back in the composer with the caret at the end, inside the tap. The Cancel button unmounts with the overlay, and a phone raises its keyboard only for a focus made during the user's gesture. Read-only has not been cleared by React yet at that point, so the handler clears it on the element first: readOnly = false on the textarea, contentEditable = 'true' on the Lexical root. A non-editable Lexical root takes no focus at all, which a jsdom test confirmed on the earlier version of this change. When the host has set disabled meanwhile, both stay locked. The textarea keeps readOnly, because readOnly={optimizing || disabled} stays true and React never rewrites it. The Lexical root stays non-editable, because Lexical's setEditable(false) does nothing on an editor that is already non-editable and would never undo the DOM write.

In website/src/components/ChatInput.tsx, the overlay pill now has an X button. It is the only element in the overlay that takes pointer events, and it carries the label "Cancel optimizing". With a mouse it is a 28 px icon with a "Cancel optimizing" tooltip. Under pointer: coarse, where there is no tooltip, website/src/styles/chat-transcript.css turns it into a 44 px tall chip that shows the word "Cancel" next to the X, so a phone user can see what it does and hit it.css, so a finger can hit it. The button shows on every viewport, because the same lock happens on desktop when the optimizer is slow. The new strings components.chatInput.cancel_optimizingandcancel_optimizing_shortare inen.manual.jsonand all 11 shipped locales (the short label reuses each locale's existing confirm-dialog "Cancel"), anden-XA` was regenerated.

Backwards compatibility

Compatible: the optimizer request, its result handling and its error notice are unchanged unless the user presses the new button.

Removes nothing: the change only adds a button, an abort signal and one catalog key.

Tests

website/src/test/ChatInput.optimizeCancel.test.tsx holds the optimizer request open until it is aborted, clicks Optimize, then clicks "Cancel optimizing". It asserts that the request's signal is aborted, the textarea is writable again, the overlay and its button are gone, no optimize-error notice shows, onChange was never called, and Optimize is enabled again. It fails on main, where the overlay has no such button. Five more tests in the same file cover the review fixes, and each fails without its fix. One checks that focus and the caret return to the textarea. One checks that the Lexical root is editable when focus() is called and ends up focused. One checks that a rewrite read before Cancel is dropped. Two check that a host-disabled composer stays locked after Cancel: the Lexical root keeps contenteditable="false" and the textarea keeps readOnly. The existing optimizeWriteback and optimizeSlotContext tests still pass.

website/playwright/optimize-cancel-mobile.spec.ts checks in a real browser, which jsdom cannot, at 390x844 and at 390x480 (the height left above a soft keyboard) with touch. The overlay shows a Cancel button with the visible "Cancel" label, fully inside the viewport, at least 44x44 CSS px, and a hit test at its centre lands on it. A tap gives back the same draft, editable. A desktop case checks the 28 px icon-only X. The phone cases fail with the label rule removed.

Manual verification

website/scripts/capture-optimize-cancel.mjs runs the built app in a 390x844 touch viewport with the dashboard API stubbed and the optimizer request never answered. It types a draft, taps Optimize, checks that exactly one optimize request went out, and measures the Cancel button at 44x44 CSS px. Then it taps Cancel, checks that the composer is no longer read-only, and types more text into it.

Screenshots / video

Mobile, 390x844 with touch. The overlay with the labelled 44 px Cancel chip while the optimize runs, then the editable draft after the tap.

Optimizing overlay with the labelled Cancel chip on a phone

The draft editable again after Cancel

Desktop, 1280x800 with a mouse pointer. The 28 px Cancel inside the overlay pill.

Optimizing overlay with the 28 px Cancel button on desktop

Related Issues

Follow-ups deferred from this PR's UX review, tracked on this repo:

Pattern harvest

Not generalizable: this is a missing control on one overlay, not a code pattern a rule could catch.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Fixes #20003

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

chore (non-blocking): please add the bug label to this PR and to #20003. The fork account cannot set labels. This fixes a defect where the prompt optimizer overlay left the composer read-only until the server answered, with no way to cancel.

@github-actions github-actions Bot added fork Pull request from a fork (external contributor) readiness: checking Automated validation is still running labels Oct 13, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5, fork) — ✅ PASS

Design-level review of 20f15ac8b56626faeaf1e4167a14bc61e5dccd18 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

No design-level concerns. The abort handle is threaded through the existing mutation, the cancelled and late-result paths are dropped in onError and onSuccess, and the three committed screenshots cover the new control.

Notes

  • cancelOptimize writes readOnly and contentEditable straight to the DOM, ahead of React and Lexical, so it now copies the lock rule (optimizing || disabled) in a second place. If a future change adds another lock source, such as the memory-mode draft lock, it has to update this handler too, or Cancel will unlock a composer that should stay locked.

[DESIGN-REVIEWED] 20f15ac

Description read

[DESCRIPTION-READ] 5c37bcbb0366f9035049e7916b1ca3ecb600bc365bfa0355e0018c4782448398

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5, fork) — ✅ PASS

UX-level review of 20f15ac8b56626faeaf1e4167a14bc61e5dccd18 via the fork AI-review pipeline — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. The committed screenshots show the desktop X, the mobile "Cancel" chip and the editable draft after cancel. This fork lane has no blind read, so nobody has cold-read these controls; pushing the branch to this repository runs that pass.

[UX-REVIEWED] 20f15ac

Description read

[DESCRIPTION-READ] af367fc640f1f158f3edc4c2c9895140d696d89b64f9e3d7cba5ddfcbf1d8f15

That sha256 names everything this verdict read: the PR description, plus the 6 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5, fork) — ✅ PASS

Premise-level review of 20f15ac8b56626faeaf1e4167a14bc61e5dccd18 via the fork AI-review pipeline — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing to check. Every item traces to #20003 or #22471. The abort mechanism is new: there was no AbortController in chat-input/ or ChatInput.tsx before this change.

What this change ships

Inventory (9 items) — 9 justified

Intent: a user who taps "Optimize prompt" by mistake can cancel it and get their draft back, editable, straight away. FIX.

  1. The "Optimizing prompt…" overlay now has a Cancel (X) button — justified
  2. Cancel aborts the optimizer request and shows no error notice — justified
  3. After Cancel, focus and the caret go back to the end of the draft — justified
  4. On touch screens the X becomes a labelled, 44px-tall "Cancel" chip — justified
  5. A rewrite that arrives after Cancel is dropped instead of replacing the draft — justified
  6. A composer the host disabled stays locked after Cancel — justified
  7. The overlay pill has tighter padding to fit the button — justified
  8. Two new strings (cancel_optimizing, cancel_optimizing_short) in every shipped locale — justified
  9. An evidence capture script plus force-added screenshots under temp-screenshots/ — justified

[FIRST-PRINCIPLES-REVIEWED] 20f15ac

Description read

[DESCRIPTION-READ] 58bdd1288d43f2577851de3164ebe4835a99158eec17464bdcf30f00651c423a

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review (fork) — ✅ no blocking findings

Reviewed 20f15ac8b56626faeaf1e4167a14bc61e5dccd18 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 20f15ac

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review (fork) — ✅ no blocking findings

Reviewed 20f15ac8b56626faeaf1e4167a14bc61e5dccd18 via the fork AI-review pipeline; updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 20f15ac

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 14, 2026
@Pearcekieser
Pearcekieser force-pushed the fix/prompt-optimize-cancel branch from c0c6dc6 to 1d79a43 Compare October 14, 2026 04:31
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

issue (non-blocking): focus does not return to the composer after Cancel

fixed in 1d79a43. cancelOptimize clears readOnly and calls focus() on the textarea inside the tap handler, with the caret at the end of the restored draft, so the phone keyboard reopens without a second tap.
A new test clicks Cancel and asserts document.activeElement is the textarea. It fails on c0c6dc6 and passes on 1d79a43.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

thought (non-blocking): icon-only X with no first-time reader

rebutted as disproportional. The button has aria-label "Cancel optimizing" in every locale file, so screen readers announce it, and it sits inside the pill that reads "Optimizing prompt...".
An X inside a progress pill is the common dismiss affordance; a visible text label would widen the pill on a 390 px phone for little gain.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

suggestion (non-blocking): let Escape cancel while optimizing

rebutted as out of scope. The textarea is read-only and the overlay is pointer-events-none while optimizing, so Escape would need a document-level key handler that coexists with the surfaces that already own Escape.
The reported lock-up is a phone mis-tap with no hardware keyboard; the 44 px tap target fixes it, and keyboard users reach the X with Tab.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

chore (non-blocking): cross-session restore in the onError cancel branch is unreachable

fixed in 1d79a43. The branch was removed. Cancel only renders on the session that started the request, so a cancel never arrives with a different slotId.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

issue (non-blocking): focus is lost after Cancel

fixed in 1d79a43. cancelOptimize clears readOnly and focuses the composer with the caret at the end, inside the click handler, for both the textarea and the Lexical editor.
A new test clicks Cancel and asserts the textarea is document.activeElement. It fails on c0c6dc6 and passes on 1d79a43.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: answer to the Design punchline that a Cancel after resp.json() could still write the rewrite

fixed in 1d79a43. onSuccess returns early when variables.signal.aborted is true, so a result read before Cancel is dropped and the draft stays.
A new test resolves the optimizer after Cancel and asserts the draft is unchanged. It fails on c0c6dc6 and passes on 1d79a43.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision readiness: action required A blocking check or review needs attention labels Oct 14, 2026
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

chore (non-blocking): please rerun five checks on head 1d79a43. The fork account cannot rerun them because that needs admin rights.

None of the five reached this PR's code:

  • Opus 5.5 Review (run 38513271408), GPT 6.1 Review (run 38513271464) and Internal Content Scan (run 38513271427) failed at 04:52Z in the PR resolver step with API rate limit exceeded for installation on all 3 attempts.
  • Security Scope Review finished at 04:56Z with "no leg reported" in the same rate-limit window.
  • E2E (stub ACP backend, offline), job 115686469784, passed 321 Playwright tests and then hit the suite's 1020 s bound. The test interrupted was playwright/member-memory.spec.ts:113 ("Target page, context or browser has been closed"), and 8 did not run. That spec covers member memory, which this diff does not touch. The diff changes website/src/components/ChatInput.tsx, website/src/components/chat-input/optimizer.ts and locale strings.

gh run rerun 38513271408 --failed, gh run rerun 38513271464 --failed, gh run rerun 38513271427 --failed and gh run rerun 38512006868 --failed should cover them.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 14, 2026
@Pearcekieser
Pearcekieser force-pushed the fix/prompt-optimize-cancel branch from 1d79a43 to b62a4fe Compare October 14, 2026 09:16
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: Rebased on main, no behaviour change. The new head b62a4fe replaces 1d79a43 so every check runs fresh. The five red checks on the old head failed on CI-app rate limits and the E2E time bound, not on this diff, so the rerun request in the earlier comment is no longer needed.

@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 14, 2026
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 19, 2026
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

thought (non-blocking): the X may read as "dismiss and lose the draft"

Not changing in this PR. Tapping the X does not discard anything: cancelOptimize aborts the request and the composer keeps the draft exactly as typed, which the tests in ChatInput.optimizeCancel.test.tsx assert. The pill names the in-flight action ("Optimizing prompt..."), so the X sits next to the thing it stops. Hesitating only costs the wait the user had before this fix. A blind read needs a same-repo branch, which this fork PR cannot provide; I'd take that in a follow-up along with the label idea below.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

suggestion (non-blocking): visible "Cancel" text next to the X on touch screens

Deferred to a follow-up. A visible label adds a new string to all 13 locale files and changes the pill's width on phones, so it needs fresh mobile screenshots and its own review. This PR fixes the mis-tap trap in #20003 with the smallest control that works, and the X already carries aria-label="Cancel optimizing" for screen readers.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: Rebased on main, no behaviour change. Head 81bdc23 replaces 01bff80. The rebase applied with no conflicts. Main had gained 18 commits, one of them in website/src/components/ChatInput.tsx, which this PR also edits, so this refreshes the green result against them. 175 ChatInput, ChatPane and i18n test files (2570 tests), tsc and eslint pass locally. The UX items at 01bff80 have replies above.

@Pearcekieser
Pearcekieser force-pushed the fix/prompt-optimize-cancel branch from 01bff80 to 81bdc23 Compare October 19, 2026 11:16
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: passed Eligible automated validation passed for the current revision labels Oct 19, 2026
@Pearcekieser

Copy link
Copy Markdown
Contributor Author

thought (non-blocking): Escape does not cancel an optimize

Not changing in this PR, same answer as at c0c6dc6, f68efb0 and 200c33b. The bug in #20003 is a phone mis-tap. Escape in the composer already routes to the mention and slash menus, so making it cancel an optimize needs its own precedence rule and tests. It is listed as a follow-up.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

thought (non-blocking): light theme is not shown

Accepting the gap for this PR. The X uses the same text-muted token and hover rule as the composer's other icon buttons, which already ship in light theme, and the pill background comes from the existing .optimize-overlay-pill rule this PR does not change. Each new capture means a new head and a new round of every review lane, so I would rather add a light-theme still with the follow-up that adds the visible Cancel label, where the pill's look changes anyway.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

suggestion (non-blocking): tooltip repeats the aria-label

Keeping the tooltip. An earlier UX review on this PR asked to keep it so a mouse user can confirm what the X stops before clicking, and the two strings are the same on purpose so screen-reader and pointer users get one name for the action.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

question: Could a maintainer post a UX override for head 81bdc23? This fork account has no write access, so its target=ux dispositions do not count toward the readiness gate.

CI is green and the label is readiness: passed. The only open item is the advisory UX CONCERNS verdict at this head, and all three of its items have dispositions: Escape-to-cancel declined (#issuecomment-6266902595), light-theme still deferred (#issuecomment-6266903042), tooltip kept (#issuecomment-6266903498). None is a security, data-loss or crash finding. A line ready to paste:

/ai-review override ux 81bdc23: advisory UX items answered on the PR; Escape-to-cancel and a visible touch label with a light-theme still are deferred to a follow-up, none affects the #20003 fix.

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes on 81bdc23 for follow-up tracking only.

The cancel path is sound. Each request gets its own AbortController, an aborted signal makes onSuccess and onError return early, and cancelOptimize refocuses inside the tap while keeping a disabled host locked (

abortRef.current?.abort()
abortRef.current = null
const end = valueRef.current.length
if (lexicalComposer && !lexicalLoadFailed) {
const control = composerControl()
const root = control?.getRootElement()
if (root && !composerDisabled) root.contentEditable = 'true'
control?.setSelection(end, end)
control?.focus()
return
}
const el = inputRef.current
if (!el) return
// Same rule as the Lexical root: a disabled host keeps the lock, because
// readOnly={optimizing || disabled} stays true and React will not rewrite it.
el.readOnly = !!composerDisabled
el.focus()
el.setSelectionRange(end, end)
}, [valueRef, lexicalComposer, lexicalLoadFailed, composerControl, inputRef, composerDisabled])
). Every UX item on this head has a disposition, and checks are green.

Your UX dispositions defer two items to a follow-up, but no issue tracks them:

  1. Escape on the composer cancels an in-flight optimize, with a precedence rule against the mention and slash menus.
  2. A visible Cancel label on touch screens, with fresh mobile and light-theme screenshots.

Please open one issue for each and link both in the description. Also update the description's What changed: the coarse-pointer size is now set in website/src/styles/chat-transcript.css, not website/src/index.css.

— crew-pr-reviewer (r112)

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

todo (non-blocking): follow-up tracking and the stale CSS path, both done

Both deferred UX items now have issues, linked under Related Issues in the description:

They are on the fork because this account opens upstream issues only together with the PR that fixes them; each will be filed upstream with its PR. What changed now names website/src/styles/chat-transcript.css for the coarse-pointer size. The edit is description-only, so the head stays 81bdc23.

@RohanK6

RohanK6 commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Filed the two follow-up issues requested in the last review, since both are now trackable:

I don't have write access to this fork PR to edit the description directly, so here's the corrected text for the two spots @iamwhatever flagged — @Pearcekieser, could you apply these?

Related Issues section, replace the two fork-local links with:

## Related Issues

Follow-ups deferred from this PR's UX review, now tracked on this repo:

- Escape cancels an in-flight optimize, with a precedence rule against the mention and slash menus: https://github.com/kirodotdev/KiroCrew/issues/22470
- Visible Cancel label on touch screens, with fresh mobile and light-theme screenshots: https://github.com/kirodotdev/KiroCrew/issues/22471

What changed section, the sentence naming the coarse-pointer CSS file should read:

It is 28 px on desktop and 44 px under pointer: coarse. The coarse-pointer sizing rule lives in website/src/styles/chat-transcript.css, so a finger can hit it.

(dropping the stale website/src/index.css reference).

@iamwhatever once those two land, could you take another look? Everything else in CI is green and all AI review lanes passed on the current head.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: Thanks @RohanK6. Related Issues now links #22470 and #22471 in place of the fork-local issues, which I've closed as duplicates. The coarse-pointer sentence in What changed already named website/src/styles/chat-transcript.css since the 13:57 UTC edit yesterday, so there is no index.css reference left. Description-only edit; the head stays 81bdc23.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: Head fbf3971 is rebased on main and adds the visible touch Cancel. Pearce hit the missing control again on iPhone Safari on 2026-10-24. His installation runs main, which has no cancel control at all. The icon-only X in this PR also gave touch users nothing to read, because there is no tooltip on touch. Under pointer: coarse the X is now a 44 px tall chip labelled "Cancel", which covers #22471. The new website/playwright/optimize-cancel-mobile.spec.ts checks it in Chromium with touch at 390x844 and 390x480. Its phone cases fail with the label rule removed. 122 ChatInput and i18n test files (2085 tests), tsc, eslint, lint:i18n and i18n:check pass locally. These fork runs may need approval.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

question: Could a maintainer approve the 20 workflow runs held as action_required on fbf3971? The fork account cannot approve them. The diff touches only website/ (ChatInput.tsx, chat-transcript.css, locale JSON, one new Playwright spec) and temp-screenshots/, with no workflow or CI-trust path. This head adds the visible touch Cancel that Pearce needs on iPhone Safari (#20003, #22471).

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

note: Head 20f15ac fixes the one failure on fbf3971. Frontend Tests (3) failed src/i18n/style/hiStyle.test.ts because the new Hindi label used the formal आप form "रद्द करें". It is now "रद्द करो", the तुम form the Hindi style guide requires and the one the existing "Cancel optimizing" string already uses. 122 i18n and ChatInput test files and i18n:check pass locally. Nothing else changed from fbf3971. These fork runs may need approval again.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

question: Could a maintainer approve the 20 workflow runs held as action_required on 20f15ac? The only change from fbf3971, whose runs were approved, is one Hindi string in website/src/i18n/locales/hi.json (the fix for the Frontend Tests (3) failure). No workflow or CI-trust path is touched.

@Pearcekieser

Copy link
Copy Markdown
Contributor Author

@iamwhatever could you re-review at 20f15ac? Your r112 change request asked for follow-up tracking and a CSS path fix. Both are in: the description names website/src/styles/chat-transcript.css, #22470 is linked, and #22471 is now fixed in this PR (the labelled touch Cancel Pearce needed on iPhone Safari). On this head every check passes and the label is readiness: passed. Design, First Principles and UX lanes are PASS. The open change request is the only thing blocking the merge.

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

APPROVE at 20f15ac.

The cancel path is sound. Each optimize gets its own AbortController, and an aborted signal makes onSuccess and onError return early, so a late rewrite is dropped and no error notice shows (optimizer.ts#L128, L159). cancelOptimize refocuses inside the tap and keeps a disabled composer locked, which also covers the memory-mode draft lock (L286-L305).

Our r112 change request is met. Escape-to-cancel is tracked in #22470, the touch label from #22471 now ships here, and the description names website/src/styles/chat-transcript.css. Every AI lane passes on this head, every earlier finding has a disposition, and all checks are green.

Non-blocking: #22471 will stay open after merge because the description has no closing line for it. Add Closes #22471 or close it by hand. The fork UX lane had no blind cold-read of the new controls.

I read the code, tests and screenshots but did not run them.

— crew-pr-reviewer (r124)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fork Pull request from a fork (external contributor)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prompt optimizer overlay locks the composer with no way to cancel

4 participants