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

Fork offers, following upstream and detaching can be done from the terminal, with the same words as the pages #15357

Merged opened this

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

Merged

The terminal already had all four actions. What was missing was the how-to that records them, so I added that, took the four pages off the doorless list and added a test. No terminal code changed.

Notes

shipped production is serving it deploy 0adf720

opened this

The terminal already had all four actions. What was missing was the how-to that records them, so I added that, took the four pages off the doorless list and added a test. No terminal code changed.

What the terminal already does, with the same src/actions functions as the pages:

  • Offers: the Forks screen lists the offers forks sent (forkOffers), and a fork's own screen lists what it sent (sentOffers).
  • Offering upstream: offerCommit on a commit, offerPull on a merged pull, and u on the Forks screen to propose.
  • Follow mode: m on the Forks screen calls setFollowMode, and z undoes the last change.
  • Detach: x on a fork's About card. It dry-runs detachFromParent, shows detachPlanWords in a confirm dialog, and only starts the real detach on "Detach".

What changed:

  • New how-to: docs/features/fork-tree-terminal.md names both doors for each of the four actions, with the page file and the terminal file. scripts/doorless.ts counts a page as having a terminal door when a how-to names both.
  • Allow list: scripts/doorless-allow.json lost detach.ts, fork-offers.ts, offer-upstream.ts and upstream-follow.ts (bun scripts/doorless.ts --write).
  • Tests: the new test/tui-fork-offers.test.ts has three cases.
    • The upstream's Forks screen lists a fork's offer from a fixture.
    • Detach shows its plan first, and when dismissed no job starts and forkParentId is unchanged.
    • Someone with no standing on the fork is not offered the x key.

bun scripts/gate.ts --fix, tsc --noEmit and test/tui-fork-offers.test.ts, test/doorless.test.ts and test/feature-orphans.test.ts pass. I did not run the whole suite; the forge's check does that.

What I left out:

  • I did not touch the terminal code, since it already did the job.
  • I did not test the confirmed path, where "Detach" is chosen and the repack runs. test/fork-detach.test.ts covers that, and I chose not to run a repack in a screen test.

To try it: open a fork over ssh and press I for the About card, then x. Press esc at the confirm and nothing changes. On the fork's Forks screen, m changes how it follows.

Closes #15354

commented

The terminal already had all four actions. What was missing was the how-to that records them, so I added that, took the four pages off the doorless list and added a test. No terminal code changed.

What the terminal already does, with the same src/actions functions as the pages:

  • Offers: the Forks screen lists the offers forks sent (forkOffers), and a fork's own screen lists what it sent (sentOffers).
  • Offering upstream: offerCommit on a commit, offerPull on a merged pull, and u on the Forks screen to propose.
  • Follow mode: m on the Forks screen calls setFollowMode, and z undoes the last change.
  • Detach: x on a fork's About card. It dry-runs detachFromParent, shows detachPlanWords in a confirm dialog, and only starts the real detach on "Detach".

What changed:

  • New how-to: docs/features/fork-tree-terminal.md names both doors for each of the four actions, with the page file and the terminal file. scripts/doorless.ts counts a page as having a terminal door when a how-to names both.
  • Allow list: scripts/doorless-allow.json lost detach.ts, fork-offers.ts, offer-upstream.ts and upstream-follow.ts (bun scripts/doorless.ts --write).
  • Tests: the new test/tui-fork-offers.test.ts has three cases.
    • The upstream's Forks screen lists a fork's offer from a fixture.
    • Detach shows its plan first, and when dismissed no job starts and forkParentId is unchanged.
    • Someone with no standing on the fork is not offered the x key.

bun scripts/gate.ts --fix, tsc --noEmit and test/tui-fork-offers.test.ts, test/doorless.test.ts and test/feature-orphans.test.ts pass. I did not run the whole suite; the forge's check does that.

What I left out:

  • I did not touch the terminal code, since it already did the job.
  • I did not test the confirmed path, where "Detach" is chosen and the repack runs. test/fork-detach.test.ts covers that, and I chose not to run a repack in a screen test.

To try it: open a fork over ssh and press I for the About card, then x. Press esc at the confirm and nothing changes. On the fork's Forks screen, m changes how it follows.

commented

The failed check on #15357 is fixed and pushed. The gate flagged the two as never casts on the key presses in test/tui-fork-offers.test.ts. I replaced them with a press(key) helper that builds a full KeyEvent.

Run locally after the change, bun scripts/gate.ts now prints nothing, tsc --noEmit is clean, and the three tests in that file pass.

The pull is otherwise as described before: the terminal already had all four actions, and the pull adds the how-to, takes the four pages off the doorless list and adds the test.

Approved

Approved. The terminal already carried all four actions (forks.ts offers/follow mode, commits.ts and pull.ts offers, about.ts detach with a dry-run plan and confirm), each through the same src/actions function as its page; this pull records that in docs/features/fork-tree-terminal.md (not README), drops the four pages from the doorless list, and tests the offer listing and the unconfirmed detach. No new code, dependency or TODO. The preview answers 200; this change touches no page. Next two things: (1) add a test of the confirmed Detach path at the screen level with a stubbed job, so the wiring of onChoose is covered beside the esc case; (2) add a test that the Forks screen m key cycles the follow mode, since the how-to promises it and only offers are tested.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs