-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Fix: nonfatal missing key commands (resolves #6397) #6398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ariane-emory
wants to merge
6
commits into
sst:dev
Choose a base branch
from
ariane-emory:fix/nonfatal-missing-key-commands
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Fix: nonfatal missing key commands (resolves #6397) #6398
ariane-emory
wants to merge
6
commits into
sst:dev
from
ariane-emory:fix/nonfatal-missing-key-commands
+313
−3
Conversation
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
Collaborator
|
this shouldn't be enforced on the tui side, I would expect the tui to always be fed a valid config, and maybe u can introduce a config event for warnings that you emit that the tui could display |
Contributor
Author
|
@rekram1-node Alright, I'll look into how that could work and see what I can come up with. |
a17f3a8 to
69ab87a
Compare
- Change Keybinds schema from .strict() to .passthrough() to allow unknown keys - Add ValidKeybindNames set for validating keybind names - Add Config.Warning schema and Config.warnings() function - Add GET /config/warnings endpoint to fetch warnings - Add warning toast display in TUI when sync completes - Add tests for warning generation with unknown keybind names Fixes sst#6397
When user presses a key that matches a keybind configured for an unknown command name, show a warning toast with the command name.
- Fetch unknown keybinds from /config/warnings endpoint instead of iterating all keybinds in config - Add keybinds array field to Warning schema to provide list of unknown keybind names - Fix TypeScript error from passthrough schema by casting value - Regenerate SDK with ConfigWarning.keybinds field
69ab87a to
18b74aa
Compare
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.
This PR changes the behaviour so that binding missing key commands in a user's config is not a fatal error that prevents the startup of opencode entirely.
With this PR, keybindings for non-existent keywords, when struck will instead display a toast saying "No command 'the_fake_command_name'".
Resolves #6397.