fix: restore and improve the console virtual keyboard - #34
Merged
Conversation
The Alpine.js frontend migration broke the on-screen keyboard on the
standalone console page:
- x-show could not reveal #virtual-keyboard because a stylesheet
`display:none` ID rule overrode x-show's inline style. Use x-cloak for
the pre-init hidden state instead.
- Alpine, loaded in <head>, auto-starts (queueMicrotask) and walks the DOM
before the inline module registered the consoleToolbar component, so
x-data resolved to an empty scope (toggleVirtualKeyboard "is not
defined"). Load Alpine after the module, and import noVNC dynamically so
the module's synchronous registration isn't blocked on the CDN fetch.
- The keyboard was position:fixed and overlaid the terminal on mobile.
Make it an in-flow flex child and size the container with 100dvh so it
shrinks #vnc-screen (noVNC re-scales) instead of covering it, and every
row stays within the visible viewport.
Also add a SYM/ABC layer toggle exposing F1-F12 and special symbols
(`~!@#$%^&*()_+={}[]\|:;"'<>?) sent via direct keysyms, so no Shift or
physical-layout mapping is required.
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
Fixes the on-screen console keyboard, which broke during the Alpine.js frontend migration, plus a mobile layout fix and a new symbols/function-key layer.
Bugs fixed
x-showcouldn't reveal#virtual-keyboardbecause a stylesheetdisplay:noneID rule overrode its inline style. Switched tox-cloakfor the pre-init hidden state.toggleVirtualKeyboard is not defined— Alpine was loaded in<head>and auto-starts viaqueueMicrotask, walking the DOM before the inline module registered theconsoleToolbarcomponent, sox-dataresolved to an empty scope. Alpine now loads after the module, and noVNC is imported dynamically so the module's synchronous registration isn't blocked on (or killed by) the CDN fetch.position: fixed. It's now an in-flow flex child, and the container uses100dvh, so#vnc-screenshrinks (noVNC re-scales) instead of being covered, and all rows stay within the visible viewport.New feature
SYM/ABClayer toggle exposing F1–F12 and special symbols`~!@#$%^&*()_+={}[]\|:;"'<>?— sent via direct keysyms, so no Shift or physical-layout mapping is needed.Testing
Verified on a physical Android device (screenshots during review): keyboard opens, sits above the terminal, all rows visible. HTML/JS validated structurally (parser +
node --check); the layer toggle and per-key keysym output were reasoned from the existingsendKeypath rather than exhaustively tapped on a live guest.