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

feat: surface more webContents text selection commands #37978

Merged
merged 3 commits into from May 3, 2023

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Apr 13, 2023

Description of Change

Refs CL:2785611
Refs CL:4258445
Refs CR:1205033005

We've generally exposed the set of WebContents commands that handle text selection and manipulation, and within the last few years Chromium has added a few more that are likely to be useful to developers. Namely:

contents.scrollToTop()
contents.scrollToBottom()
contents.centerSelection()
contents.adjustSelection({ start, end })

Checklist

Release Notes

Notes: Expose webContents methods to center text selection, scroll to the page bottom and top, as well as adjust selected text.

@codebytere codebytere added semver/minor backwards-compatible functionality target/25-x-y PR should also be added to the "25-x-y" branch. labels Apr 13, 2023
@electron-cation electron-cation bot added api-review/requested 🗳 new-pr 🌱 PR opened in the last 24 hours labels Apr 13, 2023
docs/api/web-contents.md Outdated Show resolved Hide resolved
@codebytere codebytere force-pushed the surface-more-text-edit-commands branch 2 times, most recently from 15298eb to ff41c53 Compare April 17, 2023 08:44
@codebytere codebytere requested review from nornagon and a team April 17, 2023 08:44
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Apr 20, 2023
@codebytere codebytere requested review from zcbenz and removed request for VerteDinde April 24, 2023 09:12
Copy link
Contributor

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

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

API LGTM

Copy link
Contributor

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

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

@codebytere can we add tests for the new methods?

@codebytere
Copy link
Member Author

@jkleinsc they're all visual changes which can't really be tested unfortunately.

docs/api/web-contents.md Outdated Show resolved Hide resolved
docs/api/web-contents.md Show resolved Hide resolved
docs/api/web-contents.md Show resolved Hide resolved
@codebytere codebytere force-pushed the surface-more-text-edit-commands branch from ff41c53 to e58ad49 Compare April 26, 2023 08:08
Copy link
Member

@erickzhao erickzhao left a comment

Choose a reason for hiding this comment

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

API LGTM

@jkleinsc jkleinsc merged commit a8c0ed8 into main May 3, 2023
16 checks passed
@jkleinsc jkleinsc deleted the surface-more-text-edit-commands branch May 3, 2023 01:14
@release-clerk
Copy link

release-clerk bot commented May 3, 2023

Release Notes Persisted

Expose webContents methods to center text selection, scroll to the page bottom and top, as well as adjust selected text.

@trop
Copy link
Contributor

trop bot commented May 3, 2023

I was unable to backport this PR to "25-x-y" cleanly;
you will need to perform this backport manually.

@trop trop bot added needs-manual-bp/25-x-y and removed target/25-x-y PR should also be added to the "25-x-y" branch. labels May 3, 2023
@codebytere
Copy link
Member Author

/trop run backport-to 25-x-y

@trop
Copy link
Contributor

trop bot commented May 17, 2023

The backport process for this PR has been manually initiated - sending your PR to 25-x-y!

@trop
Copy link
Contributor

trop bot commented May 17, 2023

I have automatically backported this PR to "25-x-y", please check out #38362

@codebytere
Copy link
Member Author

/trop run backport-to 24-x-y

@trop
Copy link
Contributor

trop bot commented May 17, 2023

The backport process for this PR has been manually initiated - sending your PR to 24-x-y!

@trop
Copy link
Contributor

trop bot commented May 17, 2023

I have automatically backported this PR to "24-x-y", please check out #38365

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-review/approved ✅ merged/25-x-y PR was merged to the "25-x-y" branch. semver/minor backwards-compatible functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants