Commit graph

145 commits

Author SHA1 Message Date
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
51f6096bc7 Merge branch 'refactor/web/distribution-tokenization' into refactor/web/pred-context-transition 2025-08-05 12:05:44 -05:00
Joshua Horton
c72e655895 Merge branch 'refactor/web/init-state-from-reset' into refactor/web/distribution-tokenization 2025-08-05 12:04:53 -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
09611146dc fix(web): legacy model unit tests should use an actual legacy model 2025-08-05 10:27:48 -05:00
Joshua Horton
0cce2c51b3 Merge branch 'refactor/web/distribution-tokenization' into refactor/web/pred-context-transition 2025-08-05 08:47:24 -05:00
Joshua Horton
9baeb9247f fix(web): prevent double-application of input transforms during tokenization
Fixes: #14456
2025-08-05 08:42:51 -05:00
Marc Durdin
f3fb3ac87b maint(common): move build-utils-ci.inc.sh to ci/ci-publish.inc.sh
Removes a number of unused functions from the file, renames remaining
functions to match our builder script prefix patterns, removes unused
imports from various build scripts (e.g. Android).

Fixes: #14453
2025-08-05 12:54:56 +10:00
Joshua Horton
1dbe62e42e fix(web): stop unnecessarily cloning reused ContextState 2025-08-04 14:18:50 -05:00
Marc Durdin
2726050601 maint(common): rename and move node-related script functions into node.inc.sh
Consolidates the node-related script functions into node.inc.sh, as part
of cleaning up the build scripts and making them easier to maintain into
the future.

Fixes: #14447
2025-08-02 13:34:29 +10:00
Marc Durdin
f394245636 maint(common): consolidate builder scripts
Clarifies the confusing builder.inc.sh / build-utils.sh distinction by
giving the scripts more appropriate names. Most build scripts should use
builder-full.inc.sh; some helper scripts can use builder-basic.inc.sh.
Documented in resources/build/README.md.

Renames:
* resources/build/builder.inc.sh to resources/build/builder-full.inc.sh
* resources/build/build-utils.sh to resources/build/builder-basic.inc.sh

Other changes:
* Moves Android-specific functions out of builder-basic.inc.sh and into
  android/build.sh.
* Renames functions in builder-basic.inc.sh

More functions may be moved from builder-basic.inc.sh into utils.inc.sh
or other scripts in the future.

Fixes: #14065
Build-bot: build all
Test-bot: skip
2025-08-02 08:11:24 +10:00
Marc Durdin
65158a0526 maint(common): rename shellHelperFunctions.sh to utils.inc.sh
Adds documentation for various functions, removes unused functions (a
couple of simple, very lightly used functions were unDRYed; these could
go back the other way across all shell scripts if necessary). TODO items
noted for follow-up refactoring.

Fixes: #14275
Relates-to: #14269
Build-bot: build all
Test-bot: skip
2025-08-02 06:58:40 +10:00
Joshua Horton
bbf673cce2 Merge branch 'refactor/web/distribution-tokenization' into refactor/web/pred-context-transition 2025-08-01 15:17:33 -05:00
Joshua Horton
242d8d5e7f Merge branch 'refactor/web/init-state-from-reset' into refactor/web/distribution-tokenization 2025-08-01 15:07:18 -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
daf2ad5481 refactor(web): refactor tracked-context state-transition return object 2025-08-01 13:12:10 -05:00
Joshua Horton
3a56d24464 refactor(web): refactor tokenization of fat-finger distribution transforms into dedicated method 2025-08-01 13:08:24 -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
Marc Durdin
31c55159c3
Merge branch 'epic/autocorrect' into chore/merge-master-into-autocorrect 2025-05-30 08:23:56 +07:00
Marc Durdin
48d61b9b03
Merge branch 'epic/autocorrect' into chore/merge-master-into-autocorrect 2025-05-16 12:12:05 +07:00
Joshua Horton
155c1a2b12 maint: update mocha
Some of the npm audit warnings left after #13897 require an updated `mocha` version to remedy.  As we only really use `mocha` to do unit-testing, it should be safe to update if all of our existing tests pass with the new version.

Test-bot: skip
2025-05-13 14:02:02 +07:00
Joshua Horton
a783fbc902 maint(web): also fixes worker-thread inspectable browser test call 2025-05-13 12:44:26 +07:00
Joshua Horton
1438704ee0
Merge pull request #13819 from keymanapp/maint/web/use-builder_is_ci_build
chore(web): replace --ci flag with builder_is_ci_build
2025-05-06 08:16:37 +07:00
Joshua Horton
e382bf45ce
Merge pull request #13785 from keymanapp/change/web/drop-usvstring-alias
change(web): replace USVString with string in predictive-text engine
2025-05-06 08:16:28 +07:00