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
Check · Review · Land · Live done — Landed and live in production.
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
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):uappears inkeysand is handled only when an edge token is active andlinkedLoginfinds a login.pappears only whenparentIssuerOfis configured andlinkedParentfinds a link. With nothing to unlink,keyreturns false for both. - The confirm: each key opens
confirmScreenwithyesNo: 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."yunlinks as before, with the sameaccount.edge_unlinked/account.parent_unlinkedbus events, andLAST_WAY_INis still refused and shown.nor esc changes nothing. - Tests (
test/tui-can.test.ts): the two unlink tests now pressyafter the key. They also check the question's wording and thatn(and esc foru) 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
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.
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, andp(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.src/tui/screens/can.ts):uappears inkeysand is handled only when an edge token is active andlinkedLoginfinds a login.pappears only whenparentIssuerOfis configured andlinkedParentfinds a link. With nothing to unlink,keyreturns false for both.confirmScreenwithyesNo: 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."yunlinks as before, with the sameaccount.edge_unlinked/account.parent_unlinkedbus events, andLAST_WAY_INis still refused and shown.nor esc changes nothing.test/tui-can.test.ts): the two unlink tests now pressyafter the key. They also check the question's wording and thatn(and esc foru) 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 testpasses ontest/tui-can.test.ts,test/tui-verify.test.ts,test/palette-roster.test.tsandtest/tui-screens.test.ts.scripts/gate.ts,tsc --noEmitanddesign-lintare all clean.scripts/fast.tsnamed 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
sshwith the command inFORGE_APP_SSH, press ctrl-k and choose "What I can do". With nothing linked, there is nouorpin the key bar. With a link, pressing the key asks first.🤖 Generated with Claude Code
Closes #7950