Skip to content

Give the interface a look of its own, with a one-line header - #12

Merged
gnocent merged 3 commits into
mainfrom
feat/tui-look
Oct 30, 2026
Merged

gnocent merged 3 commits into
mainfrom
feat/tui-look

Conversation

@gnocent

@gnocent gnocent commented Oct 30, 2026

Copy link
Copy Markdown
Owner

A more polished interface, without losing a row on an 80×24 terminal.

What changes

  • Theme (ui/theme.go): a fixed palette on a dark background of its own, the same whatever the terminal's theme; a terminal without 24-bit colors gets the closest ones it has. Red and yellow keep to the state of the cluster or of the last request. The panel with the focus has a thick blue border, its shape as well as its color.
  • Header (ui/header.go): the first line gives the product in a badge telling Elasticsearch from OpenSearch, the URL and the user. It replaces the protection banner: on a protected cluster, the whole line turns red or yellow.
  • Last line (ui/statusbar.go): the message on the left, as many shortcuts as it leaves room for on the right, none cut in two. With the header, that makes the same two rows as the former status line and help bar.
  • Editor: methods and comments are colored by repainting the cells TextArea has just drawn. The selection keeps its colors.
  • More below: a ▼ on the bottom border of the editor, the result and the help screen, for as long as there is something left to scroll to.

The shortcuts, the configuration and the saved files don't change. The demo gif still shows the former look: to record again before the release.

Tests

  • New: contrast of what goes on what, fallback in 8, 16 and 256 colors, nothing left on the terminal's own background, what the header gives up in which order, the repainting against selection, wrapping and scrolling, the ▼ when the text just fits, once wrapped and once scrolled to the end.
  • Changed, the expected behavior having changed: statusbar_test (new last line), target_test and sessions_test (product and URL now in the header), protection_test and connect_test (border shapes, protection colors, the header's layout).
  • Reviewed by hand in Windows Terminal, the ▼ excepted: rendering, a protected cluster, the last line, the editor's colors. Not tried by hand: the macOS and Linux terminals; this PR's CI runs the tests there.

🤖 Generated with Claude Code

gnocent and others added 3 commits October 30, 2026 14:11
Colors depended on the terminal's theme, and the first thing that looked
dated was also the least informative: white borders, a status line
carrying the cluster's URL and the user, a help bar under it.

ui/theme.go sets a fixed palette on a dark background of its own, the
same whatever the terminal's theme; a terminal without 24-bit colors
gets the closest ones it has, from tcell. The color tags keep the names
that say what they mean ("[red]" an error): the theme redefines what the
names stand for, in tcell.ColorNames, which tview reads them through.
Red and yellow say something about the cluster or the last request and
nothing else. The panel with the focus has a thick blue border, its
shape as well as its color, so that it still shows without colors.

The first line of the main screen now says which cluster this is: the
product in a badge telling Elasticsearch from OpenSearch, the URL and
the user. It takes the place of the protection banner: on a protected
cluster the whole line turns red or yellow, and the label and the level
stay whatever the width.

The status line and the help bar share the last line: the message on
the left, with no URL or user to compete with, and as many shortcuts as
it leaves room for on the right, none cut in two. The panels keep the
height they had on an 80x24 terminal, one more on a protected cluster.

In the editor, methods and comments are colored by changing the color
of the cells TextArea has just drawn, TextArea itself drawing a single
color. The selection keeps its colors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nothing said that the editor, the result or the help screen went on
below the rows shown: a result cut by the bottom of the panel looked
like a complete one. A ▼ now sits on their bottom border, next to the
right corner, for as long as there is something left to scroll to.

What counts is the rows displayed, wrapping included. The editor already
knows them from the gutter. TextView only says how many it has by
wrapping its whole text on the spot, which would freeze the interface on
a large result, and not at the width it is drawn at: scrollPanel finds
out by scrolling one row down and back instead, which goes no further
than the rows shown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Editor: on a panel narrower than a method, the painting went past the
text area, onto the panel's border and the result next to it; it stops
at the editor's width now. It also redid a regular expression and a scan
of the whole line for every row of a long line, on every frame: lines
are now only looked at where they start.

Header and status line: with the mouse on, a click gave them the focus,
which left no panel with it and the keyboard with nowhere to go. They
now ignore the mouse. A URL short enough to fit whole is no longer
dropped for lack of the room needed to cut one short, and a message with
a line break no longer pushes the shortcuts onto a row not displayed.

The mark for what is left below has a fallback, for a terminal that
isn't in UTF-8, and the header's white no longer depends on the
terminal's palette.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gnocent
gnocent merged commit 3547271 into main Oct 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant