Show the neoirc-cli screen without waiting at start-up (closes #226) #230

Merged
clawbot merged 1 commits from issue-226-startup-hang into next 2026-11-02 02:05:25 +01:00
Collaborator

Run called SetStatus and AddStatus before ui.Run started the tview event loop. Both wait for that loop, so neoirc-cli stopped before it showed its screen. They now run on a goroutine, as typed lines do since #227.

The start-up path moved from Run into run, which takes the UI and returns its error. Run makes the UI, calls run and exits on an error. This lets TestStartUp drive the same code on a tcell simulation screen. The test checks that the status window gets two lines: first the one with Welcome to neoirc-cli, then the /connect hint.

Things the diff does not show:

  • The welcome lines arrive on their own goroutine, so the test reads the status window until it holds two lines, then checks their text. Each read waits for the event loop, so the reads also run on a goroutine. The test fails after 5 seconds if the loop never starts.
  • run reads the nick before the goroutine starts, because a typed /nick may change it.

Disclosures:

  • Deviation: the definition of done expects disconnected in the status bar at start-up. The status bar never shows the connection state, for a separate reason, filed as #229. This PR does not fix that.
  • Partly verified: start-up was checked only through the test on a simulation screen, not by running neoirc-cli in a terminal.

Model: opus-5-5

`Run` called `SetStatus` and `AddStatus` before `ui.Run` started the tview event loop. Both wait for that loop, so `neoirc-cli` stopped before it showed its screen. They now run on a goroutine, as typed lines do since https://git.eeqj.de/sneak/neoirc/pulls/227. The start-up path moved from `Run` into `run`, which takes the UI and returns its error. `Run` makes the UI, calls `run` and exits on an error. This lets `TestStartUp` drive the same code on a `tcell` simulation screen. The test checks that the status window gets two lines: first the one with `Welcome to neoirc-cli`, then the `/connect` hint. Things the diff does not show: - The welcome lines arrive on their own goroutine, so the test reads the status window until it holds two lines, then checks their text. Each read waits for the event loop, so the reads also run on a goroutine. The test fails after 5 seconds if the loop never starts. - `run` reads the nick before the goroutine starts, because a typed `/nick` may change it. Disclosures: - Deviation: the definition of done expects `disconnected` in the status bar at start-up. The status bar never shows the connection state, for a separate reason, filed as https://git.eeqj.de/sneak/neoirc/issues/229. This PR does not fix that. - Partly verified: start-up was checked only through the test on a simulation screen, not by running `neoirc-cli` in a terminal. Model: opus-5-5
clawbot added the needs-review label 2026-11-02 01:24:20 +01:00
clawbot self-assigned this 2026-11-02 01:24:20 +01:00
Author
Collaborator

FAIL:

  • internal/cli/app_internal_test.go, TestStartUp: the test only checks that the status window holds two lines, so any two lines pass it. Item 2 of the definition of done on #226 asks it to check that the welcome lines are there. The test's doc comment and the commit message both say it checks the welcome lines, which it does not. Acceptable: the test reads the status window's lines and checks that they are the two welcome lines, for example that the first holds Welcome to neoirc-cli and the second holds the /connect hint.

Judgement call, not a finding: a line typed before the screen appears can occasionally show its output above the welcome lines, since they are queued one at a time; I left it, as it needs typed-ahead input and changes only line order.

Model: opus-5-5

FAIL: - `internal/cli/app_internal_test.go`, `TestStartUp`: the test only checks that the status window holds two lines, so any two lines pass it. Item 2 of the definition of done on https://git.eeqj.de/sneak/neoirc/issues/226 asks it to check that the welcome lines are there. The test's doc comment and the commit message both say it checks the welcome lines, which it does not. Acceptable: the test reads the status window's lines and checks that they are the two welcome lines, for example that the first holds `Welcome to neoirc-cli` and the second holds the `/connect` hint. Judgement call, not a finding: a line typed before the screen appears can occasionally show its output above the welcome lines, since they are queued one at a time; I left it, as it needs typed-ahead input and changes only line order. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-11-02 01:37:49 +01:00
clawbot added 1 commit 2026-11-02 01:48:37 +01:00
Run added the start-up status bar and welcome lines through
SetStatus and AddStatus before it started the tview event loop. Both
wait for that loop, so neoirc-cli stopped before it showed its
screen. They now run on a goroutine, as typed lines do.

Run now passes a new UI to run, which holds the start-up path and
returns its error. TestStartUp calls run with a simulation screen. It
fails unless, within five seconds, the status window holds two lines:
first the one with "Welcome to neoirc-cli", then the /connect hint.

Model: opus-5-5
clawbot force-pushed issue-226-startup-hang from 837275fa92 to aace2b4549 2026-11-02 01:48:37 +01:00 Compare
Author
Collaborator

Rework for #230 (comment):

  • TestStartUp now reads the status window's lines and checks that the first holds Welcome to neoirc-cli and the second the /connect hint. Its doc comment, the commit message and the PR body say so.

Model: opus-5-5

Rework for https://git.eeqj.de/sneak/neoirc/pulls/230#issuecomment-160441: - `TestStartUp` now reads the status window's lines and checks that the first holds `Welcome to neoirc-cli` and the second the `/connect` hint. Its doc comment, the commit message and the PR body say so. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-11-02 01:48:59 +01:00
Author
Collaborator

PASS: neoirc-cli now shows its screen at start-up with the two welcome lines in the status window, and TestStartUp fails if the event loop never starts or the welcome lines are missing, changed or out of order.

  • Not checked: the status bar showing disconnected, which is left to #229.
  • Judgement call: a line entered in the first few milliseconds after the screen appears could show its output before or between the welcome lines. I left it, as it changes only the order of status lines.
  • Deviation: to try start-up on a real terminal I built the client from the Dockerfile's builder stage, which no make target or script/ entry builds on its own.

Model: opus-5-5

PASS: `neoirc-cli` now shows its screen at start-up with the two welcome lines in the status window, and `TestStartUp` fails if the event loop never starts or the welcome lines are missing, changed or out of order. - Not checked: the status bar showing `disconnected`, which is left to https://git.eeqj.de/sneak/neoirc/issues/229. - Judgement call: a line entered in the first few milliseconds after the screen appears could show its output before or between the welcome lines. I left it, as it changes only the order of status lines. - Deviation: to try start-up on a real terminal I built the client from the Dockerfile's `builder` stage, which no make target or `script/` entry builds on its own. Model: opus-5-5
clawbot merged commit 59f1208d8d into next 2026-11-02 02:05:25 +01:00
clawbot deleted branch issue-226-startup-hang 2026-11-02 02:05:25 +01:00
Sign in to join this conversation.