[pull] master from monkeytypegame:master#945
Merged
Merged
Conversation
### Description <!-- Please describe the change(s) made in your PR: - explain the problem being solved - for bug fixes without an open issue, include steps to reproduce the issue - summarize the approach taken Use your own words. Do not rely on AI-generated descriptions. They do not demonstrate your understanding of the problem or the solution. Writing the description yourself helps you verify the scope of your work and helps us better understand your intent, reasoning and level of insight. --> The settings page has a lot of options cluttered, and finding a setting would mean scrolling through everything. you can press escape to search, yes but still it just makes you quickly change a setting, not searching it and its neighboring settings. This PR adds a search box at the top of the settings page. As you type, matching settings show up in a dropdown, and picking one scrolls to that setting and briefly flashes it so it's easy to spot. You can also use arrow keys and enter to do the same. A few notes on the approach: - The list it searches is built from the settings actually rendered on the page, so options that are currently hidden (e.g. the keymap settings when keymap mode is off) don't appear, and every result is guaranteed to scroll to something that exists. - The "scroll to and flash" behavior reuses the highlight that the per-setting copy-link buttons and ?highlight= URLs already use. I moved that logic into a small shared helper so the search and the existing URL handler use the same code instead of duplicating it. - Matching is a simple case-insensitive match on the setting name, capped at 8 results. Escape clears the search and clicking outside closes the dropdown. ### Checks - [x] Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info) - [x] Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title. <!-- label(optional scope): pull request title (@your_github_username) --> <!-- I know I know they seem boring but please do them, they help us and you will find out it also helps you. --> Closes # <!-- The issue(s) your PR resolves if any (delete if that is not the case) --> <!-- Please reference any issues and/or PRs related to your pull request --> <!-- Pro tip: you can mention an issue, PR, or discussion on GitHub by referencing its hash number, e.g.: [#1234](#1234) --> <!-- Pro tip: you can press . (dot or period) in the code tab of any GitHub repo to get access to GitHub's VS Code web editor. Enjoy! :) --> --------- Co-authored-by: Miodec <jack@monkeytype.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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )