fix(tui): reset permission sub-screen when the request changes - #45284
Open
aniruddhaadak80 wants to merge 2 commits into
Open
fix(tui): reset permission sub-screen when the request changes#45284aniruddhaadak80 wants to merge 2 commits into
aniruddhaadak80 wants to merge 2 commits into
Conversation
The session view renders a single <PermissionPrompt> bound to permissions()[0] for every queued request. When the user answers a request through the "always" or "reject" sub-screen, the component's local store.stage is left on that sub-screen. As soon as the next queued request becomes permissions()[0], Solid reuses the same component instance with a new request prop, so store.stage carries over and the new request is shown on the "Always allow" / reject screen instead of the permission prompt. Reset store.stage to "permission" whenever the request id changes so each request starts on the correct screen.
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
1 similar comment
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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
Fixes #45297
Type of change
What does this PR do?
When more than one permission request is queued, the session view renders a single
<PermissionPrompt request={permissions()[0]}>. Resolving a request through the "always" or "reject" sub-screen leaves the component's localstore.stageon that sub-screen. The next queued request becomespermissions()[0], but Solid reuses the same component instance (theShowcondition stays truthy) and only updates therequestprop — sostore.stagecarries over and the new request is shown on the "Always allow" / reject screen instead of the permission prompt. This adds acreateEffect(on(() => props.request.id, ...))that resetsstore.stageto"permission"whenever the request id changes, so every queued request starts on the correct screen.How did you verify your code works?
bun typecheck(packages/tui) → cleanpermissions().length > 1; for the first choose Allow always; request Roadmap & Existing Issues #2 becomespermissions()[0]but the prompt still showed the "Always allow" screen before this fix.Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist