Skip to content

fix: restore and improve the console virtual keyboard - #34

Merged
greenlogles merged 1 commit into
mainfrom
fix/console-virtual-keyboard
Jul 15, 2026
Merged

fix: restore and improve the console virtual keyboard#34
greenlogles merged 1 commit into
mainfrom
fix/console-virtual-keyboard

Conversation

@greenlogles

Copy link
Copy Markdown
Owner

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

  • Keyboard wouldn't appearx-show couldn't reveal #virtual-keyboard because a stylesheet display:none ID rule overrode its inline style. Switched to x-cloak for the pre-init hidden state.
  • toggleVirtualKeyboard is not defined — Alpine was loaded in <head> and auto-starts via queueMicrotask, walking the DOM before the inline module registered the consoleToolbar component, so x-data resolved 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.
  • Keyboard overlaid the terminal on mobile — it was position: fixed. It's now an in-flow flex child, and the container uses 100dvh, so #vnc-screen shrinks (noVNC re-scales) instead of being covered, and all rows stay within the visible viewport.

New feature

  • SYM / ABC layer 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 existing sendKey path rather than exhaustively tapped on a live guest.

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.
@greenlogles
greenlogles merged commit 665daeb into main Jul 15, 2026
9 checks passed
@greenlogles
greenlogles deleted the fix/console-virtual-keyboard branch July 15, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant