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

A test pins the terminal's history: the log pages through a real "load more" row, and a commit opens its diff #7003

Merged opened this

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

Merged

I added `test/tui-commits.test.ts`, and it found nothing wrong in `src/tui/screens/commits.ts`, so I changed no source. The new test and `bun x tsc --noEmit` both pass.

shipped production is serving it deploy 7042057

opened this

I added test/tui-commits.test.ts, and it found nothing wrong in src/tui/screens/commits.ts, so I changed no source. The new test and bun x tsc --noEmit both pass.

The test builds a real repository with 57 commits, one more than a 50-commit page can hold, plus a side branch. It drives commitsScreen against the real local source with a stub Ctx and reads the rendered text.

  • Paging:

- The first page is newest first and ends in a "Load more…" row. - Moving the cursor down 50 rows lands on that row. - Pressing enter appends the next page, with no commit twice and none missing, and the row then goes away.

  • Opening a commit: Pressing enter on a commit pushes the commit screen. It shows that commit's message and the diff of its one file (- count 54 / + count 55).
  • A non-default branch: side shows its own commit, "side only work". The default branch's log does not.

I left out a "short log has no load-more row" test. My first version failed because side forks from the default branch, so it carries the full history. The test file doesn't cover that case.

I did not run the full check. The forge runs it on the push.

Closes #6982

commented

I added test/tui-commits.test.ts, and it found nothing wrong in src/tui/screens/commits.ts, so I changed no source. The new test and bun x tsc --noEmit both pass.

The test builds a real repository with 57 commits, one more than a 50-commit page can hold, plus a side branch. It drives commitsScreen against the real local source with a stub Ctx and reads the rendered text.

  • Paging:

- The first page is newest first and ends in a "Load more…" row. - Moving the cursor down 50 rows lands on that row. - Pressing enter appends the next page, with no commit twice and none missing, and the row then goes away.

  • Opening a commit: Pressing enter on a commit pushes the commit screen. It shows that commit's message and the diff of its one file (- count 54 / + count 55).
  • A non-default branch: side shows its own commit, "side only work". The default branch's log does not.

I left out a "short log has no load-more row" test. My first version failed because side forks from the default branch, so it carries the full history. The test file doesn't cover that case.

I did not run the full check. The forge runs it on the push.

Approved

Test-only, one new file, no source or dependency change; it drives the real commitsScreen against a real 57-commit repo and covers paging, the Load more row, opening a commit with its diff, and a second branch. Nothing here touches identity, writes or the web UI, so the security and preview items do not apply. Two things I would do next: (1) the assertion not.toContain(change #N\n) in the first-page test depends on how Surface.toText pads rows and may pass vacuously; assert on the parsed subjects list length (it equals PAGE) instead. (2) Add the short-log case (no Load more row) using a repo with fewer than 50 commits, which the pull notes it left out.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs