Add layout-fixer extension - #30165
Conversation
|
Congratulations on your new Raycast extension! 🚀 We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 15 business days. Once the PR is approved and merged, the extension will be available on our Store. |
Greptile SummaryAdds a cross-platform, no-view Layout Fixer command that converts selected or focused-field text between English and Arabic keyboard layouts.
Confidence Score: 4/5The selection-scope bug should be fixed before merging because an explicitly selected whitespace region can cause the entire focused field to be converted and overwritten. The command conflates an existing whitespace-only selection with an absent selection, activates Select All, and can paste converted content over a broader scope than the user selected. Files Needing Attention: extensions/layout-fixer/src/fix-layout.ts Important Files Changed
Prompt To Fix All With AI### Issue 1
extensions/layout-fixer/src/fix-layout.ts:43
**Whitespace Selection Expands Scope**
When the user explicitly selects only spaces, tabs, or line breaks, `source.trim()` treats that selection as absent and sends Select All, causing the command to convert and overwrite the entire focused field instead of operating on the selected region.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "Remove tools/make_icon.py from the exten..." | Re-trigger Greptile |
|
|
||
| // Nothing selected — assume the cursor is sitting in a field and take all | ||
| // of it. Raycast has to be out of the way first for the keystroke to land. | ||
| if (!source.trim()) { |
There was a problem hiding this comment.
Whitespace Selection Expands Scope
When the user explicitly selects only spaces, tabs, or line breaks, source.trim() treats that selection as absent and sends Select All, causing the command to convert and overwrite the entire focused field instead of operating on the selected region.
Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/layout-fixer/src/fix-layout.ts
Line: 43
Comment:
**Whitespace Selection Expands Scope**
When the user explicitly selects only spaces, tabs, or line breaks, `source.trim()` treats that selection as absent and sends Select All, causing the command to convert and overwrite the entire focused field instead of operating on the selected region.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Similar extensions already in the StoreAutomated first pass. Overlap is not a blocker on its own, but the README should make the difference clear.
|
Appreciating your reply. Also could you make it more clear to me what should I change in the README. Best regards. |
Description
Adds Layout Fixer, a single no-view command that fixes text typed with the wrong keyboard layout.
You meant to type
مرحبا, but the keyboard was still on English, so the screen sayslnpfh. Run the command and it becomesمرحبا. It works the other way too —اثممخtyped on a stuck Arabic layout becomeshello.Behaviour
Direction is detected automatically by counting script, so there's no "to Arabic" / "to English" choice to make, and running the command twice returns the original text.
Screencast
Checklist
npm run buildand tested this distribution build in Raycastassetsfolder are used by the extension itselfREADMEare placed outside of themetadatafolder