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

change(web): add context tracker bksp handling, alignment-offset calculations 🖲️ #12911

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

jahorton
Copy link
Contributor

This has been spun off from #12884.

This PR accomplishes two main goals to facilitate #12884:

  1. The context tracker logic can track related contexts after backspacing / delete-left inputs.
    • This will help preserve information about any applied suggestions earlier in the context, which is needed to offer reversions after backspaces.
  2. It now also generates numerical data corresponding to shifts in the context window, which is helpful for comparing 'before' and 'after' context states.

I've performed rebasing and curation to make each individual commit (of the initial 3) as clean and self-contained as possible. Hopefully that helps with the review process.

@keymanapp-test-bot skip

@jahorton jahorton requested a review from mcdurdin as a code owner January 16, 2025 04:54
@keymanapp-test-bot keymanapp-test-bot bot added this to the A18S19 milestone Jan 16, 2025
Base automatically changed from change/web/keep-suggestion-transforms to master January 16, 2025 08:49
Copy link
Member

@mcdurdin mcdurdin left a comment

Choose a reason for hiding this comment

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

Questions on Object.assign but apart from that I think it LGTM

@@ -127,15 +136,7 @@ export class TrackedContextState {
// Be sure to deep-copy the tokens! Pointer-aliasing is bad here.
Copy link
Member

Choose a reason for hiding this comment

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

"pointers" are not a thing in JS. But objects are.

Copy link
Contributor Author

@jahorton jahorton Jan 17, 2025

Choose a reason for hiding this comment

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

The only difference between pointers and object references is the ability to directly apply arithmetic to the pointer. The 'aliasing' aspect is what's key here, though.

@jahorton jahorton changed the title change(web): add context tracker bksp handling, alignment-offset calculations change(web): add context tracker bksp handling, alignment-offset calculations 🖲️ Jan 17, 2025
@darcywong00 darcywong00 modified the milestones: A18S19, A18S20 Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants