Skip to content
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

Make Scan selected text lazy and add Scan text at selection #915

Merged
merged 6 commits into from
May 14, 2024

Conversation

Kuuuube
Copy link
Member

@Kuuuube Kuuuube commented May 11, 2024

Currently, the Scan selected text keyboard shortcut ignores the selection if it finds a word bigger than the selection. It makes more sense that Scan selected text would only scan the selected text and not expand outside of it.

To not break existing use cases of the previous Scan selected text I've added Scan text at selection which has the previous behavior and is more in line with what would be expected of that name.

Fixes #792

@Kuuuube Kuuuube added kind/enhancement The issue or PR is a new feature or request area/ui-ux The issue or PR is related to UI/UX/Design labels May 11, 2024
@Kuuuube Kuuuube requested a review from a team as a code owner May 11, 2024 19:02
@Kuuuube Kuuuube changed the title Make Scan selected text lazy instead of greedy Add Scan selected text lazy May 11, 2024
@Kuuuube Kuuuube changed the title Add Scan selected text lazy Make Scan selected text lazy and add Scan text at selection May 11, 2024
Copy link
Member

@StefanVukovic99 StefanVukovic99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

ext/js/app/frontend.js Outdated Show resolved Hide resolved
ext/js/app/frontend.js Show resolved Hide resolved
@@ -119,6 +119,7 @@ export class Frontend {

this._hotkeyHandler.registerActions([
['scanSelectedText', this._onActionScanSelectedText.bind(this)],
['scanTextAtSelection', this._onActionScanTextAtSelection.bind(this)],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly if renaming is possible I would rather name the current scanSelectedText to scanTextGreedy and repurpose scanSelectedText for this new functionality. I'm not sure about the naming of "lazy" tbh

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought about naming them like that but I feel like "greedy" and "lazy" aren't as well known terms to end users.

scanSelectedText just scans the selected text, simple.

scanTextAtSelection scans the text starting at the selection and does whatever it wants inside or outside the selection.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah these are user facing strings 🤔

@jamesmaa jamesmaa added this pull request to the merge queue May 14, 2024
Merged via the queue into themoeway:master with commit 266c8c3 May 14, 2024
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ui-ux The issue or PR is related to UI/UX/Design kind/enhancement The issue or PR is a new feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Force selection if word cannot be scanned (scan misses possible words)
3 participants