Skip to content

fix(tui): reset permission sub-screen when the request changes - #45284

Open
aniruddhaadak80 wants to merge 2 commits into
anomalyco:devfrom
aniruddhaadak80:permission-stage-reset
Open

fix(tui): reset permission sub-screen when the request changes#45284
aniruddhaadak80 wants to merge 2 commits into
anomalyco:devfrom
aniruddhaadak80:permission-stage-reset

Conversation

@aniruddhaadak80

@aniruddhaadak80 aniruddhaadak80 commented Aug 26, 2026

Copy link
Copy Markdown

Issue for this PR

Fixes #45297

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

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 local store.stage on that sub-screen. The next queued request becomes permissions()[0], but Solid reuses the same component instance (the Show condition stays truthy) and only updates the request prop — so store.stage carries over and the new request is shown on the "Always allow" / reject screen instead of the permission prompt. This adds a createEffect(on(() => props.request.id, ...)) that resets store.stage to "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) → clean
  • Note: the repo's TUI "component" tests only exercise exported pure helpers (there is no Solid render harness), so this is verified by typecheck + the reproduction below rather than a unit test, consistent with how other TUI fixes in this repo are tested.
  • Reproduction: queue two commands that each need permission so permissions().length > 1; for the first choose Allow always; request Roadmap & Existing Issues #2 becomes permissions()[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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

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.
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Aug 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

Permission sub-screen persists across queued requests

1 participant