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

`U` in the terminal's workspace asks before it stops mirroring to the source, naming the source and saying there is no way back #7994

Merged opened this

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

Merged

Pressing `U` in the terminal's workspace now asks before it stops mirroring. It opens a "Stop mirroring" dialog that names the repository and the source, with Cancel selected first. Only choosing "Stop mirroring" calls `stopMirroring`.

shipped production is serving it deploy f0961d3

opened this

Pressing U in the terminal's workspace now asks before it stops mirroring. It opens a "Stop mirroring" dialog that names the repository and the source, with Cancel selected first. Only choosing "Stop mirroring" calls stopMirroring.

What changed

  • src/tui/screens/workspace.ts: only the U branch changed. It now pushes the same confirmScreen that Stop uses in deploys.ts.

- The question reads Stop mirroring <owner>/<name> to <source>?, where the source is the same mirror target mirrorLine reads. - The buttons are Cancel (ghost) and "Stop mirroring" (danger). - Cancel, esc or q changes nothing. The "stopped mirroring" and "not mirrored" toasts are unchanged. - The key line still offers U only to an admin of a mirrored repository.

  • test/tui-workspace-unmirror.test.ts (new) checks that:

- the dialog names alice/lighthouse and octo/lighthouse; - pressing enter as the dialog opens, or esc, leaves the mirror target in place; - U, right, enter removes it; - a user who is not an admin sees no U in the help, and pressing U does nothing.

With the change reverted, the Cancel test fails.

  • test/tui-workspace.test.ts: the existing "U stops mirroring" test pressed U alone and expected the mirror to be gone. That was right before this change and is now out of date, so it presses U, right, enter.

What to look at: the dialog cuts off lines longer than its width instead of wrapping them. So the dialog is 64 columns wide and the sentence after the question is split across two lines ("Nothing more is pushed there, and this cannot be" / "turned back on from here."). The wording is the issue's. A very long owner or source name can still be cut off on the first line.

How to try it: open a mirrored repository in the terminal as its admin and press U. Enter keeps the mirror; → then enter stops it.

bun test test/tui-workspace-unmirror.test.ts test/tui-workspace.test.ts passed (26 tests), and bun scripts/gate.ts and bun x tsc --noEmit both came back clean. src/web/ is untouched, so the design lint was not needed.

🤖 Generated with Claude Code

Closes #7986

commented

Pressing U in the terminal's workspace now asks before it stops mirroring. It opens a "Stop mirroring" dialog that names the repository and the source, with Cancel selected first. Only choosing "Stop mirroring" calls stopMirroring.

What changed

  • src/tui/screens/workspace.ts: only the U branch changed. It now pushes the same confirmScreen that Stop uses in deploys.ts.

- The question reads Stop mirroring <owner>/<name> to <source>?, where the source is the same mirror target mirrorLine reads. - The buttons are Cancel (ghost) and "Stop mirroring" (danger). - Cancel, esc or q changes nothing. The "stopped mirroring" and "not mirrored" toasts are unchanged. - The key line still offers U only to an admin of a mirrored repository.

  • test/tui-workspace-unmirror.test.ts (new) checks that:

- the dialog names alice/lighthouse and octo/lighthouse; - pressing enter as the dialog opens, or esc, leaves the mirror target in place; - U, right, enter removes it; - a user who is not an admin sees no U in the help, and pressing U does nothing.

With the change reverted, the Cancel test fails.

  • test/tui-workspace.test.ts: the existing "U stops mirroring" test pressed U alone and expected the mirror to be gone. That was right before this change and is now out of date, so it presses U, right, enter.

What to look at: the dialog cuts off lines longer than its width instead of wrapping them. So the dialog is 64 columns wide and the sentence after the question is split across two lines ("Nothing more is pushed there, and this cannot be" / "turned back on from here."). The wording is the issue's. A very long owner or source name can still be cut off on the first line.

How to try it: open a mirrored repository in the terminal as its admin and press U. Enter keeps the mirror; → then enter stops it.

bun test test/tui-workspace-unmirror.test.ts test/tui-workspace.test.ts passed (26 tests), and bun scripts/gate.ts and bun x tsc --noEmit both came back clean. src/web/ is untouched, so the design lint was not needed.

🤖 Generated with Claude Code

Approved

Reads clean. U now pushes the shared confirmScreen with Cancel selected first; only choice 1 calls stopMirroring, and the admin and mirror-target gate on the key is unchanged, so authorization is not widened. Tests cover the dialog text, Cancel and esc keeping the mirror, the Stop path, and a non-admin; the old test was rightly updated. Non-blocking nit: the ?? "" fallback on source is unreachable given the getMirrorTarget guard in the condition; reusing that value would be tidier. The README does not mention U (docs/ORIGINS.md does and is still true), so no doc change is needed.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs