Repository navigation
Give the interface a look of its own, with a one-line header - #12
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A more polished interface, without losing a row on an 80×24 terminal.
What changes
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.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.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.TextAreahas just drawn. The selection keeps its colors.▼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
▼when the text just fits, once wrapped and once scrolled to the end.statusbar_test(new last line),target_testandsessions_test(product and URL now in the header),protection_testandconnect_test(border shapes, protection colors, the header's layout).▼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