Commit graph

1709 commits

Author SHA1 Message Date
Joshua Horton
3f9b4e498d change(web): drops unnecessary context getter 2025-08-08 10:29:24 -05:00
Joshua Horton
a8ca07243a change(web): implements changes from PR review
changed unit test names added by prior PR

polished up the relocated code now found at initFromReset
2025-08-08 10:26:53 -05:00
Joshua Horton
4365490a1e Merge branch 'refactor/web/pred-context-state' into refactor/web/init-state-from-reset 2025-08-08 10:18:44 -05:00
Joshua Horton
24b57753db Merge branch 'refactor/web/tokenization-alignment' into refactor/web/pred-context-state 2025-08-08 10:16:05 -05:00
Joshua Horton
4cd4b77282 change(web): adds docs, prevents bad .suggestions logic in clone-constructor path 2025-08-08 10:15:43 -05:00
Joshua Horton
19ec817783 change(web): fixes unit test deep-equals issues 2025-08-08 10:09:54 -05:00
Joshua Horton
2abcd3076d Merge branch 'refactor/web/context-alignment-helpers' into refactor/web/tokenization-alignment 2025-08-08 09:43:54 -05:00
Joshua Horton
ea8108aa18 change(web): undoes minor tweaks to essentially-unchanged test set 2025-08-08 09:41:51 -05:00
Joshua Horton
2e30e2d1ad feat(web): adds getEditPathLastMatch unit tests 2025-08-08 09:40:50 -05:00
Joshua Horton
c7e84cdff7 change(web): moves isSubstitutionAlignable unit tests 2025-08-08 09:40:31 -05:00
Joshua Horton
21a6c6fe8b Merge branch 'refactor/web/pred-context-tokenization' into refactor/web/context-alignment-helpers 2025-08-08 09:28:20 -05:00
Joshua Horton
c3e0d3447c Merge branch 'refactor/web/pred-context-tokens' into refactor/web/pred-context-tokenization 2025-08-08 09:26:10 -05:00
Joshua Horton
9b29955060 docs(web): documents the ContextTokenization class 2025-08-08 09:25:55 -05:00
Joshua Horton
ab52938d96 docs(web): adds doc-comments for textToCharTransforms(), ContextToken class 2025-08-08 09:22:01 -05:00
Joshua Horton
a82993f125 refactor(web): improve ContextState construction patterns
After proceeding further in development, the only non-initFromReset initialization pattern that appears is constructing a raw instance, then immediately providing a computed tokenization.  Thus, accepting the tokenization as an optional parameter will allow us a nice constructor spec for both init styles.
2025-08-05 12:01:45 -05:00
Joshua Horton
39f9b6bbe4 Merge branch 'refactor/web/pred-context-state' into refactor/web/init-state-from-reset 2025-08-01 15:06:18 -05:00
Joshua Horton
500d169a5e Merge branch 'refactor/web/tokenization-alignment' into refactor/web/pred-context-state 2025-08-01 14:57:14 -05:00
Joshua Horton
e4185b35a1 Merge branch 'refactor/web/context-alignment-helpers' into refactor/web/tokenization-alignment 2025-08-01 14:56:34 -05:00
Joshua Horton
7459e0edea fix(web): fix import path for internal class used by unit test 2025-08-01 14:55:14 -05:00
Joshua Horton
ee5d097274 feat(web): add unit tests for ContextState.initFromReset 2025-08-01 12:53:56 -05:00
Joshua Horton
f3390b61bf refactor(web): refactor modelContextState as ContextState.initFromReset 2025-08-01 12:40:26 -05:00
Joshua Horton
5bd5ccfca4 refactor(web): refactor tracked-context state and usage pattern
Note that this will temporarily cause predictive-text to throw out older context states (that may be valid rewind targets) in favor of newer ones (that are known to be invalid rewind targets) due to the current context-state caching logic.  That'll be resolved later, in an upcoming PR - and preferably, this one shouldn't merge without that one.
2025-08-01 12:12:32 -05:00
Joshua Horton
8153dc417e refactor(web): relocates tokenization-alignment method to ContextTokenization class 2025-08-01 12:11:11 -05:00
Joshua Horton
91928a38fd refactor(web): relocate alignment helpers to a separate file 2025-08-01 12:06:48 -05:00
Joshua Horton
bf897016c3 change(web): add unit tests & clone constructor 2025-08-01 12:05:10 -05:00
Joshua Horton
7bb51bd53c refactor(web): refactor tracked-context tokenization and usage pattern
This PR's changes aim to meet our current needs for the tracking of context tokenization (word boundaries) across edits... all while moving much closer to the design specified within the Correction-Search + Context-Tracking design doc.

Also places the class within its own separate source file.
2025-07-30 12:10:08 -05:00
Joshua Horton
063054a592 refactor(web): relocate textToCharTransforms method 2025-07-30 12:09:26 -05:00
Joshua Horton
e0c553d306 change(web): appliedSuggestionId should be undefined, not -1, when none are applied 2025-07-30 09:22:09 -05:00
Joshua Horton
0ceffce32e refactor(web): refactor ContextToken and usage pattern
Also places the class within its own separate source file.

This PR's changes aim to meet our _current_ needs while moving much closer to the design specified within the [Correction-Search + Context-Tracking design doc](https://docs.google.com/document/d/1RYwgW8zI8A7VLMq40BpWYkfJJQ-i6K0MIs4QcAMxglE/edit?tab=t.0).
2025-07-30 09:22:03 -05:00
Joshua Horton
145f34f434
Merge pull request #14384 from keymanapp/change/web/split-suggestion-transforms
change(web): split suggestion transforms into main-body + appended (whitespace) transforms 🚂
2025-07-24 22:00:03 +07:00
Joshua Horton
c4e0faa101
Merge pull request #14365 from keymanapp/refactor/web/attempt-match-context
refactor(web): rework `attemptMatchContext` to use new `attemptTokenizedAlignment` method 🚂
2025-07-24 21:59:48 +07:00
Joshua Horton
521aae9709
Merge pull request #14364 from keymanapp/refactor/web/attempt-tokenized-alignment
refactor(web): new method - attemptTokenizedAlignment 🚂
2025-07-24 21:59:38 +07:00
Joshua Horton
3c36ee2e73
change(web): fix typo (per PR review)
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2025-07-24 20:38:03 +07:00
Joshua Horton
7e88fa2c41 docs(web): enhance doc-comment for getEditPathLastMatch
Per review request by @ermshiperete
2025-07-23 13:43:26 -05:00
Joshua Horton
0f3130fbd4
fix(web): properly apply Transforms in sequence
Thanks to a PR review that caught an accidental restart that hid one of the Transforms

Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2025-07-22 23:48:37 +07:00
Joshua Horton
f264fca881 change(web): split suggestion transforms into main-body + appended (whitespace) transforms 2025-07-21 15:57:28 -05:00
Joshua Horton
cd59e1fffb
fix(web): correct typo in unit test name
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2025-07-21 22:12:17 +07:00
Joshua Horton
a1c10de821 refactor(web): reworks attemptMatchContext to use new attemptTokenizedAlignment method
Following from #14364, this PR integrates the new method with the main predictive-text context-tracking code, significantly reworking the `attemptMatchContext` method in the process.  While further refactoring of the latter method is planned, this step allows us to verify that the new methods integrate properly with the main codebase in their current form.

This also comes with the benefit of simplifying `attemptMatchContext` _significantly_ - large parts of its code were refactored into `attemptTokenizedAlignment`, and the new logic patterns are generally more straightforward to parse and understand.
2025-07-15 14:16:51 -05:00
Joshua Horton
8c052968ae refactor(web): new method - attemptTokenizedAlignment
Following from #14363, this method performs context alignment calculations that may be
used to match forms of the context before and after an edit by aligning their tokens and
validating any edits that may have occurred.

Note that no 'tracked context' states are manipulated or altered by this method - it
solely calculates the alignment deltas needed to align the two contexts.  Other methods
may then take these values and determine the edits that occurred during the associated
context transition as needed.

Note that the `attemptTokenizedAlignment` method is not integrated into the main codebase
for the predictive-text worker at this time.  That said, this method _does_ integrate
the `isSubstitutionAlignable` method introduced by #14363.
2025-07-15 13:55:21 -05:00
Joshua Horton
9bbed384e6 feat(web): adds isSubstitutionAlignable to assist validating context matches after edits
This adds one new method within the predictive-text worker space: isSubstitutionAlignable. The method is designed to report whether or not two words are "related enough" to consider as an appropriate word-level "substitution" when matching the incoming context against previously-seen contexts - a process useful for facilitating delayed reversions, among other things.

It is not yet integrated with the main body of worker code, however.
2025-07-15 13:41:38 -05:00
Joshua Horton
606c7e7767 change(web): do not set deleteRight when merging Transforms without it 2025-07-10 09:17:12 -05:00
rc-swag
fd71c6354a
Merge branch 'epic/autocorrect' into chore/merge-master-into-autocorrect 2025-06-09 14:11:55 +10:00
Eberhard Beilharz
19d808c6e5
refactor(web): clarify API of KeymanSentryManager
This change marks the functions of `KeymanSentryManager` as public
or private, depending on whether or not they are used outside of the
module.

Test-bot: skip
2025-06-02 18:37:22 +02:00
Marc Durdin
31c55159c3
Merge branch 'epic/autocorrect' into chore/merge-master-into-autocorrect 2025-05-30 08:23:56 +07:00
Eberhard Beilharz
623d9b1d95
Merge pull request #14034 from keymanapp/feat/web/cherry-pick/fixtests 2025-05-26 18:41:44 +02:00
Eberhard Beilharz
dba5108989
chore(web): mark some private methods as being private 2025-05-23 17:45:09 +02:00
Joshua Horton
245f2324df fix(web): update sentry-integration test page setup 2025-05-23 09:00:29 +07:00
Joshua Horton
2f3286b020 fix(web): updates android-harness test page setup to use module-bundled Sentry 2025-05-23 08:18:33 +07:00
Eberhard Beilharz
a3e919f4ac
chore(web): cleanup async methods in UI components
Cherry-pick of changes in #12291. Addresses code review comment.

Test-bot: skip
2025-05-22 19:15:54 +02:00
Joshua Horton
bfb97ca0c6 maint(web): upgrade Sentry to 8.55.0
Fixes: KEYMAN-WEB-RX
(It was produced artificially after this PR's changes to validate them.)

Cross-reference with https://github.com/getsentry/sentry-javascript/blob/master/docs/migration/v7-to-v8.md in regard to minimum supported versions.

@keymanapp-test-bot skip
2025-05-22 14:02:16 +07:00