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

The terminal's "What I can do" offers `u` and `p` only when there is a link to undo, and asks before it unlinks #7955

Merged opened this

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

Merged

The terminal's "What I can do" screen now shows `u` (unlink the open-platform.sh login) only when there is a login to unlink, and `p` (unlink the parent forge) only when there is a parent link. Each key now asks before it unlinks, so an unlink that only the web page can undo is no longer one stray key press away.

shipped production is serving it deploy 78f82e5

opened this

The terminal's "What I can do" screen now shows u (unlink the open-platform.sh login) only when there is a login to unlink, and p (unlink the parent forge) only when there is a parent link. Each key now asks before it unlinks, so an unlink that only the web page can undo is no longer one stray key press away.

  • When a key is offered (src/tui/screens/can.ts): u appears in keys and is handled only when an edge token is active and linkedLogin finds a login. p appears only when parentIssuerOf is configured and linkedParent finds a link. With nothing to unlink, key returns false for both.
  • The confirm: each key opens confirmScreen with yesNo: true. The question is "Unlink open-platform.sh login <login>?" or "Unlink the parent forge?", followed by "It is linked again from Settings on the web." y unlinks as before, with the same account.edge_unlinked / account.parent_unlinked bus events, and LAST_WAY_IN is still refused and shown. n or esc changes nothing.
  • Tests (test/tui-can.test.ts): the two unlink tests now press y after the key. They also check the question's wording and that n (and esc for u) leave the link in place. A new test shows that with nothing linked, neither key is offered and pressing them opens nothing. Run against the old screen, 3 of the 4 tests fail.

bun test passes on test/tui-can.test.ts, test/tui-verify.test.ts, test/palette-roster.test.ts and test/tui-screens.test.ts. scripts/gate.ts, tsc --noEmit and design-lint are all clean. scripts/fast.ts named 211 files (about 17 minutes, over its 5-minute budget), so I ran the test files that open this screen instead and left the full run to the forge's check.

To try it: run ssh with the command in FORGE_APP_SSH, press ctrl-k and choose "What I can do". With nothing linked, there is no u or p in the key bar. With a link, pressing the key asks first.

🤖 Generated with Claude Code

Closes #7950

commented

The terminal's "What I can do" screen now shows u (unlink the open-platform.sh login) only when there is a login to unlink, and p (unlink the parent forge) only when there is a parent link. Each key now asks before it unlinks, so an unlink that only the web page can undo is no longer one stray key press away.

  • When a key is offered (src/tui/screens/can.ts): u appears in keys and is handled only when an edge token is active and linkedLogin finds a login. p appears only when parentIssuerOf is configured and linkedParent finds a link. With nothing to unlink, key returns false for both.
  • The confirm: each key opens confirmScreen with yesNo: true. The question is "Unlink open-platform.sh login <login>?" or "Unlink the parent forge?", followed by "It is linked again from Settings on the web." y unlinks as before, with the same account.edge_unlinked / account.parent_unlinked bus events, and LAST_WAY_IN is still refused and shown. n or esc changes nothing.
  • Tests (test/tui-can.test.ts): the two unlink tests now press y after the key. They also check the question's wording and that n (and esc for u) leave the link in place. A new test shows that with nothing linked, neither key is offered and pressing them opens nothing. Run against the old screen, 3 of the 4 tests fail.

bun test passes on test/tui-can.test.ts, test/tui-verify.test.ts, test/palette-roster.test.ts and test/tui-screens.test.ts. scripts/gate.ts, tsc --noEmit and design-lint are all clean. scripts/fast.ts named 211 files (about 17 minutes, over its 5-minute budget), so I ran the test files that open this screen instead and left the full run to the forge's check.

To try it: run ssh with the command in FORGE_APP_SSH, press ctrl-k and choose "What I can do". With nothing linked, there is no u or p in the key bar. With a link, pressing the key asks first.

🤖 Generated with Claude Code

Approved

Reviewed in full. u and p are offered and handled only when a link exists. Each unlink now asks y/n, and n or esc changes nothing. The same account checks and bus events are kept, and LAST_WAY_IN is still refused. The tests cover the new behaviour and would fail without it. I did not run them or the preview. Small nit, not blocking: edgeLogin duplicates the guard in unlinkableLogin, and the header comment line has grown past the file width.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs