WIP: handle long text#664
Draft
hellasol wants to merge 12 commits into
Draft
Conversation
Closed
…into know-where-in-text-change-was-made
…into know-where-in-text-change-was-made
…into 265-handle-long-text
…om/witty-works/browser-extension into 265-handle-long-text
lsmith77
self-requested a review
January 12, 2023 10:10
lsmith77
reviewed
Jan 12, 2023
| alert.startOffset > node.textContent.length) | ||
| ) | ||
| return; | ||
| // if ( |
lsmith77
reviewed
Jan 12, 2023
| }, [nodesWithAlerts, elementScroll, elementRect]); | ||
|
|
||
| useEffect(() => { | ||
| console.log('highlights', highlights); |
lsmith77
reviewed
Jan 12, 2023
|
|
||
| useEffect(() => { | ||
| handleKeyupEvent(); | ||
| // handleKeyupEvent(); //TODO |
Contributor
There was a problem hiding this comment.
what is the implication of this change?
lsmith77
reviewed
Jan 12, 2023
| ); | ||
| handleTextAndIcon(textWithinMaxCharLength, event); | ||
| } else { | ||
| console.log('bingo'); |
lsmith77
reviewed
Jan 12, 2023
| }; | ||
|
|
||
| const handleTextAndIcon = (text: string, event?: Event) => { | ||
| console.log('handleTextAndIcon', text); |
lsmith77
reviewed
Jan 12, 2023
| const nodeValueLength: number = node.nodeValue.length; | ||
|
|
||
| textEndAbsPosition = textStartingAbsPosition + nodeValueLength - 1; //needed to keep huglights in place | ||
| // if ( |
lsmith77
reviewed
Jan 12, 2023
| { node: string; index: number }[] | ||
| >([]); | ||
|
|
||
| const maxCharLength = 300; |
Contributor
There was a problem hiding this comment.
move to config and set to 2000
lsmith77
reviewed
Jan 12, 2023
| }); | ||
| } | ||
| } | ||
| console.log('nodesWithAlertsTemp', nodesWithAlertsTemp); |
lsmith77
reviewed
Jan 12, 2023
| handleTextAndIcon(nextText, event); | ||
|
|
||
| //PART 1: FOCUSIN: send text within max char length to API | ||
| console.log('Part 1 focusin text', nextText.length, maxCharLength); |
lsmith77
reviewed
Jan 12, 2023
| const textWithinMaxCharLength = getTextWithinMaxCharLength( | ||
| textDividedByNodes.indexOf(clickedNode) | ||
| ); | ||
| console.log('PART 3: textDividedByNodes', textDividedByNodes); |
lsmith77
reviewed
Jan 12, 2023
| merged.set(nodeWithAlerts.nodeIndex, nodeWithAlerts); | ||
| } | ||
| }, [alerts, ignoredTerms, elementXPathResult, ignoredCategoriesFromStorage]); | ||
| console.log('merged', Array.from(merged.values())); |
lsmith77
reviewed
Jan 12, 2023
| let textStartingAbsPosition: number = 0; | ||
| let textEndAbsPosition: number = -1; | ||
|
|
||
| console.log( |
Contributor
|
I guess we can close this PR and delete the branch or does it still contain useful code? |
Collaborator
Author
|
Keep this for reference for when we want to track the highlights |
lsmith77
force-pushed
the
dev
branch
2 times, most recently
from
February 9, 2024 15:45
63cfe21 to
0db4679
Compare
lsmith77
force-pushed
the
dev
branch
2 times, most recently
from
February 17, 2024 11:06
3acd3dd to
d3428e6
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
relates to #265
-> to keep the highlights when moving to next section, do ticket that tracks changes first.