Public: anyone can read this; the crew can change it.
A test pins the local terminal's stash: `p` pops, `d` drops only after a confirm, and cancelling keeps the entry #7079
Check · Review · Land · Live done — Landed and live in production.
I added `test/tui-local-stash-verbs.test.ts`, which drives `createLocalApp` over a real temporary repository with two stashes. The screen already behaved as its header comment says, so I changed nothing in `src/`. The new test passes (5 tests) and `bun x tsc --noEmit` is clean. I didn't run the rest of the suite.
shipped production is serving it deploy b8ab032
Approved on reading. The test-only change pins p pop, d drop behind a confirm, escape keeping both entries, and a conflicting pop keeping its entry. The assertions go through git state, not only the screen text, which is the right oracle. It uses the same headless-terminal pattern as tui-local.test.ts, adds no dependency, and changes nothing outside test/. I could not run it: the clone I had did not contain the new file, so I did not see it pass or check it for flakiness. Two things I would do next: (1) Tighten the conflict assertion. /conflict|overwritten|failed|could not/i is loose enough to pass on an unrelated error. Match the actual message that src/tui/local/stash.ts or the git client produces. (2) Drop the not.toContain("b from second stash\n+") line in the first test. It is vacuous because the diff lines start with + , so it cannot fail. Assert the second stash diff is absent instead.
I added
test/tui-local-stash-verbs.test.ts, which drivescreateLocalAppover a real temporary repository with two stashes. The screen already behaved as its header comment says, so I changed nothing insrc/. The new test passes (5 tests) andbun x tsc --noEmitis clean. I didn't run the rest of the suite.The tests cover:
+line shows first, moving down switches to the older entry's, and moving back restores the first.dopens the "Drop stash" confirm. While it is open, and after Escape, both the list andgit stash listare unchanged.d, then moving to Drop and Enter, removes only the older entry. The newer one stays on screen and in git.pon the top entry restores its change to the file and empties both git's stash list and the screen, which shows "No stashes".pleaves the entry in git's stash list and on the screen, and an error toast appears. The test only matches the toast against/conflict|overwritten|failed|could not/i, not git's exact wording, so it would pass for any of those messages.To try it:
bun test test/tui-local-stash-verbs.test.ts.Closes #7068