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

Feature/undo - observers and metadata #109

Open
wants to merge 143 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
5eae4ba
draft first pass of undo
cortfritz Nov 15, 2024
853d98e
hack mix to get project to compile with rust
cortfritz Nov 15, 2024
b04d3d3
hack nif to try to get tests to pass
cortfritz Nov 15, 2024
e135ee8
save WiP of undo manager
cortfritz Nov 15, 2024
434ec42
revert mix to original repo
cortfritz Nov 15, 2024
466761b
get undo code to compile
cortfritz Nov 15, 2024
d6220bd
undo manager compiling checkpoint
cortfritz Nov 16, 2024
a1af26b
prove passable tests with incremental strategy
cortfritz Nov 17, 2024
1ab660a
add undo
cortfritz Nov 17, 2024
36fe98f
save WiP of undo with origin
cortfritz Nov 17, 2024
63a2945
Merge branch 'main' into feature/undo
cortfritz Nov 23, 2024
ae42548
fix NIF param context
cortfritz Nov 24, 2024
edd3498
test undo
cortfritz Nov 24, 2024
a84f436
use yrs undo correctly
cortfritz Nov 24, 2024
7af3f28
extend capability beyond Yex.Text to Yex.Map and Yex.Array
cortfritz Nov 24, 2024
395ce60
make undo threadsafe
cortfritz Nov 24, 2024
d021184
add origin awareness tests to map and array
cortfritz Nov 24, 2024
61fe823
resolved, apparently, thread safety by changing test setup
cortfritz Nov 24, 2024
80eed14
ensure thread safety
cortfritz Nov 24, 2024
31202a1
refactor to use shared implementation for new
cortfritz Nov 24, 2024
119d655
unify NIF interface
cortfritz Nov 24, 2024
261d995
implement stop_capture, expand_scope, and exclude_origin
cortfritz Nov 24, 2024
73480e1
clean up obviated parallel "new" functions
cortfritz Nov 24, 2024
8b3369c
add observers and ability to add/get metadata from stack items
cortfritz Nov 25, 2024
d313597
manage undo observer state in GenServer
cortfritz Nov 25, 2024
2e15c54
remove debug
cortfritz Nov 25, 2024
3d727e2
add clear
cortfritz Nov 25, 2024
8ba3e29
add undo manager with options
cortfritz Nov 25, 2024
18edbd9
add options timeout test
cortfritz Nov 25, 2024
c49e4dd
mirror yjs examples for clarity for satoren
cortfritz Nov 25, 2024
2acb723
Update lib/server/undo_server_observer_behaviour.ex
cortfritz Nov 28, 2024
c739dd7
move server tests to correct test folder
cortfritz Nov 28, 2024
87ca959
refactor undo_server as simplified observer_server
cortfritz Nov 28, 2024
b365599
remove bad undo observer scheme
cortfritz Dec 1, 2024
48c7578
Merge branch 'satoren:main' into feature/undo
cortfritz Dec 1, 2024
3722de3
draft first pass of undo
cortfritz Nov 15, 2024
1235769
hack mix to get project to compile with rust
cortfritz Nov 15, 2024
462e129
hack nif to try to get tests to pass
cortfritz Nov 15, 2024
6dc69bc
save WiP of undo manager
cortfritz Nov 15, 2024
d730d9e
revert mix to original repo
cortfritz Nov 15, 2024
f73ae4b
get undo code to compile
cortfritz Nov 15, 2024
63cccae
undo manager compiling checkpoint
cortfritz Nov 16, 2024
e48c079
prove passable tests with incremental strategy
cortfritz Nov 17, 2024
6585952
add undo
cortfritz Nov 17, 2024
4f7f539
save WiP of undo with origin
cortfritz Nov 17, 2024
10a19b4
fix NIF param context
cortfritz Nov 24, 2024
d94f611
test undo
cortfritz Nov 24, 2024
6e3913d
use yrs undo correctly
cortfritz Nov 24, 2024
19465f9
extend capability beyond Yex.Text to Yex.Map and Yex.Array
cortfritz Nov 24, 2024
57a949c
make undo threadsafe
cortfritz Nov 24, 2024
f06f66d
add origin awareness tests to map and array
cortfritz Nov 24, 2024
aabc347
resolved, apparently, thread safety by changing test setup
cortfritz Nov 24, 2024
01afbb5
ensure thread safety
cortfritz Nov 24, 2024
05e77ec
refactor to use shared implementation for new
cortfritz Nov 24, 2024
12efc8d
unify NIF interface
cortfritz Nov 24, 2024
b00cdf5
implement stop_capture, expand_scope, and exclude_origin
cortfritz Nov 24, 2024
010fae2
clean up obviated parallel "new" functions
cortfritz Nov 24, 2024
927a4f3
add observers and ability to add/get metadata from stack items
cortfritz Nov 25, 2024
54d8bfb
manage undo observer state in GenServer
cortfritz Nov 25, 2024
8d33d6f
remove debug
cortfritz Nov 25, 2024
0a10a24
add clear
cortfritz Nov 25, 2024
df484e3
add undo manager with options
cortfritz Nov 25, 2024
6767dc1
add options timeout test
cortfritz Nov 25, 2024
8dc00e5
mirror yjs examples for clarity for satoren
cortfritz Nov 25, 2024
499a790
Update lib/server/undo_server_observer_behaviour.ex
cortfritz Nov 28, 2024
6e0bb5e
move server tests to correct test folder
cortfritz Nov 28, 2024
4b2b41a
refactor undo_server as simplified observer_server
cortfritz Nov 28, 2024
af03627
remove bad undo observer scheme
cortfritz Dec 1, 2024
20055ca
Merge branch 'feature/undo' of github.com:cortfritz/y_ex into feature…
cortfritz Dec 1, 2024
df28bab
put undo in correct fmt position
cortfritz Dec 1, 2024
94134cf
remove unused atoms previously supporting undo observers
cortfritz Dec 1, 2024
d951998
fmt undo
cortfritz Dec 1, 2024
4c95445
format elixir code
cortfritz Dec 1, 2024
c9a05ed
format changes to nif
cortfritz Dec 1, 2024
0fa77de
adopt byzantine structure to try to help coveralls see we are indeed …
cortfritz Dec 1, 2024
2f5ee02
format undo test
cortfritz Dec 1, 2024
0fcaaf4
worsen code structure to put up with coveralls not seeing inside patt…
cortfritz Dec 1, 2024
121e674
Merge branch 'main' into feature/undo
cortfritz Dec 8, 2024
3cebab5
test embedded objects
cortfritz Dec 13, 2024
40dc836
Merge pull request #1 from cortfritz/main
cortfritz Dec 13, 2024
84237bf
Merge branch 'feature/undo' of github.com:cortfritz/y_ex into feature…
cortfritz Dec 13, 2024
88466bc
format
cortfritz Dec 13, 2024
f9a2100
remove pattern matching
cortfritz Dec 15, 2024
39388df
improve order
cortfritz Dec 15, 2024
36ab8b3
add xml tests
cortfritz Dec 15, 2024
94957e1
use NifUntaggedEnum
cortfritz Dec 15, 2024
fe0e5ff
fmt properly
cortfritz Dec 15, 2024
db3dcb8
Merge branch 'main' into feature/undo
cortfritz Dec 16, 2024
f8aef9b
suffice coderabbit refactor suggestion
cortfritz Dec 16, 2024
2d35f9d
suffice coderabbit potential issue
cortfritz Dec 16, 2024
f60d4a8
suffice coderabbit unsafe transmute usage issue
cortfritz Dec 16, 2024
746136a
remove unused functions
cortfritz Dec 16, 2024
85a9641
make purpose more clear
cortfritz Dec 16, 2024
aa03457
make purpose more clear
cortfritz Dec 16, 2024
d38e153
remove test replaced by guards
cortfritz Dec 16, 2024
4d0d3d0
fix nits
cortfritz Dec 16, 2024
e8d6f85
fmt
cortfritz Dec 18, 2024
e1c89e6
improve coverage
cortfritz Dec 18, 2024
cdf27aa
simplify
cortfritz Dec 18, 2024
72fdb4b
satisfy coveralls demand for coverage
cortfritz Dec 18, 2024
eb88c00
improve comments
cortfritz Dec 18, 2024
991e9ad
replace try with case pattern match for better style
cortfritz Dec 18, 2024
4dec395
remove unsued crate
cortfritz Dec 18, 2024
5870107
remove unsued atoms
cortfritz Dec 18, 2024
5c01d7f
clarify comments in tests
cortfritz Dec 18, 2024
845641f
clarify tests
cortfritz Dec 18, 2024
53141c6
clarify purpose of origins in test
cortfritz Dec 18, 2024
2c7208c
manage metadata in undo events
cortfritz Dec 20, 2024
3c69b6f
save manual frankenstate
cortfritz Dec 20, 2024
223654d
pass all tests
cortfritz Dec 23, 2024
bd24458
pass all tests post merge
cortfritz Dec 23, 2024
5e5dd7e
document why metadata GenServer
cortfritz Dec 23, 2024
79ab593
explain usage
cortfritz Dec 23, 2024
03de5cc
improve tests
cortfritz Dec 23, 2024
1a7a91b
add tests
cortfritz Dec 23, 2024
e5a9f16
Merge branch 'main' into feature/undo
cortfritz Dec 23, 2024
0aedd84
Merge branch 'feature/undo_observer' into feature/undo
cortfritz Dec 23, 2024
c58b3f9
fmt
cortfritz Dec 23, 2024
357a652
fix reference previously thought to be local
cortfritz Dec 24, 2024
4a61d38
match return value to fix stealthy bug
cortfritz Dec 24, 2024
9e89f82
add missing functions revealed by ensuring coverage, thanks coveralls
cortfritz Dec 24, 2024
7dfb372
reorder for better readability
cortfritz Dec 24, 2024
e2600bf
reach 100% coverage for undo modules
cortfritz Dec 24, 2024
da9f649
improve error handling and make function call return more explicit
cortfritz Dec 24, 2024
21d6262
simplify return value
cortfritz Dec 24, 2024
fc92b3b
improve return val and log error
cortfritz Dec 24, 2024
7a48910
add can_redo? function for more complete yrs implementation
cortfritz Dec 24, 2024
b283183
simplify comments explaining design decision for metadata
cortfritz Dec 24, 2024
9740b2b
fully cover can_undo and can_redo
cortfritz Dec 24, 2024
a127bbf
remove test for failed feature
cortfritz Dec 24, 2024
981313d
repair coverage regression
cortfritz Dec 24, 2024
5a98f1a
remove old State def
cortfritz Dec 24, 2024
1b963e6
describe State module
cortfritz Dec 24, 2024
6fa344f
panic less
cortfritz Dec 24, 2024
f45aa9b
fmt
cortfritz Dec 24, 2024
a260edd
improve coversage
cortfritz Dec 24, 2024
bd35f78
suppress incorrect dialyzer
cortfritz Dec 24, 2024
d56b455
CodeRabbit improve test - use on_exit in test for reliable cleanup
cortfritz Dec 24, 2024
03545fe
CodeRabbit - improve test with more conservative sleeps
cortfritz Dec 24, 2024
1ef0082
satisfy CodeRabbit
cortfritz Dec 25, 2024
86649ca
Merge branch 'feature/undo' of github.com:cortfritz/y_ex into feature…
cortfritz Dec 25, 2024
1b541ff
merge CodeRabbit-authored tests
cortfritz Dec 25, 2024
eddd744
remove accidentally added bench test dir
cortfritz Dec 25, 2024
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
16 changes: 15 additions & 1 deletion lib/nif.ex
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,26 @@ defmodule Yex.Nif do
do: :erlang.nif_error(:nif_not_loaded)

def undo_manager_include_origin(_undo_manager, _origin), do: :erlang.nif_error(:nif_not_loaded)
def undo_manager_exclude_origin(_undo_manager, _origin), do: :erlang.nif_error(:nif_not_loaded)
def undo_manager_can_undo(_manager), do: :erlang.nif_error(:nif_not_loaded)
def undo_manager_can_redo(_manager), do: :erlang.nif_error(:nif_not_loaded)
def undo_manager_undo(_undo_manager), do: :erlang.nif_error(:nif_not_loaded)
def undo_manager_redo(_undo_manager), do: :erlang.nif_error(:nif_not_loaded)
def undo_manager_expand_scope(_undo_manager, _scope), do: :erlang.nif_error(:nif_not_loaded)
def undo_manager_exclude_origin(_undo_manager, _origin), do: :erlang.nif_error(:nif_not_loaded)
def undo_manager_stop_capturing(_undo_manager), do: :erlang.nif_error(:nif_not_loaded)
def undo_manager_clear(_undo_manager), do: :erlang.nif_error(:nif_not_loaded)

def undo_manager_observe_item_added(_manager, _observer), do: :erlang.nif_error(:nif_not_loaded)

def undo_manager_observe_item_updated(_manager, _observer),
do: :erlang.nif_error(:nif_not_loaded)

def undo_manager_observe_item_popped(_manager, _observer),
do: :erlang.nif_error(:nif_not_loaded)

def undo_manager_unobserve_item_added(_manager), do: :erlang.nif_error(:nif_not_loaded)
def undo_manager_unobserve_item_updated(_manager), do: :erlang.nif_error(:nif_not_loaded)
def undo_manager_unobserve_item_popped(_manager), do: :erlang.nif_error(:nif_not_loaded)
end

defmodule Yex.Nif.Util do
Expand Down
Loading
Loading