Commit Graph

42 Commits

Author SHA1 Message Date
Gabriel Horner
7a40761eca refactor: organize worker namespaces and lint them
Organize them to live under src/main/frontend/worker and add a lint to ensure
that common code with frontend is only under frontend/common/.
Add a linter to ensure that worker doesn't depend on frontend.
Motivated to fix after recent worker breakage fixed by
75463c4df4
2024-08-08 23:01:57 -04:00
Tienson Qin
d847023dc1 Refactor: rename :block/content to :block/title 2024-07-10 22:33:44 +08:00
Gabriel Horner
b35f30e203 fix: circular dependency between outliner and frontend
by moving batch-tx into outliner dep. Outliner dep is
now fully independent and we are able to write unit tests
for all outliner namespaces unlike before
2024-06-19 17:21:22 -04:00
Tienson Qin
d31b8cd5ae fix: add property named blocks values to :block/refs
related to LOG-2819
2024-05-21 16:35:39 +08:00
Tienson Qin
d142cf227e refactor: new undo/redo implementation
Previous undo/redo requires to handle every editor operation including
any new ops. The new implemenation focus on db attributes instead of
ops, it assumes that most attributes can be safely overwritten except
:block/parent, block/order and other ref-type attributes. It works likes:
1. If a block has been moved by another client (:block/parent or
:block/order has been changed), the whole tx will be skipped
2. If a refed entity has been deleted, the datom will be skipped
2024-05-14 18:10:48 +08:00
Tienson Qin
2088c80a93 fix: container-id could be unknown 2024-04-27 10:14:10 +08:00
Tienson Qin
8c20e3b54f fix: undo/redo editor cursor 2024-04-27 09:56:49 +08:00
Tienson Qin
81c267ed58 wip: undo redo editor cursor 2024-04-26 14:44:38 +08:00
rcmerci
bffd1b5c8e refactor: batch-tx 2024-04-19 17:48:48 +08:00
Tienson Qin
0085accf70 refactor: batch tx
outliner-tx/transact! now operates outliner op one by one instead of
batching processing, the benefit is that we can safely rely on the ops
order, it simplifies code a lot too.
2024-04-19 16:11:42 +08:00
Tienson Qin
08f4fc2a63 fix: unit tests 2024-04-18 19:38:45 +08:00
rcmerci
47bd0bf706 test(undo): node-test check block-pos 2024-04-18 18:31:00 +08:00
rcmerci
6739518a44 test(undo): testcases to debug 2024-04-18 16:32:20 +08:00
rcmerci
db0d7d0c1c chore: remove debug try 2024-04-18 14:31:17 +08:00
Tienson Qin
2a7e6accb0 refactor: force outliner.tree/-del to delete all children
Except the children have been moved.
2024-04-17 17:48:59 +08:00
rcmerci
3283a2eb73 refactor(undo): simplified fn other-children-exist? 2024-04-17 16:41:18 +08:00
rcmerci
5e34ab04fb fix(undo): check no other children exist when delete-blocks 2024-04-17 16:33:46 +08:00
Tienson Qin
1240052117 fix: undo redo
outliner.core/delete-blocks will filter top-level blocks first to
avoid deleting parent first and then children.
2024-04-17 14:54:31 +08:00
rcmerci
39c31f0f0b fix typo 2024-04-17 14:30:37 +08:00
rcmerci
cee5a3bf0f feat(undo): support undo :block/link 2024-04-17 12:47:50 +08:00
rcmerci
187c743224 test(undo): comment out testcases for now 2024-04-16 18:58:40 +08:00
rcmerci
842efe5958 test(undo): add random outliner-ops testcase 2024-04-16 18:58:40 +08:00
rcmerci
836cedfd7f fix(undo): sort&merge undo-ops
because maybe some ops depend-on others, e.g. insert parent first then
its children.
2024-04-13 19:53:38 +08:00
rcmerci
e76a672918 enhance(undo): support :block/collapsed? 2024-04-12 11:33:16 +08:00
rcmerci
98e37d4576 enhance(undo): support :block/tags 2024-04-11 21:47:32 +08:00
rcmerci
9eb6fb321e chore: update debug code in comment 2024-04-11 21:47:32 +08:00
rcmerci
53970880d3 enhance(undo): undo/redo is page-scoped now 2024-04-11 14:24:28 +08:00
rcmerci
b5c3757139 test(undo): update generative testcases 2024-04-10 14:06:09 +08:00
rcmerci
1dbc19069b test(undo): add tests and fix 2024-04-09 20:15:23 +08:00
rcmerci
30e76a4493 chore: fix typo 2024-04-09 12:32:00 +08:00
rcmerci
2772592720 enhance(undo): batch process undo/redo-ops 2024-04-09 12:27:33 +08:00
rcmerci
00de4ecead enhance(undo): add :gen-undo-boundary-op? tx-meta option to control
the generation of ::boundary op
2024-04-07 18:06:11 +08:00
rcmerci
662ebd2503 enhance(undo): add keyword def for :gen-undo-op? 2024-04-07 17:59:12 +08:00
rcmerci
ebcb6912ba enhance(undo): split undo-ops by ::boundary op 2024-04-07 17:53:19 +08:00
rcmerci
ef834cdaf7 feat: add defkeyword to define keyword
- add docstring for common used keywords
- support jump to definition in editors
- register malli-schema for keywords if provided
2024-04-07 15:40:30 +08:00
rcmerci
e61d6a8eaf feat(undo): init new undo/redo 2024-04-06 17:33:58 +08:00
rcmerci
49e18825b8 fix(undo): make some attrs optional in undo-op schema 2024-04-06 15:43:00 +08:00
rcmerci
a7c8451ce4 refactor(undo): update ns frontend.worker.undo-redo (wip) 2024-04-03 17:59:13 +08:00
rcmerci
6339d76db0 refactor: use defmethod to collect all db-listen-handlers 2024-04-03 12:04:19 +08:00
rcmerci
bbe15990a3 refactor(undo): generate undo-op from db tx-data 2024-04-02 18:38:15 +08:00
rcmerci
75b31a1f33 chore: add missing arg for d/pull 2024-03-31 21:09:35 +08:00
rcmerci
4e0568a2d6 wip: add ns frontend.worker.undo-redo
re-implement undo/redo, which is op-based and should work with rtc.
2024-03-31 21:08:18 +08:00