Show the toolbar text input and the extra keys at the same time - #5265
Open
kedimuzafer wants to merge 1 commit into
Open
Show the toolbar text input and the extra keys at the same time#5265kedimuzafer wants to merge 1 commit into
kedimuzafer wants to merge 1 commit into
Conversation
The terminal toolbar is a two page ViewPager: page 0 holds the extra keys, page 1 the text input. Switching pages means swiping horizontally, but the text input consumes horizontal touches to move the caret, so it only sees the swipe once the caret has reached the start of the text. With a long line in the field, getting back to the extra keys means first scrolling all the way back. Both views are now stacked in a vertical LinearLayout and visible together, with the text input directly above the extra keys. - A TEXTBAR special key toggles the input row and moves focus with it, alongside the existing KEYBOARD, DRAWER, PASTE and SCROLL keys, so its position is up to the user's extra-keys property. - The input is multi line and monospace, with hairline separators instead of the EditText underline, which does not fit a terminal. Enter sends, so no send button competes for horizontal space. - The toolbar takes its colours from the terminal's colour scheme. Key labels were a fixed white before, so they were invisible against a light scheme. - Key labels are sized from the row height, so lowering the terminal-toolbar-height property shrinks the text with the row rather than leaving oversized labels in a thin row. - A hairline grid is drawn between the keys, in the same scheme derived colour. Co-Authored-By: Claude Opus 5 (1M context) <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.
The terminal toolbar is a two page
ViewPager: page 0 holds the extra keys, page 1 the text input.Switching pages means swiping horizontally — but the text input consumes horizontal touches to move
the caret, so the pager only sees the swipe once the caret has reached the start of the text. With a
long line in the field, getting back to the extra keys means first scrolling the caret all the way
back. Paste a paragraph in there and it is a real chore.
This stacks both views in a vertical
LinearLayoutso they are visible together, with the text inputdirectly above the extra keys.
TEXTBARspecial key. Toggles the input row and moves focus with it, alongside the existingKEYBOARD,DRAWER,PASTEandSCROLLkeys, so its position is up to the user'sextra-keysproperty. It renders as
▤.Text input. Multi line and monospace, with hairline separators instead of the
EditTextunderline, which does not sit well in a terminal. Enter sends, so no send button competes for
horizontal space.
Colour scheme. The toolbar takes background and foreground from the terminal's own scheme. Key
labels were a fixed white before, so they were invisible against a light scheme — that is fixed as a
side effect.
Label sizing. Labels are sized from the row height, so lowering
terminal-toolbar-heightshrinksthe text with the row instead of leaving oversized labels crammed into a thin row.
Key grid. A hairline grid is drawn between keys in the same scheme derived colour.
Notes for review
I am aware this removes an existing interaction, so I understand if you would rather have it behind a
property — say the word and I will put the old paged behaviour back as the default with this as an
opt-in, or split the parts up. The colour scheme and label sizing fixes stand on their own if you
only want those.
isTerminalToolbarTextInputViewSelected()andisTerminalViewSelected()keep their meaning: theformer now reports whether the input row is visible rather than which page is current.
Tested on an Android 16 device (arm64) and an API 31 emulator (x86_64): toggling, sending, focus
handling, light and dark schemes, and
terminal-toolbar-heightbetween 0.4 and 3.