feat: Text input system for DCSS webtiles protocol - #7
Open
willthehuman wants to merge 1 commit into
Open
Conversation
Fix the text input overlay to properly handle init_input/close_input/update_input server messages for character naming, chat, search, and drop count prompts. Changes: - Fix sendTextInput to use correct protocol message (msg: "input" instead of msg: "text_input") matching the DCSS webtiles spec - Add keyboard type switching: numeric keyboard for "number" input type with digits-only filter, standard keyboard for "text" and "seed" types - Reposition overlay as a bottom-aligned floating panel that sits above the software keyboard using MediaQuery.viewInsets.bottom - Reduce backdrop opacity for partial game view visibility The protocol parsing (InitInputMessage, CloseInputMessage, UpdateInputMessage), game state management (TextInputState), and game screen wiring were already in place from the initial implementation. Co-Authored-By: Claude Opus 4.6 <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.
Summary
sendTextInputnow sends{"msg": "input", "text": "..."}instead of the incorrect{"msg": "text_input", "text": "..."}, matching the DCSS webtiles specification for text input submissionnumberinput type; standard keyboard fortextandseed/seed-selectiontypesMediaQuery.viewInsets.bottom, allowing partial game view visibility through a reduced-opacity backdropContext
The DCSS server sends
init_input/close_input/update_inputmessages for free-text entry (character naming, chat, menu search, drop counts). The protocol parsing, game state management (TextInputState), and game screen wiring were already implemented. This PR fixes the outgoing message format and improves the overlay UX for mobile.Test plan
update_inputfrom server updates the text field content🤖 Generated with Claude Code