Feature: per language shortcuts - #26
Open
bu6n wants to merge 3 commits into
Open
Conversation
Yap had one language and one set of triggers, so dictating in a second language meant a trip through Settings each time. Settings now holds a list of dictation profiles — a language plus the shortcut, modifier tap and function-row key that start it — and whichever trigger fires picks the language for that dictation. Existing settings migrate into the first profile, so nothing changes until you add a second. Closes FrigadeHQ#15.
With a shortcut per language it is not always obvious which one is listening, so the window can carry a short tag like DE beside "Listening". Off by default, since it is only worth the room once you dictate in more than one language. Resolving a language to its locale moves onto the profile along the way, since the tag is derived from the same place. The row is a fixed width, so with the tag on the waveform gives up its oldest ten bars to make room rather than push the confirm and cancel buttons off the card. With it off the window draws exactly as before.
Recording a key combination that another language already held did nothing at all. A registered combination is claimed system-wide, so the system routed the press to the hotkey and the recorder never saw the keys — it stayed empty and saved nil. Unregister while a recorder has focus, which is the only moment the field needs those keys for itself, and the combination can be typed in and taken from whoever held it. The hook is a notification KeyboardShortcuts posts without declaring it public, since it is the only signal that fires per field. Anything window-scoped works once and then stops, because saving a combination re-registers it immediately. A test pins the notification so a dependency bump fails loudly rather than quietly bringing the original bug back.
Contributor
|
@bu6n thank you for this PR! For now I recommend using a local build for this and linking this PR to an Issue. If we the Issue gets a good amount of traction, I am happy to review and merge this in as a feature. But as you mention above, I am trying to keep this application as lean and clean as possible and only add features that the majority (or a good chunk) of users will use. |
The app already offers language selection. Letting the user switch languages quickly with a hotkey doesn't make it any less lean or clean. |
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.
I came accross the same need as #15 and tried to fix it.
The README says
yapshouldn't have too much features. I really like how fastyapis to install and use. It's near-perfect, but I use 3 languages daily so I would really like to have this feature.Let me know if this PR needs more work.
Disclaimer: Claude Opus 5 has done most of the work here, but I think it makes mostly sense. I have tested the feature and it works nicely from my side.
Couple screenshots:
Here's Claude summary for a bit more details: