fix(app): preserve draft through permission prompts#22495
Open
terminalchai wants to merge 1 commit intoanomalyco:devfrom
Open
fix(app): preserve draft through permission prompts#22495terminalchai wants to merge 1 commit intoanomalyco:devfrom
terminalchai wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate Found:
Why they may be related: Both PRs address the same core issue - preserving draft text when permission prompts appear in the composer. The titles and scope are virtually identical, addressing issue #21320. You should verify the status of PR #21950 (whether it's open/closed/merged) and consolidate efforts if both are active. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #21320
Type of change
What does this PR do?
When a permission prompt blocks the session composer, the
PromptInputwas conditionally unmounted via<Show when={!blocked()}>. Unmounting destroys component state, so any text the user had typed before the prompt appeared (or typed thinking focus was still in the input) was silently discarded when the prompt resolved.The fix replaces the conditional
<Show>with a persistent wrapper<div>that keepsPromptInputmounted at all times. When the session is blocked the wrapper receives thehiddenTailwind class (display:none) andaria-hidden="true", so it is invisible and inaccessible to assistive technology — but the component instance and its internal draft state are preserved. When the block clears both attributes are removed and the input reappears with the draft intact.How did you verify your code works?
bun x prettier --write src/pages/session/composer/session-composer-region.tsx e2e/session/session-composer-dock.spec.ts(frompackages/app)bun run test:e2e -- session/session-composer-dock.spec.ts -g "blocked permission flow preserves typed draft"and-g "keyboard focus stays off prompt while blocked"(frompackages/app)Two new e2e specs cover the regression:
Screenshots / recordings
No visual change in normal usage. The composer looks and behaves identically; draft text simply survives permission prompts now.
Checklist