Skip to content
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
398 commits
Select commit Hold shift + click to select a range
789ff19
Merge remote-tracking branch 'upstream/main' into sync-upstream-main-…
marcus-pousette May 30, 2026
7666d36
Merge pull request #17 from Antonov548/sync-upstream-main-2026-05-30
Antonov548 May 31, 2026
963f20d
test: wait for tree operations
Antonov548 May 31, 2026
ea1b111
fix eslint
Antonov548 May 31, 2026
2430a84
Merge pull request #18 from Antonov548/fix/tests-wait-tree
marcus-pousette May 31, 2026
0b6bf3f
Fix iOS waitForEmIdle helper
marcus-pousette May 31, 2026
c5fe115
Fix iOS focus on cursor selection
marcus-pousette Jun 1, 2026
e7d6f36
Merge pull request #20 from Antonov548/fix/ios-wait-for-em-idle
Antonov548 Jun 1, 2026
5389e16
move sync init to `thoughtspace`
Antonov548 Jun 3, 2026
ac245a4
fix eslint
Antonov548 Jun 3, 2026
30f906d
add `TRANSIENT_THOUGHT_ID` to constants
Antonov548 Jun 3, 2026
e1c0c2f
Revert Editable changes from TreeCRDT branch
marcus-pousette Jun 4, 2026
196c2e1
Merge pull request #26 from Antonov548/revert/editable-treecrdt-changes
Antonov548 Jun 4, 2026
6ad91c2
Merge pull request #25 from Antonov548/cleanup/transient-constant
marcus-pousette Jun 4, 2026
4da24da
Merge pull request #24 from Antonov548/feat/sync-init-cleanup
marcus-pousette Jun 4, 2026
26fbe5d
Inline settings bootstrap helper
marcus-pousette Jun 4, 2026
50370b1
Merge pull request #29 from Antonov548/cleanup/inline-settings-helper
Antonov548 Jun 4, 2026
2ac2500
Keep TreeCRDT freeLexeme cache-only
marcus-pousette Jun 5, 2026
d61552e
Merge pull request #30 from Antonov548/fix/treecrdt-free-lexeme-cache…
Antonov548 Jun 5, 2026
80234c9
fix: remove command usage from tests
Antonov548 Jun 5, 2026
de1f360
fix eslint
Antonov548 Jun 5, 2026
e4d0516
fix eslint
Antonov548 Jun 5, 2026
99c4c37
Merge pull request #31 from Antonov548/fix/test-command-usage
marcus-pousette Jun 5, 2026
d5b2132
revert before input
Antonov548 Jun 7, 2026
758bf24
Merge remote-tracking branch 'upstream/main' into merge-upstream
Antonov548 Jun 8, 2026
87bb75b
Merge pull request #34 from Antonov548/merge-upstream
marcus-pousette Jun 8, 2026
7378236
Scope e2e persistence waits to refresh
marcus-pousette Jun 8, 2026
1769c5b
Merge pull request #32 from Antonov548/fix/revert-before-input
marcus-pousette Jun 8, 2026
e0b03af
Merge pull request #33 from Antonov548/fix/e2e-helper-persistence-waits
Antonov548 Jun 8, 2026
2d2b571
Merge remote-tracking branch 'upstream/main' into merge-upstream-2026…
marcus-pousette Jun 8, 2026
90b0954
Merge pull request #36 from Antonov548/merge-upstream-2026-06-08
Antonov548 Jun 9, 2026
a10a2d8
Move TreeCRDT internals behind thoughtspace boundary
marcus-pousette Jun 4, 2026
791ea73
Merge pull request #27 from Antonov548/draft/thoughtspace-provider-bo…
Antonov548 Jun 9, 2026
ac40bf0
Merge remote-tracking branch 'upstream/main' into merge-upstream-2026…
marcus-pousette Jun 10, 2026
4057bba
Merge pull request #37 from Antonov548/merge-upstream-2026-06-10
Antonov548 Jun 10, 2026
5d257c5
cleanup storage and initialize
Antonov548 Jun 11, 2026
9c3df10
fix eslint
Antonov548 Jun 11, 2026
86401ec
Merge pull request #39 from Antonov548/cleanup-unused
marcus-pousette Jun 11, 2026
3a6b651
Merge upstream main
marcus-pousette Jun 15, 2026
f8f86cb
Merge pull request #41 from Antonov548/sync/upstream-2026-06-15
Antonov548 Jun 15, 2026
f04d032
treecrdt usage for the vitest
Antonov548 Jun 16, 2026
361a93b
fix typo
Antonov548 Jun 16, 2026
3e9d737
Bump @treecrdt/wa-sqlite to 0.3.1
marcus-pousette Jun 17, 2026
062bcaf
Fix real TreeCRDT Vitest runtime integration
marcus-pousette Jun 17, 2026
c38ebad
Add undo move persistence regression
marcus-pousette Jun 17, 2026
bb50c79
Stabilize TreeCRDT pull queue teardown
marcus-pousette Jun 17, 2026
aa6a187
Cover redo persistence with isolated test docs
marcus-pousette Jun 18, 2026
c1ef837
Merge pull request #43 from Antonov548/fix/treecrdt-vitest-real-provider
Antonov548 Jun 18, 2026
073b25a
Merge pull request #42 from Antonov548/node-treecrdt-vitest
Antonov548 Jun 18, 2026
4b948b6
Merge remote-tracking branch 'upstream/main' into upstream-merge
Antonov548 Jun 18, 2026
e43ec74
Merge pull request #44 from Antonov548/upstream-merge
marcus-pousette Jun 18, 2026
e166664
Merge upstream dependency updates
marcus-pousette Jun 19, 2026
6ffedce
Merge pull request #45 from Antonov548/sync/upstream-2026-06-19
Antonov548 Jun 19, 2026
f4fd465
revert `scrollY` check
Antonov548 Jun 22, 2026
088b529
Sync upstream swapNote fix
marcus-pousette Jun 22, 2026
6634b2b
Merge pull request #47 from Antonov548/sync/upstream-2026-06-22
Antonov548 Jun 22, 2026
495dd12
Restore context superscript color coverage
marcus-pousette Jun 22, 2026
63ba77e
Merge pull request #48 from Antonov548/restore-color-context-superscript
Antonov548 Jun 22, 2026
7ec5435
Restore virtualization Puppeteer helper usage
marcus-pousette Jun 22, 2026
dffc92e
Remove implicit focus from press helper
marcus-pousette Jun 22, 2026
6e72ebb
Clarify Puppeteer readiness setup
marcus-pousette Jun 22, 2026
9ac6ffb
Merge pull request #49 from Antonov548/cleanup-virtualization-test
Antonov548 Jun 22, 2026
74b6514
Merge pull request #50 from Antonov548/remove-press-auto-focus
Antonov548 Jun 22, 2026
7ca3569
Merge pull request #51 from Antonov548/cleanup-puppeteer-ready-setup
Antonov548 Jun 22, 2026
9ce8e4a
resolve attribute thoughts by value
Antonov548 Jun 23, 2026
31324be
fix lint
Antonov548 Jun 23, 2026
1cf96a1
Fix TreeCRDT attribute childrenMap materialization
marcus-pousette Jun 23, 2026
4bf1dcc
Clarify attribute childrenMap lookups
marcus-pousette Jun 23, 2026
0962606
Avoid TreeCRDT provider leak in unit test
marcus-pousette Jun 23, 2026
2cfa062
Index TreeCRDT attribute children
marcus-pousette Jun 24, 2026
b1b6274
Avoid unnecessary attribute index reads
marcus-pousette Jun 24, 2026
8ce1cc3
Skip attribute index update on reorder
marcus-pousette Jun 24, 2026
4177950
Cache TreeCRDT lexeme schema readiness
marcus-pousette Jun 24, 2026
1883faf
Merge pull request #53 from Antonov548/lexeme-schema-ready-cache
Antonov548 Jun 24, 2026
3b36be5
Merge pull request #52 from marcus-pousette/treecrdt-attribute-childr…
Antonov548 Jun 24, 2026
23ddffb
Merge pull request #46 from Antonov548/revet-scroll-test
Antonov548 Jun 24, 2026
ef24aca
Restore mobile caret test flow
marcus-pousette Jun 24, 2026
6bbc5c3
Remove stale TreeCRDT cleanup leftovers
marcus-pousette Jun 24, 2026
37ce7cc
Remove Redux wait from iOS keyboard helper
marcus-pousette Jun 11, 2026
1464343
Merge pull request #54 from Antonov548/cleanup-mobile-tap-helper
Antonov548 Jun 24, 2026
dd21315
Merge pull request #55 from Antonov548/cleanup/stale-treecrdt-remnants
Antonov548 Jun 24, 2026
afebeec
Merge pull request #40 from Antonov548/cleanup/remove-ios-redux-keybo…
Antonov548 Jun 24, 2026
3680120
Harden TreeCRDT idle error handling
marcus-pousette Jun 25, 2026
1af58e2
Merge pull request #56 from Antonov548/fix/treecrdt-idle-async-errors
Antonov548 Jun 26, 2026
caa6004
Merge remote-tracking branch 'upstream/main' into upstream-merge
Antonov548 Jun 27, 2026
a2d15e5
Merge pull request #57 from Antonov548/upstream-merge
marcus-pousette Jun 27, 2026
9c48620
Merge upstream main
marcus-pousette Jun 29, 2026
d82af55
Merge pull request #58 from Antonov548/sync/upstream-2026-06-29
Antonov548 Jun 29, 2026
3afb7e4
Merge upstream cybersemics/em
marcus-pousette Jun 30, 2026
2dbdc81
Merge pull request #59 from Antonov548/sync/upstream-2026-06-30
Antonov548 Jun 30, 2026
f1e1bb9
remove y-indexeddb from resolutions
Antonov548 Jul 1, 2026
f08488c
Merge pull request #60 from Antonov548/chore/cleanup-package-resolutions
marcus-pousette Jul 1, 2026
f1bbb6f
remove wait db in tests dispatch
Antonov548 Jul 1, 2026
4943612
Handle stale TreeCRDT afterId placements
marcus-pousette Jul 1, 2026
9b23640
Merge pull request #63 from Antonov548/fix/treecrdt-stale-afterid-fal…
Antonov548 Jul 1, 2026
e6b774c
Merge pull request #62 from Antonov548/tests/dispatch-db-wait
marcus-pousette Jul 1, 2026
8c5aa4d
Inline TreeCRDT batch persistence helper
marcus-pousette Jul 1, 2026
b5c0730
Use concrete TreeCRDT thoughtspace init in test
marcus-pousette Jul 1, 2026
5c06b08
Merge pull request #66 from Antonov548/fix/use-concrete-treecrdt-thou…
Antonov548 Jul 1, 2026
1e83d7e
Merge pull request #65 from Antonov548/fix/inline-treecrdt-persist-ba…
Antonov548 Jul 1, 2026
d7c8580
Restore TreeCRDT replication delay test hook
marcus-pousette Jul 1, 2026
7f95028
Keep move afterId helper private
marcus-pousette Jul 1, 2026
086e3ee
Clarify color context navigation test
marcus-pousette Jul 1, 2026
a3424bf
Merge pull request #64 from Antonov548/fix/private-move-afterid-helper
Antonov548 Jul 2, 2026
e484772
treecrdt vite config
Antonov548 Jul 2, 2026
2d798ba
Merge pull request #68 from Antonov548/fix/treecrdt-replication-delay…
Antonov548 Jul 3, 2026
c289f68
Merge pull request #67 from Antonov548/fix/restore-color-context-arro…
Antonov548 Jul 3, 2026
c9d70ba
Merge pull request #69 from Antonov548/cleanup-vite-config
marcus-pousette Jul 3, 2026
3274514
Merge remote-tracking branch 'upstream/main' into sync-upstream
Antonov548 Jul 6, 2026
3ef5481
fix order in package.json
Antonov548 Jul 6, 2026
cd1a88c
Merge pull request #71 from Antonov548/sync-upstream
marcus-pousette Jul 6, 2026
eed97fc
remove method rename
Antonov548 Jul 6, 2026
0329dd0
rename
Antonov548 Jul 6, 2026
26a2d42
Merge pull request #72 from Antonov548/refactor/runtime-method-rename
marcus-pousette Jul 6, 2026
6962fb6
Fix context view root sort stability
marcus-pousette Jul 6, 2026
0312483
Bound thoughtspace provider idle waits
marcus-pousette Jul 6, 2026
086c191
Inline Puppeteer app ready waits
marcus-pousette Jul 6, 2026
109f7c8
Merge pull request #74 from Antonov548/fix/thoughtspace-provider-idle
Antonov548 Jul 7, 2026
69f58a9
Merge pull request #73 from Antonov548/fix/context-view-root-sort
Antonov548 Jul 7, 2026
a3f1c6e
Merge upstream main
marcus-pousette Jul 7, 2026
c123385
Align pinAll export tests with fixed root id
marcus-pousette Jul 7, 2026
7d22b5e
Use createId for Puppeteer session ids
marcus-pousette Jul 7, 2026
7546f57
Return export replications explicitly
marcus-pousette Jul 7, 2026
cbe2da2
Merge pull request #76 from Antonov548/sync/upstream-2026-07-07
Antonov548 Jul 7, 2026
372b7f5
Merge pull request #77 from Antonov548/fix/formalize-puppeteer-sessio…
Antonov548 Jul 7, 2026
aee7fce
Merge pull request #78 from Antonov548/fix/export-replications-return
Antonov548 Jul 7, 2026
e15f926
Minimize pullQueue status changes
marcus-pousette Jul 7, 2026
717302d
Default Puppeteer workers to bounded parallelism
marcus-pousette Jul 7, 2026
48efabd
Decouple TreeCRDT materialization from Redux store
marcus-pousette Jul 7, 2026
ffdb4ff
Merge pull request #83 from Antonov548/fix/default-puppeteer-max-workers
Antonov548 Jul 7, 2026
8c7c017
Merge pull request #84 from Antonov548/fix/materialization-redux-boun…
Antonov548 Jul 8, 2026
4c3cc86
Merge remote-tracking branch 'upstream/main' into sync-upstream
Antonov548 Jul 8, 2026
0afc715
Merge pull request #85 from Antonov548/sync-upstream
marcus-pousette Jul 8, 2026
449b78b
remove test thoughtspace
Antonov548 Jul 9, 2026
1f3db2e
Merge pull request #86 from Antonov548/remove-test-thoughtspace
marcus-pousette Jul 9, 2026
9849e2b
Deduplicate Puppeteer app readiness waits
marcus-pousette Jul 10, 2026
341d272
Merge pull request #87 from Antonov548/fix/remove-redundant-testhelpe…
Antonov548 Jul 10, 2026
6e445de
Merge pull request #80 from Antonov548/fix/minimize-pull-queue-status
Antonov548 Jul 10, 2026
9f34c79
Integrate lazy TreeCRDT RIBLT startup
marcus-pousette Jul 13, 2026
db43bcc
Merge pull request #88 from Antonov548/fix/integrate-treecrdt-lazy-riblt
Antonov548 Jul 13, 2026
11661bb
Inline Puppeteer initialization waits
marcus-pousette Jul 13, 2026
57c7817
Merge pull request #89 from Antonov548/refactor/inline-puppeteer-init…
Antonov548 Jul 13, 2026
ce2befc
chore(deps): bump @treecrdt/wa-sqlite to 0.3.2
marcus-pousette Jul 14, 2026
5e0ecaa
Merge pull request #91 from Antonov548/fix/wa-sqlite-shared-worker-pe…
Antonov548 Jul 14, 2026
77244c4
Merge upstream main into Antonov fork
marcus-pousette Jul 14, 2026
6ecfd07
Merge pull request #93 from Antonov548/sync/upstream-2026-07-14
Antonov548 Jul 14, 2026
72abef1
Merge remote-tracking branch 'origin/main' into sync/upstream-2026-07-20
marcus-pousette Jul 20, 2026
114fafb
Merge pull request #97 from Antonov548/sync/upstream-2026-07-20
Antonov548 Jul 20, 2026
46aa419
Fix Chrome OPFS startup with TreeCRDT auto runtime
marcus-pousette Jul 17, 2026
f41799c
Guard TreeCRDT storage to one active tab
marcus-pousette Jul 20, 2026
0131092
Restore real Puppeteer tutorial click
marcus-pousette Jul 20, 2026
6f87b74
Hide TreeCRDT access behind thoughtspace runtime
marcus-pousette Jul 21, 2026
92c779d
Remove unrelated Puppeteer URL override
marcus-pousette Jul 21, 2026
213b81c
Clarify initialization readiness names
marcus-pousette Jul 21, 2026
f6074c2
Tighten single-tab bootstrap and coverage
marcus-pousette Jul 21, 2026
6dbf5cf
Document TDD setup compatibility
marcus-pousette Jul 21, 2026
02ffaa4
Remove TDD compatibility cast
marcus-pousette Jul 21, 2026
e43bf32
Isolate session lock tests
marcus-pousette Jul 21, 2026
57d0d96
Merge pull request #100 from Antonov548/fix/treecrdt-single-tab-lock
Antonov548 Jul 21, 2026
bba5e8a
Merge branch 'main' into pr/4325
raineorshine Jul 21, 2026
2da7ab3
Refactor TreeCRDT test configuration
marcus-pousette Jul 22, 2026
0ee9ff2
Separate TreeCRDT tab policy
marcus-pousette Jul 22, 2026
1ddfdfe
Shorten TreeCRDT test flag name
marcus-pousette Jul 22, 2026
895113f
Refine TreeCRDT test configuration
marcus-pousette Jul 22, 2026
647eacd
Decouple TreeCRDT config from test flags
marcus-pousette Jul 22, 2026
0e8bfbe
Document bootstrap config lifecycle
marcus-pousette Jul 22, 2026
a7b623f
Merge pull request #104 from Antonov548/refactor/treecrdt-bootstrap-c…
marcus-pousette Jul 22, 2026
f1d443d
Clarify bootstrap config overrides
marcus-pousette Jul 22, 2026
9b7e90e
Merge pull request #102 from Antonov548/refactor/treecrdt-test-config
Antonov548 Jul 22, 2026
4249b79
chore: bump @treecrdt/wa-sqlite to 0.3.4
marcus-pousette Jul 22, 2026
b3e2bb7
Merge pull request #105 from Antonov548/chore/treecrdt-wa-sqlite-0.3.4
Antonov548 Jul 22, 2026
f88f694
Refactor TreeCRDT bootstrap namespace
marcus-pousette Jul 24, 2026
f0501c5
Simplify window.em test access
marcus-pousette Jul 24, 2026
c3913d0
merge upstream
Antonov548 Jul 30, 2026
ca0f628
fix vite config after merge
Antonov548 Jul 30, 2026
db86185
Merge pull request #112 from Antonov548/merge-upstream
marcus-pousette Aug 2, 2026
e5ec9ee
Merge remote-tracking branch 'upstream/main' into merge-upstream
Antonov548 Aug 4, 2026
91e52e4
fix tests
Antonov548 Aug 4, 2026
ae2822b
Merge pull request #113 from Antonov548/merge-upstream
marcus-pousette Aug 4, 2026
a83cd44
Merge pull request #108 from Antonov548/refactor/window-em-treecrdt-c…
Antonov548 Aug 4, 2026
cb5f356
Merge pull request #109 from Antonov548/refactor/window-em-test-api
marcus-pousette Aug 4, 2026
cb03a39
Address TreeCRDT review feedback
marcus-pousette Jul 24, 2026
7dc894f
Refine TreeCRDT ownership surface
marcus-pousette Aug 4, 2026
261ebc6
Streamline TreeCRDT lifecycle tests
marcus-pousette Aug 4, 2026
675d3fc
Simplify TreeCRDT ownership types
marcus-pousette Aug 4, 2026
45d90d7
Remove app-owned outbound sync buffering
marcus-pousette Aug 4, 2026
158130e
Clarify TreeCRDT materialization context
marcus-pousette Aug 4, 2026
a05dd03
Adopt terminal wa-sqlite teardown
marcus-pousette Aug 4, 2026
54cb139
Clarify TreeCRDT runtime test doubles
marcus-pousette Aug 4, 2026
fdec34a
Clarify TreeCRDT drop settlement
marcus-pousette Aug 4, 2026
57ddd18
Simplify TreeCRDT provider readiness
marcus-pousette Aug 5, 2026
7643cde
Clarify TreeCRDT provider lifecycle
marcus-pousette Aug 5, 2026
f32545a
Merge pull request #106 from Antonov548/refactor/pr4325-review-cleanup
marcus-pousette Aug 5, 2026
c84a772
Merge upstream main
marcus-pousette Aug 6, 2026
dc2e692
test: preserve upstream gesture emulation
marcus-pousette Aug 6, 2026
764c9c7
Simplify preload window type
marcus-pousette Aug 6, 2026
18223ea
Merge pull request #118 from Antonov548/cleanup/bootstrap-window-type
Antonov548 Aug 6, 2026
7516572
update comment
Antonov548 Aug 6, 2026
830c796
remove optional check
Antonov548 Aug 6, 2026
a64d0a9
Merge pull request #120 from Antonov548/chore/refresh-comment
marcus-pousette Aug 6, 2026
cb3123b
Decouple Puppeteer setup from TreeCRDT startup
marcus-pousette Aug 6, 2026
7034e33
Inline derived lexeme persistence
marcus-pousette Aug 6, 2026
d25914a
Merge pull request #122 from Antonov548/fix/puppeteer-ui-readiness
Antonov548 Aug 7, 2026
dec1dc1
Merge pull request #123 from Antonov548/refactor/inline-materializati…
Antonov548 Aug 7, 2026
5b07f6f
use common type ThoughtUpdates
Antonov548 Aug 7, 2026
bc5ee9c
Merge pull request #117 from Antonov548/sync/upstream-2026-08-06
Antonov548 Aug 7, 2026
8018f84
Merge pull request #125 from Antonov548/refactor/mat-type-refactor
marcus-pousette Aug 7, 2026
cc3d0d2
Pass thoughtspace storage through initialize
marcus-pousette Aug 7, 2026
56bff5d
Trim defensive storage tests
marcus-pousette Aug 7, 2026
e7469b1
Assert the thoughtspace document id
marcus-pousette Aug 7, 2026
6fc7602
Inline memory storage in runtime tests
marcus-pousette Aug 7, 2026
0c8c52d
Describe current thoughtspace test storage
marcus-pousette Aug 7, 2026
c60c8c8
Simplify thoughtspace storage initialization
marcus-pousette Aug 7, 2026
f47ba91
Move thoughtspace storage selection to startup
marcus-pousette Aug 7, 2026
6b10b37
Merge pull request #124 from Antonov548/refactor/explicit-thoughtspac…
Antonov548 Aug 8, 2026
ad5594d
Merge remote-tracking branch 'upstream/main' into merge-upstream
Antonov548 Aug 8, 2026
6c0e68e
update yarn.lock
Antonov548 Aug 8, 2026
d7afbda
Merge pull request #126 from Antonov548/merge-upstream
marcus-pousette Aug 8, 2026
38dddd2
test: remove obsolete gesture connection wait
marcus-pousette Aug 8, 2026
2413d66
Merge pull request #127 from Antonov548/test/remove-obsolete-gesture-…
Antonov548 Aug 9, 2026
75c063a
Align TreeCRDT browser runtime configuration
marcus-pousette Aug 9, 2026
669eda7
Merge pull request #128 from Antonov548/fix/treecrdt-browser-assets-n…
Antonov548 Aug 10, 2026
f9e8457
Test wide TreeCRDT sibling placement reads
marcus-pousette Aug 11, 2026
c711ecb
Avoid redundant TreeCRDT sibling reads
marcus-pousette Aug 11, 2026
6320a41
Clarify TreeCRDT test provider type
marcus-pousette Aug 11, 2026
ec5b98b
Fall back to memory when OPFS is unavailable
marcus-pousette Aug 12, 2026
da54245
Keep private storage docs developer-facing
marcus-pousette Aug 12, 2026
1153664
Narrow memory fallback regression
marcus-pousette Aug 12, 2026
6de5ac8
Merge pull request #130 from Antonov548/fix/treecrdt-wide-sibling-per…
Antonov548 Aug 12, 2026
b44553d
Merge pull request #131 from Antonov548/fix/treecrdt-memory-fallback
Antonov548 Aug 12, 2026
8f90d77
Merge upstream main
marcus-pousette Aug 12, 2026
0727044
Merge pull request #132 from Antonov548/sync/upstream-2026-08-12
Antonov548 Aug 12, 2026
b4bd86f
Merge upstream main
marcus-pousette Aug 12, 2026
1d0a709
Retain test environment documentation
marcus-pousette Aug 12, 2026
31fc1b6
Merge pull request #134 from Antonov548/fix/retain-testing-context
Antonov548 Aug 13, 2026
3e4997c
Merge pull request #133 from Antonov548/sync/upstream-2026-08-12-late
Antonov548 Aug 13, 2026
47da7b1
Update TreeCRDT wa-sqlite to 0.4.2
marcus-pousette Aug 14, 2026
9ff8cc0
Merge pull request #135 from Antonov548/chore/treecrdt-wa-sqlite-0.4.2
Antonov548 Aug 14, 2026
d72a47e
Merge remote-tracking branch 'upstream/main' into merge-upstream-8-14…
Antonov548 Aug 14, 2026
432e41c
fix lint
Antonov548 Aug 14, 2026
fdd115d
fix tests
Antonov548 Aug 14, 2026
c592284
fix import
Antonov548 Aug 14, 2026
22d475c
feedback
Antonov548 Aug 14, 2026
0649af4
update docs
Antonov548 Aug 14, 2026
738875a
Merge pull request #138 from Antonov548/merge-upstream-8-14-2026
marcus-pousette Aug 14, 2026
7df5e53
Merge upstream main
marcus-pousette Aug 17, 2026
c7f2005
Merge pull request #139 from Antonov548/sync/upstream-2026-08-17
Antonov548 Aug 17, 2026
54aea5b
Merge upstream main
marcus-pousette Aug 17, 2026
5307fed
Merge latest upstream main
marcus-pousette Aug 18, 2026
2fbbae0
Merge pull request #140 from Antonov548/sync/upstream-2026-08-18
Antonov548 Aug 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ CAPACITOR_SERVER_URL=https://localhost:3000

# AI SERVER
VITE_AI_URL=http://localhost:3111/ai

# TREECRDT SYNC (optional) — direct ws/wss or http(s) discovery bootstrap; doc id matches thoughtspace (tsid)
# VITE_TREECRDT_SYNC_BASE_URL=
11 changes: 11 additions & 0 deletions .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ jobs:
name: BrowserStack
runs-on: ubuntu-latest
if: github.event_name != 'pull_request_target' || github.event.pull_request.changed_files > 0
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

# The repo-wide gate — see the concurrency comment at the top of the file for why it sits at the
# job level (it must coexist with the per-PR workflow-level group; a workflow gets only one
Expand Down Expand Up @@ -202,9 +205,11 @@ jobs:
cache: 'yarn'

- name: Install npm dependencies
if: env.BROWSERSTACK_USERNAME != '' && env.BROWSERSTACK_ACCESS_KEY != ''
uses: ./.github/actions/install

- name: Build
if: env.BROWSERSTACK_USERNAME != '' && env.BROWSERSTACK_ACCESS_KEY != ''
run: yarn build

- name: Generate tunnel token
Expand All @@ -215,6 +220,7 @@ jobs:
echo "TUNNEL_TOKEN=$TOKEN" >> "$GITHUB_ENV"

- name: Serve
if: env.BROWSERSTACK_USERNAME != '' && env.BROWSERSTACK_ACCESS_KEY != ''
env:
HAS_TOKEN_GATE: ${{ steps.server_mode.outputs.has_token_gate }}
run: |
Expand Down Expand Up @@ -248,7 +254,12 @@ jobs:
sleep 1
done

- name: Skip BrowserStack
if: env.BROWSERSTACK_USERNAME == '' || env.BROWSERSTACK_ACCESS_KEY == ''
run: echo "Skipping BrowserStack because credentials are not configured."

- name: Test iOS on BrowserStack
if: env.BROWSERSTACK_USERNAME != '' && env.BROWSERSTACK_ACCESS_KEY != ''
run: yarn test:ios
env:
BROWSERSTACK_USERNAME: ${{secrets.BROWSERSTACK_USERNAME}}
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ desktop/gen/schemas
# diff images output from failed Puppeteer snapshot tests
__diff_output__

# wa-sqlite assets (generated by treecrdt vite plugin)
public/wa-sqlite

## PandaCSS
styled-system
styled-system-studio
Expand Down
8 changes: 4 additions & 4 deletions docs/folder-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ The main directory structure is organized as follows. Tests are located in a sub
- [`/src/actions`](../src/actions) — Redux reducers and action-creators are co-located. Prefer reducers when possible, as they are pure functions that are more easily testable and composable. Only define an action creator if it requires a side effect. Use [`util/reducerFlow`](../src/util/reducerFlow.ts) to compose reducers.
- [`/src/commands`](../src/commands) — Keyboard, gesture, and toolbar commands (formerly `shortcuts`). One file per command, plus an `index.ts` barrel. See [commands.md](commands.md) for the architecture.
- [`/src/components`](../src/components) — React components.
- [`/src/data-providers`](../src/data-providers) — Storage and sync backends implementing the [`DataProvider`](../src/data-providers/DataProvider.ts) interface. The live implementation is YJS in [`yjs/thoughtspace.ts`](../src/data-providers/yjs/thoughtspace.ts). See [persistence.md](persistence.md).
- [`/src/data-providers`](../src/data-providers) — Storage and sync backends implementing the [`DataProvider`](../src/data-providers/DataProvider.ts) interface. The live implementation is TreeCRDT in [`treecrdt/thoughtspace.ts`](../src/data-providers/treecrdt/thoughtspace.ts). See [persistence.md](persistence.md).
- [`/src/device`](../src/device) — Device/DOM-level helpers for selection, scrolling, clipboard, focus, and platform detection. The selection wrapper [`device/selection.ts`](../src/device/selection.ts) is the single point of access to `window.getSelection()` (enforced by lint). See [cursor-and-caret.md](cursor-and-caret.md).
- [`/src/e2e`](../src/e2e) — End-to-end test setup, including Puppeteer and iOS environments. See [testing.md](testing.md).
- [`/src/hooks`](../src/hooks) — React hooks.
- [`/src/recipes`](../src/recipes) — Panda CSS recipes that define styled component variants. Prefer inline CSS (`css({ ... })`); only add a recipe here when the styles have variants or are shared by multiple components.
- [`/src/redux-enhancers`](../src/redux-enhancers) — Redux enhancers (e.g. the [`pushQueue`](../src/redux-enhancers/pushQueue.ts) that flushes state mutations to YJS).
- [`/src/recipes`](../src/recipes) — Panda CSS recipes that define styled component variants. New components should use these or inline styles.
- [`/src/redux-enhancers`](../src/redux-enhancers) — Redux enhancers (e.g. the [`pushQueue`](../src/redux-enhancers/pushQueue.ts) that flushes state mutations to thoughtspace persistence).
- [`/src/redux-middleware`](../src/redux-middleware) — Redux middleware (e.g. the [`pullQueue`](../src/redux-middleware/pullQueue.ts) that loads thoughts on demand, or [`clearSelection`](../src/redux-middleware/clearSelection.ts) that clears the browser caret on cursor changes).
- [`/src/selectors`](../src/selectors) — Pure functions that compute (and often memoize) slices from the Redux state. See [data-model.md](data-model.md) for the canonical traversal selectors.
- [`/src/stores`](../src/stores) — Lightweight non-Redux ministores for ephemeral UI state. Examples: [`editingValue`](../src/stores/editingValue.ts) (the in-progress thought text), [`viewport`](../src/stores/viewport.ts), [`scrollTop`](../src/stores/scrollTop.ts), [`gesture`](../src/stores/gesture.ts), [`syncStatus`](../src/stores/syncStatus.ts), [`selectionRangeStore`](../src/stores/selectionRangeStore.ts).
Expand Down Expand Up @@ -42,7 +42,7 @@ The main directory structure is organized as follows. Tests are located in a sub
| Non-Redux UI state | [`stores/`](../src/stores) |
| Browser DOM / selection / scroll APIs | [`device/`](../src/device) |
| User-triggered command | [`commands/`](../src/commands) |
| Yjs persistence engine | [`data-providers/yjs/thoughtspace.ts`](../src/data-providers/yjs/thoughtspace.ts) |
| TreeCRDT persistence engine | [`data-providers/treecrdt/thoughtspace.ts`](../src/data-providers/treecrdt/thoughtspace.ts) |
| Layout positioning math | [`hooks/usePositionedThoughts.ts`](../src/hooks/usePositionedThoughts.ts) |
| Visible-thoughts traversal | [`selectors/linearizeTree.ts`](../src/selectors/linearizeTree.ts) |
| Pure helper (no React, no Redux) | [`util/`](../src/util) |
Expand Down
4 changes: 2 additions & 2 deletions docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ A flat reference of project-specific terms used in code and docs. For deeper con

## D

**DataProvider** — The single interface ([`DataProvider.ts`](../src/data-providers/DataProvider.ts)) for storage backends. `db` in [`yjs/thoughtspace.ts`](../src/data-providers/yjs/thoughtspace.ts) is the live implementation.
**DataProvider** — The single interface ([`DataProvider.ts`](../src/data-providers/DataProvider.ts)) for storage backends. The active implementation is exported through [`data-providers/thoughtspace.ts`](../src/data-providers/thoughtspace.ts).

**dbQueue / freeQueue** — Two halves of the push-queue split. `dbQueue` writes batches with `local || remote` set; `freeQueue` releases entries from the in-memory cache. See [persistence.md → Push queue](persistence.md#push-queue-redux--yjs).

Expand Down Expand Up @@ -192,7 +192,7 @@ A flat reference of project-specific terms used in code and docs. For deeper con

**updatedBy** — `clientId` of the writer. Stamped on every Thought and Lexeme write so observers can filter out self-originated change events.

**updateThoughts** — Both an action ([`actions/updateThoughts.ts`](../src/actions/updateThoughts.ts)) that mutates Redux and queues a push, and the `DataProvider` entry point ([`yjs/thoughtspace.ts`](../src/data-providers/yjs/thoughtspace.ts)) that writes to Yjs. The action calls into the provider via the push queue.
**updateThoughts** — The action ([`actions/updateThoughts.ts`](../src/actions/updateThoughts.ts)) that mutates Redux and queues a push. The push queue persists those batches through the active data provider's `updateThoughts`.

## V

Expand Down
14 changes: 7 additions & 7 deletions docs/persistence.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Two queues bridge Redux and the local Yjs store:
- **Push queue** ([`redux-enhancers/pushQueue.ts`](../src/redux-enhancers/pushQueue.ts)) drains `state.pushQueue` after every action and writes to Yjs.
- **Pull queue** ([`redux-middleware/pullQueue.ts`](../src/redux-middleware/pullQueue.ts)) tracks visible thoughts and pulls any pending ones from Yjs.

The single point of integration with Yjs is the [`DataProvider`](../src/data-providers/DataProvider.ts) interface, implemented as `db` in [`data-providers/yjs/thoughtspace.ts`](../src/data-providers/yjs/thoughtspace.ts).
The single point of integration with persistence is the [`DataProvider`](../src/data-providers/DataProvider.ts) interface, implemented by the active thoughtspace backend.

## In-memory state (Redux)

Expand Down Expand Up @@ -89,7 +89,7 @@ If IDB returns `AbortError` (the app was closed mid-sync), replication retries a

- [`updateThought`](../src/data-providers/yjs/thoughtspace.ts) writes a single thought into its parent Y.Doc. If the thought has changed parents, it deletes the entry from the old parent Doc, updates the docKey in `docKeys` and in the Lexeme's `cx-${id}` map, and writes to the new parent. (These three writes span three Docs and are not atomic — there's a known risk of partial-failure inconsistency, called out in a code comment.) `childrenMap` is merged key-by-key as a nested `Y.Map<ThoughtId>`; other fields are written only if the value changed, to avoid emitting redundant CRDT updates.
- [`updateLexeme`](../src/data-providers/yjs/thoughtspace.ts) adds and removes contexts via `cx-${id}` keys.
- [`updateThoughts`](../src/data-providers/yjs/thoughtspace.ts) is the public `DataProvider` entry point. It groups updates and deletes, then submits both groups to a `TaskQueue` with **concurrency 16** ([`util/taskQueue.ts`](../src/util/taskQueue.ts)). Updates run before deletes within a single batch.
- `DataProvider.updateThoughts` is the public persistence entry point for push-queue thought and lexeme batches.

All update paths await `IndexeddbPersistence.whenSynced` (i.e. they resolve when the write hits IDB), but do not wait on the websocket.

Expand Down Expand Up @@ -126,7 +126,7 @@ In effect, on `main` Yjs is used as a local-only document store. Local IndexedDB

[`redux-enhancers/pushQueue.ts`](../src/redux-enhancers/pushQueue.ts) is a Redux store enhancer that runs after every reducer. It drains `state.pushQueue` (a list of `PushBatch` objects pushed there by [`updateThoughts`](../src/actions/updateThoughts.ts) and friends) and partitions it into:

- **`dbQueue`** — batches with `local || remote` set. Applied sequentially via `db.updateThoughts({ thoughtIndexUpdates, lexemeIndexUpdates, lexemeIndexUpdatesOld, schemaVersion })`. After each batch resolves, any `idbSynced` callback on the batch is invoked.
- **`dbQueue`** — batches with `local || remote` set. Applied sequentially through `thoughtspaceRuntime.persistPushQueueBatches`, which calls the active data provider's `updateThoughts`. After provider persistence finishes, any `idbSynced` callback on the original batch is invoked.
- **`freeQueue`** — state-only batches whose `null` thought/lexeme entries indicate they should be released from the in-memory cache. Triggers `db.freeThought` / `db.freeLexeme`.

The enhancer also caches a small set of critical settings (`CACHED_SETTINGS` in [`constants.ts`](../src/constants.ts)) into `localStorage` so that things like the Tutorial setting are available during the first paint before Yjs hydrates. The corresponding read path is [`selectors/getSetting.ts`](../src/selectors/getSetting.ts).
Expand All @@ -135,10 +135,10 @@ Once Redux dispatches a thought update, the data flow is therefore:

```
reducer → state.pushQueue → pushQueue enhancer
→ db.updateThoughts (thoughtspace.ts)
→ updateQueue (TaskQueue, concurrency 16)
→ Y.Doc.transact + IndexeddbPersistence
→ idbSynced callback resolves
→ thoughtspaceRuntime.persistPushQueueBatches
→ DataProvider.updateThoughts
→ active provider persistence
→ idbSynced callback is invoked
```

## Pull queue (Yjs → Redux)
Expand Down
2 changes: 1 addition & 1 deletion docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ The helpers in [`../src/test-helpers/`](../src/test-helpers) cover store setup a
- **Read-by-value helpers.** [`getAllChildrenByContext`](../src/test-helpers/getAllChildrenByContext.ts), [`getChildrenRankedByContext`](../src/test-helpers/getChildrenRankedByContext.ts), [`getAllChildrenAsThoughtsByContext`](../src/test-helpers/getAllChildrenAsThoughtsByContext.ts), [`attributeByContext`](../src/test-helpers/attributeByContext.ts), [`contextToThought`](../src/test-helpers/contextToThought.ts).
- [`expectPathToEqual`](../src/test-helpers/expectPathToEqual.ts) — Jest matcher that compares paths by their thought *values* rather than ids, so test failures are readable.
- [`checkDataIntegrity`](../src/test-helpers/checkDataIntegrity.ts) — assertions that catch parent/child mismatches, missing Lexemes, and orphaned thoughts. Useful as a final assertion in mutation-heavy tests.
- [`dataProviderTest`](../src/test-helpers/dataProviderTest.ts) — the alternate `DataProvider` implementation used by tests that exercise the storage layer without going through Yjs. (See [persistence.md](persistence.md) for the live YJS provider.)
- [`dataProviderTest`](../src/test-helpers/dataProviderTest.ts) — shared assertions for storage providers that implement the data provider interface.

### `src/e2e/puppeteer/helpers/` — for Puppeteer tests

Expand Down
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export default [
'**/docs/*',
'**/functions/*',
'**/scripts/*',
'public/wa-sqlite/**',
],
},
{
Expand Down
15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
"resolutions": {
"@pandacss/node@npm:0.47.0": "patch:@pandacss/node@npm%3A0.47.0#~/.yarn/patches/@pandacss-node-npm-0.47.0.patch",
"page-lifecycle": "https://codeload.github.com/magic-akari/page-lifecycle/tar.gz/50b50421bdeab3d211a57e81a277f699638373b0",
"y-indexeddb": "https://codeload.github.com/raineorshine/y-indexeddb/tar.gz/60b960009085b1a988b5064ee35703229231531f",
"use-latest": "^1.3.0",
"use-isomorphic-layout-effect": "^1.2.1"
},
Expand All @@ -105,6 +104,15 @@
"@redux-devtools/extension": "^4.0.0",
"@stylistic/eslint-plugin-ts": "^4.4.1",
"@tauri-apps/api": "^2.11.1",
"@treecrdt/auth": "0.1.2",
"@treecrdt/discovery": "0.1.0",
"@treecrdt/interface": "0.2.0",
"@treecrdt/riblt-wasm": "0.1.0",
"@treecrdt/sync": "0.1.2",
"@treecrdt/sync-protocol": "0.1.2",
"@treecrdt/sync-server-core": "0.1.2",
"@treecrdt/sync-sqlite": "0.1.2",
"@treecrdt/wa-sqlite": "0.4.0",
"axios": "^1.19.0",
"clipboard": "^2.0.11",
"dnd-core": "^16.0.1",
Expand Down Expand Up @@ -160,10 +168,7 @@
"workbox-strategies": "^7.4.1",
"workbox-window": "^7.4.1",
"xhtml-purifier": "^0.4.3",
"y-indexeddb": "⚠️ OVERRIDDEN BY 'resolutions' - Source: https://github.com/raineorshine/y-indexeddb#y-indexeddb-multiplex | Tarball: https://codeload.github.com/raineorshine/y-indexeddb/tar.gz/60b960009085b1a988b5064ee35703229231531f | Configured in: package.json#resolutions",
Comment thread
raineorshine marked this conversation as resolved.
"y-protocols": "^1.0.7",
"yallist": "^5.0.0",
"yjs": "^13.6.31"
"yallist": "^5.0.0"
},
"devDependencies": {
"@babel/core": "^8.0.1",
Expand Down
4 changes: 2 additions & 2 deletions scripts/add-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const fs = require('fs')
const path = require('path')
const murmurHash3 = require('murmurhash3js')

const EM_TOKEN = '__EM__'
const HOME_TOKEN = '__ROOT__'
const EM_TOKEN = '00000000000000000000000000000002'
const HOME_TOKEN = '00000000000000000000000000000000'
const SEPARATOR_TOKEN = '__SEP__'
const appendContext = (context, child) => unroot([...context, child])
const escapeRegEx = s => s.replace(/[-[\]{}()*+?.\\^$|#\s]/g, '\\$&')
Expand Down
2 changes: 1 addition & 1 deletion scripts/deleteContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (!file || context.length === 0) {
const thoughtIndices = JSON.parse(fs.readFileSync(file, 'utf8'))
const { thoughtIndex, lexemeIndex } = thoughtIndices

const thought = contextToThought(thoughtIndices, thoughtIndex.__ROOT__, context)
const thought = contextToThought(thoughtIndices, thoughtIndex['00000000000000000000000000000000'], context)
if (!thought) {
console.error(`${context} not found`)
process.exit(1)
Expand Down
2 changes: 1 addition & 1 deletion scripts/deleteRootLeaves.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if (!file) {
const thoughtIndices = JSON.parse(fs.readFileSync(file, 'utf8'))
const { thoughtIndex, lexemeIndex } = thoughtIndices

const rootChildren = getChildrenByContext(thoughtIndex, thoughtIndex.__ROOT__, context)
const rootChildren = getChildrenByContext(thoughtIndex, thoughtIndex['00000000000000000000000000000000'], context)

// delete all leaves in the root
rootChildren.forEach(rootChild => {
Expand Down
2 changes: 1 addition & 1 deletion scripts/getChildren.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if (!file) {

const { thoughtIndex, lexemeIndex } = JSON.parse(fs.readFileSync(file, 'utf8'))

const children = getChildrenByContext({ thoughtIndex }, thoughtIndex.__ROOT__, context)
const children = getChildrenByContext({ thoughtIndex }, thoughtIndex['00000000000000000000000000000000'], context)
const values = children.map(child => `${child.id} ${child.value} (${Object.keys(child.childrenMap).length})`)
if (context.length > 0) {
console.log(context.join('/'))
Expand Down
4 changes: 2 additions & 2 deletions scripts/repair.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let repair = (maxDepth = 100) => {
let inconsistentRanks = 0
let duplicateThoughtContextIds = 0

const HOME_TOKEN = '__ROOT__'
const HOME_TOKEN = '00000000000000000000000000000000'

/** Generate a timestamp of now. */
const timestamp = () => new Date().toISOString()
Expand Down Expand Up @@ -200,7 +200,7 @@ let repair = (maxDepth = 100) => {
}

// start recursion
generateUpdates(['__ROOT__'])
generateUpdates(['00000000000000000000000000000000'])

console.info('')
console.info(`Duplicate child ranks: ${duplicateRanks}`)
Expand Down
4 changes: 2 additions & 2 deletions scripts/schema8-to-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ if (!path) {

const input = fs.readFileSync(path, 'utf-8')
const state = JSON.parse(input)
const root = state.thoughtIndex.__ROOT__
const root = state.thoughtIndex['00000000000000000000000000000000']

const traverse = (thought, { indent = 0 } = {}) => {
const isRoot = thought.id === '__ROOT__'
const isRoot = thought.id === '00000000000000000000000000000000'
if (!isRoot) {
console.info(`${repeat(' ', indent)}- ${thought.value}`)
}
Expand Down
25 changes: 13 additions & 12 deletions scripts/src/repair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ import normalizeThought from '../lib/normalizeThought.js'
import migrate from './migrate.js'
import Database from './types/Database.js'

const ROOT_PARENT_ID = '__ROOT_PARENT_ID__' as ThoughtId
const ABSOLUTE_TOKEN = '__ABSOLUTE__' as ThoughtId
const EM_TOKEN = '__EM__' as ThoughtId
const HOME_TOKEN = '__ROOT__' as ThoughtId
const ROOT_PARENT_ID = '00000000000000000000000000000001' as ThoughtId
const ABSOLUTE_TOKEN = '00000000000000000000000000000003' as ThoughtId
const EM_TOKEN = '00000000000000000000000000000002' as ThoughtId
const HOME_TOKEN = '00000000000000000000000000000000' as ThoughtId
const HOME_PATH = [HOME_TOKEN] as Path

let childrenInMultipleThoughts = 0
Expand Down Expand Up @@ -145,9 +145,10 @@ const moveThought = (thought: ThoughtDb, parentId: ThoughtId) => {

const moveThoughtToOrphanage = (thought: ThoughtDb) => {
// create orphanage if it doesn't exist
if (!db.thoughtIndex.orphanage) {
db.thoughtIndex.orphanage = {
id: 'orphanage' as ThoughtId,
const ORPHANAGE_ID = '00000000000000000000000000aaaa00' as ThoughtId
if (!db.thoughtIndex[ORPHANAGE_ID]) {
db.thoughtIndex[ORPHANAGE_ID] = {
id: ORPHANAGE_ID,
value: 'ORPHANAGE',
rank: Math.random(),
children: {},
Expand All @@ -157,23 +158,23 @@ const moveThoughtToOrphanage = (thought: ThoughtDb) => {
}

// add orphanage to root children
db.thoughtIndex.__ROOT__.children!.orphanage = {
..._.omit(db.thoughtIndex.orphanage, 'children'),
db.thoughtIndex[HOME_TOKEN].children![ORPHANAGE_ID] = {
..._.omit(db.thoughtIndex[ORPHANAGE_ID], 'children'),
childrenMap: {},
}

// add orphanage Lexeme
const lexemeKey = hashThought('ORPHANAGE')
db.lexemeIndex[lexemeKey] = {
id: 'orphanage',
contexts: { ['orphanage' as ThoughtId]: true },
id: ORPHANAGE_ID,
contexts: { [ORPHANAGE_ID]: true },
lemma: 'orphanage',
created: timestamp(),
lastUpdated: timestamp(),
}
}

moveThought(thought, 'orphanage' as ThoughtId)
moveThought(thought, ORPHANAGE_ID)
}

console.info('Reading db')
Expand Down
Loading
Loading