Repository navigation
fix(mobile): select file text across lines on Android #31286
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
Merged
+158
−16
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
fe19830
fix(mobile): Android file viewer can select text across lines
shivamhwp fcf1a93
test(mobile): cover line restoration after text selection
shivamhwp fa43ea8
fix(mobile): keep Android text selection responsive on large files
shivamhwp e8a663a
test(mobile): check selectable HTML at the helper layer
shivamhwp 8bbdd2a
perf(mobile): skip unused native tree during Android selection
shivamhwp 6badfc8
fix(mobile): wrapped file viewer reaches far requested lines
shivamhwp ac80d42
fix(mobile): clear stalled file line jumps after bounded retries
shivamhwp 0c9723b
Merge remote-tracking branch 'origin/main' into issue-watch/30178
shivamhwp de78e46
refactor(mobile): leave wrapped far-line scroll fix out of text selec…
shivamhwp e11dc6d
Merge remote-tracking branch 'origin/main' into issue-watch/30178
shivamhwp ef4e39d
Merge remote-tracking branch 'origin/main' into pr-31286
shivamhwp 11b2569
fix(mobile): long-press a file line to select text across lines on An…
shivamhwp e20df26
Merge remote-tracking branch 'origin/main' into pr-31286
shivamhwp 7b8ad70
fix(mobile): TalkBack can open file text selection from a row
shivamhwp d3b1902
Merge remote-tracking branch 'origin/main' into pr-31286-review
shivamhwp 432704b
fix(mobile): file text selection lets other navigation and modes through
shivamhwp acda47d
fix(mobile): clear file selection when changing preview modes
shivamhwp 0321ec0
Merge remote-tracking branch 'origin/main' into pr-31286-review
shivamhwp 20c0018
Merge remote-tracking branch 'origin/main' into prbatch/31286
shivamhwp 373bb37
refactor(mobile): keep file text selection state with the source view
shivamhwp 41b54fc
fix(mobile): reset file text selection when the requested line changes
shivamhwp 3f40f93
Merge remote-tracking branch 'origin/main' into prbatch/31286
shivamhwp 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
20 changes: 20 additions & 0 deletions
20
apps/mobile/src/features/files/source-file-document.test.ts
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,20 @@ | ||
| import { expect, it } from "vite-plus/test"; | ||
| import { prepareSourceFileDocument, selectableSourceHtml } from "./source-file-document"; | ||
|
|
||
| it("preserves source whitespace and markup as literal selectable text", () => { | ||
| const source = prepareSourceFileDocument( | ||
| "\n\tlead\r\n<script>alert(1)</script> & > 😀\u00a0end\n", | ||
| ); | ||
| const html = selectableSourceHtml(source.contents, { | ||
| foreground: "#000000", | ||
| selection: "#3366ff", | ||
| fontSize: 14, | ||
| rowHeight: 24, | ||
| wordBreak: true, | ||
| }); | ||
| const page = new DOMParser().parseFromString(html, "text/html"); | ||
|
|
||
| expect(page.querySelector("script")).toBeNull(); | ||
| expect(page.body.textContent).toBe("\n\tlead\n<script>alert(1)</script> & > 😀\u00a0end\n"); | ||
| expect(page.getElementById("L2")?.textContent).toBe("\tlead"); | ||
| }); |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.