Repository navigation
TUI: Grow the controls panel to fit wrapped controls - #7083
Merged
Merged
Conversation
Since sidekiq#7052 the controls wrap onto as many lines as the terminal width requires, but the panel is still a fixed 5 rows tall (2 control lines + footer + borders). At 80 columns the Scheduled, Retries and Dead tabs need 3 control lines, which pushes the footer out of the panel, hiding the Redis/time/locale line and the filter being typed. Move the row splitting into BaseTab#control_rows and size the panel from it, keeping the previous minimum of 2 control lines.
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.
Summary
Since #7052 the TUI controls wrap onto as many lines as the terminal width needs, but the controls panel is still a fixed
constraint_length(5): 2 control lines, the footer, and 2 borders. When the controls need 3 lines, the footer is pushed out of the panel. That hides the Redis/Now/Locale line and, more importantly, the filter text being typed.At the default 80-column width, English locale:
Longer translations make this happen at wider widths too.
Change
TUI#render_controlsintoBaseTab#control_rows(width), same width estimate as before.rendercomputes the rows first and sizes the panel as[rows, 2].max + 3, so panels with 2 or fewer control lines keep the current height of 5.render_controlsrenders the rows it's given. Everything else is unchanged.Testing
#control_rowstest intest/tui_test.rb: every described control ends up in a row, every row fits the width, and a narrow width produces more than 2 rows. The test goes throughBaseTab, so it doesn't needratatui_rubyloaded, same as the existing TUI tests.bundle exec rakeis green (standard + lint:herb + full suite).