Commit Graph

415 Commits

Author SHA1 Message Date
Tienson Qin
7aa3bd7d84 fix: issues of :default :one property 2024-05-03 09:59:20 +08:00
Tienson Qin
457a74343f refactor: no need to create parent && hidden page for :default value 2024-05-03 00:02:55 +08:00
Gabriel Horner
88e38b16f4 fix: more lints including removing dead code 2024-05-02 10:35:44 -04:00
Tienson Qin
89edb3af9a fix: can't remove Many values 2024-05-02 18:03:17 +08:00
Tienson Qin
1ec4796eff refactor: replace :block/left with :block/order
Finally no need to worry about parent-left conflicts and broken chain.
With :block/order, we only need to re-compute new orders for siblings
with same order (it can happens if there're bugs in our code, or
updates from rtc), but it doesn't break UI.

Another huge potential benefit after discussing with Zhiyuan is:
Ee might be able to simplify both RTC and undo/redo, currently, we
need to handle each new op for both of them, with recently
refactorings like properties being db attributes, :block/order
is a string instead of a ref, we can handle most property value
conflicts using last-write-wins, and others (e.g. :block/parent,
property with :default type) specifically.

I haven't fixed the issues of using :block/left in RTC and undo/redo,
because we might change both soon.
2024-05-02 01:12:22 +08:00
Gabriel Horner
a35bc9b0d6 Bump nbb-logseq version for datascript and ordered-map changes 2024-04-30 10:10:11 -04:00
Tienson Qin
95eb0e7f4a Merge branch 'feat/db' into refactor/db-properties-schema 2024-04-29 15:55:23 +08:00
Tienson Qin
5d4ae66d86 revert: remove :block/properties 2024-04-28 19:44:53 +08:00
Gabriel Horner
edca3049c0 chore: remove unused fn 2024-04-25 11:24:08 -04:00
Gabriel Horner
3681ac354b fix: move db-pipeline and datascript-report back to outliner dep
graph-parser is primarily a file graph dep that is maintained separately
from db graphs. We want to move as many namespaces out of it as
possible. Also moved differing count assertions to
their respective tests
2024-04-25 11:22:14 -04:00
Tienson Qin
b84ea96160 fix: handle more non-consecutive cases 2024-04-25 20:39:15 +08:00
Tienson Qin
331aa50379 fix: delete blocks might be consecutive but reversed 2024-04-25 20:28:06 +08:00
Tienson Qin
b55c064305 fix: move :block/path-res calculation to dep graph-parser 2024-04-25 16:50:04 +08:00
Tienson Qin
fef4e896e1 fix: use existing property pair if exists 2024-04-24 19:13:48 +08:00
Tienson Qin
912ddd6ca2 Merge branch 'feat/db' into refactor/db-properties-schema 2024-04-22 23:57:57 +08:00
Gabriel Horner
543677ef32 fix: outliner lint 2024-04-22 11:14:14 -04:00
Gabriel Horner
0bee9b12c0 fix: frontend lints and remove dead code 2024-04-22 11:10:16 -04:00
Gabriel Horner
1b66755876 fix: outliner lint 2024-04-22 10:50:37 -04:00
Tienson Qin
44af2213ce Merge branch 'feat/db' into refactor/db-properties-schema 2024-04-21 13:22:37 +08:00
Tienson Qin
b1bc1ca88a chore: remove debug 2024-04-19 20:17:53 +08:00
Tienson Qin
20006eafa8 fix: update :block/page when moving between pages 2024-04-19 20:16:39 +08:00
Tienson Qin
113ff4e669 fix: can't move blocks to empty page 2024-04-19 19:54:11 +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
08c5cc18d0 refactor: simplify outliner move blocks
The new implementation doesn't rely on insert-blocks, instead, it
will move the blocks one by one, but using batch tx.
2024-04-19 16:11:42 +08:00
Gabriel Horner
0372cb6e62 fix: typing marker creates tasks e.g. DOING 2024-04-18 14:13:58 -04:00
Gabriel Horner
9bab096def fix: built-in string properties with internal :string type
Also fix a bug that caused numbered list to fail after first item
2024-04-18 09:06:10 -04:00
Tienson Qin
f0920ac89b fix: another case of non-consecutive blocks move 2024-04-18 20:42:26 +08:00
Tienson Qin
40775e1f80 fix: move a child block to its parent's right sibling 2024-04-18 19:04:44 +08:00
Tienson Qin
2296eca383 chore: don't run fix non-consecutive when it's not needed 2024-04-18 18:43:16 +08:00
Tienson Qin
24e1aab914 fix: skip computing :block/left for non-consecutive blocks 2024-04-18 15:24:47 +08:00
Tienson Qin
ca197c439a prn db transit if left/parent point to self detected 2024-04-18 14:24:53 +08:00
Tienson Qin
76248b4664 Add trace for debugging 2024-04-18 13:56:33 +08:00
Tienson Qin
9418607c50 Ensure :block/left and :block/parent not point to self 2024-04-18 13:52:05 +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
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
Gabriel Horner
0aa4bda66c fix: inlined db-based-graph? calls in db-property
Addressed fixmes for db-based-graph fns that were inlined to prevent
circular dependencies b/n db-property and sqlite-util.  Moved multi
graph fns to db-property-util and existing db-property-util to
db-property-build to address this
2024-04-16 14:43:28 -04:00
rcmerci
842efe5958 test(undo): add random outliner-ops testcase 2024-04-16 18:58:40 +08:00
rcmerci
cf4e43e126 fix: remove wrong cond when delete-blocks 2024-04-16 18:58:40 +08:00
Gabriel Horner
8ac39b3cbb fix: adding new properties for some property actions
Also removed duplicate helper fn
2024-04-12 21:53:04 -04:00
Tienson Qin
1a9608bda1 fix: property handler with the new properties pair storage 2024-04-12 01:17:37 +08:00
Tienson Qin
210be5aaca fix: creating redundant pages when editing a block 2024-04-08 01:25:48 +08:00
Tienson Qin
b9195e40e5 Merge branch 'refactor/db-properties-schema' into refactor/db-remove-block-name-unique 2024-04-06 07:59:06 +08:00
Gabriel Horner
514b5b5d56 fix: numbered list in db graphs 2024-04-05 15:00:17 -04:00
Tienson Qin
0bc8d1c3b1 Merge branch 'refactor/db-properties-schema' into refactor/db-remove-block-name-unique 2024-04-05 15:16:13 +08:00
Tienson Qin
ac31842cec Revert "Remove :block/macros"
This reverts commit 21d550de12.
2024-04-05 15:12:56 +08:00
Tienson Qin
bf539751a8 disable rtc merge tests for now 2024-04-04 15:57:49 +08:00
Tienson Qin
c018f1517d perfer to use get-page instead of get-first-page-by-name 2024-04-04 15:57:48 +08:00
Tienson Qin
60d4fca0ba wip: remove :block/name uniqueness for db based graphs
This PR also remove supports for:
1. merge pages when renaming a page to existing page
2. namespaces such as a/b/c
3. nested page such as [[a [[nested page]]]]

Pages merge might be added back depends on RTC, but it should be
decoupled from renaming, otherwise it's too complex.

Namespaces and nested pages have been contributed some critical bugs
that lead data-loss, they're so complex together with page alias,
it's just impossible to have a good test coverage and ensure the app
is stable, especially when page rename and RTC.
2024-04-04 15:57:48 +08:00
Tienson Qin
7084b53dad Merge branch 'feat/db' into refactor/db-properties-schema 2024-04-03 20:29:11 +08:00
rcmerci
a7c8451ce4 refactor(undo): update ns frontend.worker.undo-redo (wip) 2024-04-03 17:59:13 +08:00