forked from cjpais/Handy
-
Notifications
You must be signed in to change notification settings - Fork 0
Add option to append trailing space after pasted text #5
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import React from "react"; | ||
| import { ToggleSwitch } from "../ui/ToggleSwitch"; | ||
| import { useSettings } from "../../hooks/useSettings"; | ||
|
|
||
| interface AppendTrailingSpaceProps { | ||
| descriptionMode?: "inline" | "tooltip"; | ||
| grouped?: boolean; | ||
| } | ||
|
|
||
| export const AppendTrailingSpace: React.FC<AppendTrailingSpaceProps> = | ||
| React.memo(({ descriptionMode = "tooltip", grouped = false }) => { | ||
| const { getSetting, updateSetting, isUpdating } = useSettings(); | ||
|
|
||
| const enabled = getSetting("append_trailing_space") ?? false; | ||
|
|
||
| return ( | ||
| <ToggleSwitch | ||
| checked={enabled} | ||
| onChange={(enabled) => updateSetting("append_trailing_space", enabled)} | ||
| isUpdating={isUpdating("append_trailing_space")} | ||
| label="Append Trailing Space" | ||
| description="Automatically add a space at the end of transcribed text, making it easier to dictate multiple sentences in a row." | ||
| descriptionMode={descriptionMode} | ||
| grouped={grouped} | ||
| /> | ||
| ); | ||
| }); | ||
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: dannysmith/Handy
Length of output: 87
🏁 Script executed:
# Check if there's a PR description or README that clarifies the behavior git log --oneline -20Repository: dannysmith/Handy
Length of output: 121
🏁 Script executed:
Repository: dannysmith/Handy
Length of output: 87
🏁 Script executed:
Repository: dannysmith/Handy
Length of output: 229
🏁 Script executed:
Repository: dannysmith/Handy
Length of output: 229
🏁 Script executed:
Repository: dannysmith/Handy
Length of output: 4938
🏁 Script executed:
Repository: dannysmith/Handy
Length of output: 3502
🏁 Script executed:
Repository: dannysmith/Handy
Length of output: 84
🏁 Script executed:
Repository: dannysmith/Handy
Length of output: 94
🏁 Script executed:
# Quick check of the ToggleSwitch component to see parameter naming patterns head -50 src/components/ui/ToggleSwitch.tsxRepository: dannysmith/Handy
Length of output: 1856
🏁 Script executed:
# Verify the useSettings hook implementation head -50 src/hooks/useSettings.tsRepository: dannysmith/Handy
Length of output: 1637
Fix description to match actual behavior
The description says "transcribed text" but the setting actually controls spacing during paste. The backend applies the trailing space when pasting to the clipboard (see
src-tauri/src/clipboard.rs), not during transcription. Update the description to say "pasted text" instead of "transcribed text" for accuracy.Avoid shadowing
enabledin theonChangehandlerThe
enabledvariable fromgetSettingand theenabledparameter in theonChangecallback share the same name, which reduces readability. Rename the callback parameter:📝 Committable suggestion
🤖 Prompt for AI Agents