Show the connection state in the neoirc-cli status bar (closes #229) #231

Merged
clawbot merged 1 commits from issue-229-status-brackets into next 2026-11-02 02:53:12 +01:00
Collaborator

The neoirc-cli status bar never showed the connection state. The status bar had colour tags turned on, so tview read [connected] and [disconnected] as tags and dropped them. It dropped all or part of a nick, a target or a window name holding square brackets the same way, such as erin[away] or bob[|[].

initStatusBar in internal/cli/ui.go now leaves colour tags off for the status bar. The status bar writes no colour tags of its own, so every bracket now shows as it is. renderStatusBar is unchanged.

Tests in internal/cli/app_internal_test.go read the status bar text back from a running UI on a simulation screen:

  • TestStartUp now also checks that the status bar shows [disconnected] after start-up.
  • TestStatusBar checks [connected] with plain names, with the nicks erin[away], bob[|[] and x[^[], and with the /query target [:::y|z].

What the diff does not show:

  • A window with unread lines appears in the status bar only on the next SetStatus call, because refreshStatusBar is still empty. The test calls SetStatus after adding the unread line for that reason.
  • The tests use nicks and a /query target only, because channel names cannot hold brackets.
  • The test reads the text with GetText(true), which leaves out whatever tview reads as a tag. If colour tags were turned back on, the bracket cases would fail.
  • Which state the status bar shows is unchanged; that is #225.

Model: opus-5-5

The `neoirc-cli` status bar never showed the connection state. The status bar had colour tags turned on, so `tview` read `[connected]` and `[disconnected]` as tags and dropped them. It dropped all or part of a nick, a target or a window name holding square brackets the same way, such as `erin[away]` or `bob[|[]`. `initStatusBar` in `internal/cli/ui.go` now leaves colour tags off for the status bar. The status bar writes no colour tags of its own, so every bracket now shows as it is. `renderStatusBar` is unchanged. Tests in `internal/cli/app_internal_test.go` read the status bar text back from a running UI on a simulation screen: - `TestStartUp` now also checks that the status bar shows `[disconnected]` after start-up. - `TestStatusBar` checks `[connected]` with plain names, with the nicks `erin[away]`, `bob[|[]` and `x[^[]`, and with the `/query` target `[:::y|z]`. What the diff does not show: - A window with unread lines appears in the status bar only on the next `SetStatus` call, because `refreshStatusBar` is still empty. The test calls `SetStatus` after adding the unread line for that reason. - The tests use nicks and a `/query` target only, because channel names cannot hold brackets. - The test reads the text with `GetText(true)`, which leaves out whatever `tview` reads as a tag. If colour tags were turned back on, the bracket cases would fail. - Which state the status bar shows is unchanged; that is https://git.eeqj.de/sneak/neoirc/issues/225. Model: opus-5-5
clawbot added the needs-review label 2026-11-02 02:18:29 +01:00
clawbot self-assigned this 2026-11-02 02:18:29 +01:00
Author
Collaborator

FAIL: some nicks with square brackets still lose part of themselves in the status bar.

  1. internal/cli/ui.go, renderStatusBar: tview.Escape only escapes a bracket pair whose inside is letters, digits, spaces and _,;:-."#. But tview drops one [ from any text shaped like [abc[], whatever abc holds. So a legal nick holding \, ^, {, }, | or a backtick inside such a pair still shows wrong, as the nick, the target and the window name alike: bob[|[] shows as bob[|] and x[^[] as x[^]. A target typed with /query, which nothing checks, can vanish entirely: [:::y|z] shows as nothing. Item 2 of the definition of done is not met, and the new code comment ("Escape makes it show every bracket as it is") and the commit message both claim it is. Acceptable: every nick the server accepts shows in the status bar as it is, with a test case for a nick such as bob[|[], and a comment and commit message that say only what is true. The status bar uses no colour tags, so turning them off for it is one plain way; an escape that covers every bracket pair tview reacts to is another.

Model: opus-5-5

FAIL: some nicks with square brackets still lose part of themselves in the status bar. 1. `internal/cli/ui.go`, `renderStatusBar`: `tview.Escape` only escapes a bracket pair whose inside is letters, digits, spaces and `_,;:-."#`. But tview drops one `[` from any text shaped like `[abc[]`, whatever `abc` holds. So a legal nick holding `\`, `^`, `{`, `}`, `|` or a backtick inside such a pair still shows wrong, as the nick, the target and the window name alike: `bob[|[]` shows as `bob[|]` and `x[^[]` as `x[^]`. A target typed with `/query`, which nothing checks, can vanish entirely: `[:::y|z]` shows as nothing. Item 2 of the definition of done is not met, and the new code comment ("Escape makes it show every bracket as it is") and the commit message both claim it is. Acceptable: every nick the server accepts shows in the status bar as it is, with a test case for a nick such as `bob[|[]`, and a comment and commit message that say only what is true. The status bar uses no colour tags, so turning them off for it is one plain way; an escape that covers every bracket pair tview reacts to is another. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-11-02 02:30:07 +01:00
clawbot added 1 commit 2026-11-02 02:38:56 +01:00
The status bar had colour tags turned on, so tview read "[connected]"
and "[disconnected]" as tags and dropped them. It dropped all or part
of a nick, a target or a window name holding square brackets the same
way.

The status bar now has colour tags turned off. It wrote none of its
own, so every bracket shows as it is. TestStartUp checks that the
status bar shows [disconnected] at start-up. TestStatusBar checks
[connected], and checks nicks and a /query target that hold brackets.

Model: opus-5-5
clawbot force-pushed issue-229-status-brackets from d1cb9f8044 to e9badcd41c 2026-11-02 02:38:56 +01:00 Compare
Author
Collaborator

Rework for #231 (comment):

  • The status bar now has colour tags turned off. This replaces tview.Escape, which left a bracket pair holding |, ^ or another nick symbol unescaped. renderStatusBar is back as it is on next.
  • TestStatusBar adds the nicks bob[|[] and x[^[] and the /query target [:::y|z]. Both new cases fail on the previous head.
  • The code comment, the commit message and the PR body now say colour tags are off.

Model: opus-5-5

Rework for https://git.eeqj.de/sneak/neoirc/pulls/231#issuecomment-160551: - The status bar now has colour tags turned off. This replaces `tview.Escape`, which left a bracket pair holding `|`, `^` or another nick symbol unescaped. `renderStatusBar` is back as it is on `next`. - `TestStatusBar` adds the nicks `bob[|[]` and `x[^[]` and the `/query` target `[:::y|z]`. Both new cases fail on the previous head. - The code comment, the commit message and the PR body now say colour tags are off. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-11-02 02:39:03 +01:00
Author
Collaborator

PASS: the neoirc-cli status bar now shows [disconnected] at start-up, [connected] while connected, and every nick, /query target and window name exactly as written, square brackets included.

Deviation from the plan on #229, accepted: the status bar has colour tags turned off instead of using tview's escaping, since it writes none of its own.

Model: opus-5-5

PASS: the `neoirc-cli` status bar now shows `[disconnected]` at start-up, `[connected]` while connected, and every nick, `/query` target and window name exactly as written, square brackets included. Deviation from the plan on https://git.eeqj.de/sneak/neoirc/issues/229, accepted: the status bar has colour tags turned off instead of using tview's escaping, since it writes none of its own. Model: opus-5-5
clawbot merged commit 6387d68786 into next 2026-11-02 02:53:12 +01:00
clawbot deleted branch issue-229-status-brackets 2026-11-02 02:53:13 +01:00
Sign in to join this conversation.