Public: anyone can read this; the crew can change it.

Revoking a proposal token in the terminal asks first: `x` names the child, `y` revokes, `n` or esc keeps it #7999

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

On the terminal's Proposal tokens screen, `x` used to revoke the token under the cursor straight away. Now it asks first. It opens `confirmScreen` with `yesNo: true`, titled "Revoke the token for <child>?", with one body line: "<child> can no longer propose here until it is handed a new token." The buttons are **Revoke** (danger) and **Keep** (ghost).

shipped production is serving it deploy b4c82c4

opened this

On the terminal's Proposal tokens screen, x used to revoke the token under the cursor straight away. Now it asks first. It opens confirmScreen with yesNo: true, titled "Revoke the token for <child>?", with one body line: "<child> can no longer propose here until it is handed a new token." The buttons are Revoke (danger) and Keep (ghost).

  • y, or choosing Revoke, calls revokeProposal, and the head line reads "<child>: revoked." as before.
  • n, esc or Keep revokes nothing.
  • x on an empty list still does nothing.

The only code change is in src/tui/screens/proposal_tokens.ts; the rules in actions/proposal_tokens.ts are unchanged.

Tests

  • In test/tui-proposal-tokens.test.ts, the existing x test now checks that the question is shown and the token still exists, then presses y.
  • A new test presses x then n, and x then esc, and checks after each that listProposals still returns the token. It then presses x, y and checks the list is empty.
  • Another new test checks that x on an empty list opens no question.
  • With the screen change removed, the existing x test and the n/esc test both fail.
  • The earlier attempt (#7958) went red because two terminal tests in test/proposal-token-doors.test.ts pressed only x. Those tests were out of date, not the code, so they now press x, y.

Checks run

  • bun scripts/gate.ts and bun x tsc --noEmit are clean.
  • bun scripts/fast.ts named 212 test files, over its 5-minute budget, so I picked the ones that cover the change: tui-proposal-tokens, proposal-token-doors, palette-roster, proposal-token, tui-screens and tui-vision-direction. All pass. tui-vision-direction is included because it failed on #7958's check.

To try it: press ctrl+k, open "Proposal tokens" and enter alice/lib. Mint a token with n, then press x and answer n; the token stays listed. Press x again and answer y; the head line reads "<child>: revoked."

🤖 Generated with Claude Code

Closes #7949

commented

On the terminal's Proposal tokens screen, x used to revoke the token under the cursor straight away. Now it asks first. It opens confirmScreen with yesNo: true, titled "Revoke the token for <child>?", with one body line: "<child> can no longer propose here until it is handed a new token." The buttons are Revoke (danger) and Keep (ghost).

  • y, or choosing Revoke, calls revokeProposal, and the head line reads "<child>: revoked." as before.
  • n, esc or Keep revokes nothing.
  • x on an empty list still does nothing.

The only code change is in src/tui/screens/proposal_tokens.ts; the rules in actions/proposal_tokens.ts are unchanged.

Tests

  • In test/tui-proposal-tokens.test.ts, the existing x test now checks that the question is shown and the token still exists, then presses y.
  • A new test presses x then n, and x then esc, and checks after each that listProposals still returns the token. It then presses x, y and checks the list is empty.
  • Another new test checks that x on an empty list opens no question.
  • With the screen change removed, the existing x test and the n/esc test both fail.
  • The earlier attempt (#7958) went red because two terminal tests in test/proposal-token-doors.test.ts pressed only x. Those tests were out of date, not the code, so they now press x, y.

Checks run

  • bun scripts/gate.ts and bun x tsc --noEmit are clean.
  • bun scripts/fast.ts named 212 test files, over its 5-minute budget, so I picked the ones that cover the change: tui-proposal-tokens, proposal-token-doors, palette-roster, proposal-token, tui-screens and tui-vision-direction. All pass. tui-vision-direction is included because it failed on #7958's check.

To try it: press ctrl+k, open "Proposal tokens" and enter alice/lib. Mint a token with n, then press x and answer n; the token stays listed. Press x again and answer y; the head line reads "<child>: revoked."

🤖 Generated with Claude Code

Changes requested — before the latest push

The confirm works and the tests cover it, but two things need fixing in one round:

  1. (first) The dialog opens with Revoke selected, so a stray Enter revokes. The forge's other danger confirms (signins, invites, appmembers, capacity) default to Keep with selected: 1. Do the same here, and add a test that x then enter keeps the token.
  2. The README/docs still describe x as an instant revoke. Say in docs/FOLLOWING.md (proposal tokens section, terminal door) that x asks first: y revokes, n/esc keeps it.

Also rewrap the file header comment, which is now an overlong line.

commented

On the terminal's Proposal tokens screen, x used to revoke the token under the cursor straight away. Now it asks first. It opens confirmScreen titled "Revoke the token for <child>?", with one body line: "<child> can no longer propose here until it is handed a new token." The buttons are Revoke (danger) and Keep (ghost).

  • The dialog opens with Keep selected (selected: 1), as the forge's other danger confirms do, so a stray enter revokes nothing.
  • y, or choosing Revoke, calls revokeProposal, and the head line reads "<child>: revoked." as before.
  • n, esc, enter on Keep, or choosing Keep revokes nothing.
  • x on an empty list still does nothing.

The only code change is in src/tui/screens/proposal_tokens.ts; the rules in actions/proposal_tokens.ts are unchanged. The file's header comment is rewrapped. The terminal part of the proposal tokens section in docs/FOLLOWING.md now says x asks first.

Tests

  • In test/tui-proposal-tokens.test.ts, the existing x test checks that the question is shown and the token still exists, then presses y.
  • A new test presses x then n, x then esc, and x then enter, and checks after each that listProposals still returns the token. It then presses x, y and checks the list is empty.
  • Another new test checks that x on an empty list opens no question.
  • The new test fails without the confirm. Its x then enter step also fails when the dialog starts on Revoke.
  • Two terminal tests in test/proposal-token-doors.test.ts pressed only x, which is why #7958 went red. They were out of date, not the code, so they now press x, y.

Checks run

  • bun scripts/gate.ts and bun x tsc --noEmit are clean.
  • bun scripts/fast.ts named more test files than its 5-minute budget allows, so I ran the ones that cover the change. On the latest commit, tui-proposal-tokens, proposal-token-doors and palette-roster pass, 15 of 15. On the first commit I also ran proposal-token, tui-screens and tui-vision-direction, which passed; the follow-up only adds selected: 1 and docs.

To try it: press ctrl+k, open "Proposal tokens" and enter alice/lib. Mint a token with n, press esc to close the secret, then press x. Enter, n or esc each leave the token listed; x then y revokes it.

🤖 Generated with Claude Code

Approved

Earlier asks are met. The dialog starts on Keep (selected: 1), so a stray enter revokes nothing. docs/FOLLOWING.md describes the new y/n/esc/enter behaviour. Tests cover x then y, n, esc and enter, and an empty list asking nothing. The two door tests are updated to press x, y. The revoke still goes through revokeProposal, so the repository-write check is unchanged. No new dependencies, no dead code. I did not run the tests or open the preview; the diff since my last head could not be read because that commit is not in the clone, so I judged the change as shown. No blocking findings.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs