Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(observability): Bump to tui 14 #5975

Merged
merged 4 commits into from
Jan 11, 2021
Merged

chore(observability): Bump to tui 14 #5975

merged 4 commits into from
Jan 11, 2021

Conversation

leebenson
Copy link
Member

Bumps vector top to tui 14. Closes #5289.

This wound up being smaller in scope than I would have liked. The highlight of tui 14 is the ability to control Cell-level styling. We're using that to set the row header text to bold.

I had anticipated right-aligning metrics columns, but layout's Alignment struct appears specific to layouts and not text. I experimented with pad to prefix with spaces manually based on the largest column dimensions, but since we're using percentage widths to accommodate fluid terminal sizes, and text truncates below a certain size, there didn't appear to be a consistent way to anticipate exact column dimensions outside of tui's own layout rendering.

There's an open issue on tui requesting this. I'll revisit if/when that feature is implemented. Not a huge deal either way. Just think it'll look nicer.

@leebenson leebenson added the domain: observability Anything related to monitoring/observing Vector label Jan 11, 2021
@leebenson leebenson added this to the 2021-01-04 Xenomass Well milestone Jan 11, 2021
@leebenson leebenson self-assigned this Jan 11, 2021
Copy link
Member

@jszwedko jszwedko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@@ -121,6 +119,13 @@ impl<'a> Widgets<'a> {
/// Renders a components table, showing sources, transforms and sinks in tabular form, with
/// statistics pulled from `ComponentsState`,
fn components_table<B: Backend>(&self, f: &mut Frame<B>, state: &state::State, area: Rect) {
// Header columns
let header = ["Name", "Kind", "Type", "Events", "Bytes", "Errors"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a big deal, but it seems like we could have left the constant and still did the mapping in here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that's a remnant from my experiments with pad, where column labels could occupy different widths depending on padding. This can indeed be static.

Signed-off-by: Lee Benson <lee@leebenson.com>
@leebenson leebenson merged commit 8f87639 into master Jan 11, 2021
@leebenson leebenson deleted the leebenson/tui-14 branch January 11, 2021 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: observability Anything related to monitoring/observing Vector
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bump tui-rs / right align columns
2 participants