Commit Graph

1745 Commits (7a96fc0e32d14abc318b7841eea0cd4c065bee9b)

Author SHA1 Message Date
Gabriel Horner bd5f43d233 fix: db import of basic block properties
Some FIXMEs will be fixed soon. Part of LOG-3176
2024-06-28 17:56:27 -04:00
Tienson Qin 6c653094dd wip: class objects table 2024-06-29 00:50:30 +08:00
Gabriel Horner 9160f5a347 Revert "fix: prefer to use db-based schema's cardinality && valueType"
This reverts commit dbd9ab6bbb.
This was only temporarily needed for rtc graphs which should longer have
this problem
2024-06-28 12:04:10 -04:00
Gabriel Horner 9ee09372aa fix: cleanup inconsistent and incorrect import error handling
Some notified errors didn't include error object. Import cli didn't fail
on failure and stack was reversed. Error notifications sometimes
included full error which makes errors unreadable in CLI and possibly
confusing for users. Also fixed missing classpath. Part of
LOG-3176
2024-06-28 11:16:22 -04:00
Gabriel Horner 92134dec71 fix: add import test for asset
part of LOG-3092
2024-06-28 09:14:43 -04:00
Gabriel Horner e24b386079 Bump nbb with latest datascript
Test fixes are reasonable as datascript catches more invalid uses of
query
2024-06-27 18:07:44 -04:00
Gabriel Horner e58f1221d2 fix: Insufficient bindings error after datascript upgrade
After upgrading our forked datascript from 1.5.3 to 1.7.1,
bindings in two of our rules behaved differently. The workaround
of adding an `and` where none was required before is sufficient.
Fixes LOG-3177
2024-06-27 16:15:08 -04:00
Gabriel Horner 6b0b9c5e18 fix: db/id enhancement failing non-tx validation contexts
Simplify addition of :db/id and add it without forcing adding :db/id
in all schema declarations
2024-06-27 14:50:54 -04:00
Gabriel Horner 53bb0b689d chore: add docs to explain property values more 2024-06-27 12:11:30 -04:00
Gabriel Horner ab118d3a27 fix: typos 2024-06-27 12:05:16 -04:00
Tienson Qin dbd9ab6bbb fix: prefer to use db-based schema's cardinality && valueType
Instead of those values stored in the property blocks.
2024-06-27 23:24:35 +08:00
Tienson Qin 16c7a52468 enhance: add :db/id to invalid entity map when validated failed 2024-06-27 22:40:54 +08:00
Tienson Qin ade53ebce1 fix: prefer passed page-uuid 2024-06-27 17:55:35 +08:00
Tienson Qin fec74edc0c Revert "fix: don't set :logseq.property/built-in? for properties"
This reverts commit e5bb634a08.
2024-06-27 16:27:41 +08:00
Tienson Qin 073427d898 enhance: add backlinks and type to all pages 2024-06-27 16:27:15 +08:00
Tienson Qin 324a6f91ca Merge branch 'experiment/tanstack-table' into feat/db 2024-06-27 15:49:24 +08:00
Tienson Qin d8c94b7a2f Revert "feat(shui): add shui table & expose tanStackReact APIs"
This reverts commit e2b6623ef5.
2024-06-27 15:48:45 +08:00
Tienson Qin e5bb634a08 fix: don't set :logseq.property/built-in? for properties
We still keep :logseq.property/built-in? for built-in classes, pages
and closed values.

Reasons why this change:
1. built-in? value is a entity (which type is `checkbox` and value is
`true`), this breaks the rule that db attributes shouldn't reference
non-db-attribute blocks, it also forces us to load the built-in? value
entity first when loading the db.
2. we already have a built-in properties map, we can use it to check
whether a property is built-in.
2024-06-27 15:10:33 +08:00
Gabriel Horner b70ba087b3 fix: new graph-parser test passes with clj runner
part of LOG-3092
2024-06-26 16:14:50 -04:00
Gabriel Horner e619874dc4 enhance: add acceptance test for file to db graph import
Part of LOG-3092
2024-06-26 15:59:09 -04:00
Gabriel Horner 51a2c1425f fix: db import for very basic file
Basic file couldn't import because :block/name is no longer unique for
db graphs. Part of LOG-3176
2024-06-26 15:59:09 -04:00
Gabriel Horner 5520bc1d33 fix: import single file from CLI didn't print error
Also improved CLI error reporting so sci stack is readable and
not filled with stack fn docstrings
2024-06-26 15:59:09 -04:00
Tienson Qin b6bdc4b1d5 chore: update datascript version 2024-06-27 00:35:37 +08:00
Tienson Qin 039804d87a chore: bump upstream datascript 2024-06-27 00:26:31 +08:00
Tienson Qin a21a61fde6 fix: sorting 2024-06-26 22:26:20 +08:00
Gabriel Horner 5e5a8ee1df fix: display property names not idents for query
table and settings
2024-06-26 09:34:33 -04:00
Tienson Qin cc56ba1227 add delete support for all pages 2024-06-26 20:27:33 +08:00
Tienson Qin 5c965e5235 fix: load all pages initially
There're still some issues when loading partial pages initially,
let's improve the performance during the test.
2024-06-26 17:46:52 +08:00
charlie 119b519e2a Merge branch 'feat/db' into experiment/tanstack-table 2024-06-26 11:33:18 +08:00
charlie d278067f8c enhance(ui): support hide close button option for the shui dialog 2024-06-26 10:01:54 +08:00
Gabriel Horner c772b0cdd1 fix: migrate built-in? property to use :checkbox
Can now delete temporary :boolean type
2024-06-25 15:02:25 -04:00
Tienson Qin 2cdfaa7fdf Remove debug 2024-06-25 22:42:53 +08:00
Tienson Qin 9b259a8291 fix: shui table demo 2024-06-25 22:42:23 +08:00
Tienson Qin da602e7490 wip: shui table 2024-06-25 19:10:58 +08:00
charlie 946499ad56 enhance(ui): support auto width for the shui dialog content 2024-06-25 18:06:13 +08:00
charlie e2ff6e1990 enhance(ui): refactor classic modals with the shui dialog 2024-06-25 15:37:11 +08:00
Tienson Qin da4f9b5498 chore: remove :block/collapsed-properties 2024-06-25 10:57:44 +08:00
Gabriel Horner 3c838bc243 fix: disallow changing property cardinality from :many to :one
for existing data as it leads to invalid data. Fixes LOG-3164
2024-06-24 14:10:23 -04:00
Gabriel Horner 4fce0cb5d5 fix: sqlite.build journals should use new journal uuid format 2024-06-24 13:40:15 -04:00
Gabriel Horner 67d546850c fix: recent bugs with create-user-class-ident-from-name
This fn keeps api's assumptions and bugs with property idents only in the api ns and
prevents them from affecting all other namespaces creating properties /cc @xyhp915. Users
should not be choosing the property namespace. Doing so allows users to
overwrite logseq's built in ones which can break basic features. It also
allows users to specify a non-property namespace, which means the
property would not work in the app
2024-06-24 11:56:50 -04:00
charlie 305b7ff570 fix(api): ignore qulified keyword when create user property name 2024-06-24 18:25:26 +08:00
charlie e2b6623ef5 feat(shui): add shui table & expose tanStackReact APIs 2024-06-24 16:59:58 +08:00
charlie edd8746b5e enhance(ui): refactor the classic modal with the shui dialog & enhancements for ux 2024-06-24 16:05:41 +08:00
Tienson Qin f17289c34a fix: prefer chosen UUID value than page name
The reason is that multiple pages can share the same name
2024-06-24 12:11:15 +08:00
Gabriel Horner 0ea8a414f2 chore: move and rewrite outliner.property tests
Moved tests to be next to implementation. Rewrote some tests
so that they matched common usage of fns and rewrote some tests
so that each fn is tested independently
2024-06-23 23:47:08 -04:00
Tienson Qin 1c22c78c94 chore: remove buggy and rough template
Also, :object kinda works like template, and we also plan to
support templates on Classes.
2024-06-23 22:22:33 +08:00
Tienson Qin eb245e5a76 fix: lint 2024-06-23 17:58:15 +08:00
Tienson Qin caf1af1911 enhance: bring back inline tags support 2024-06-23 17:50:51 +08:00
Tienson Qin 797b13ac78 fix: lint and test 2024-06-21 18:09:20 +08:00
charlie 1a9ad96ad9 chore(ui): update shui demo 2024-06-21 16:22:25 +08:00
Tienson Qin 30230b38ca fix: test 2024-06-21 14:04:42 +08:00
charlie 37cff08d4a fix(ui): incorrect behavior for the shui tooltip within popups trigger 2024-06-21 14:02:25 +08:00
Tienson Qin b0c03b0003 fix: tests 2024-06-21 12:50:29 +08:00
Tienson Qin 0b38900d70 fix: blocks->vec-tree 2024-06-21 11:31:52 +08:00
Gabriel Horner d4a323805d fix: deps lints 2024-06-20 09:14:59 -04:00
Tienson Qin 74a077668c fix: add missing malli schema for :file/size 2024-06-20 20:55:57 +08:00
Tienson Qin dec56b31f0 chore: remove unused :file/handle 2024-06-20 20:53:15 +08:00
rcmerci be41c8bae7 chore: add some comments 2024-06-20 17:01:58 +08:00
rcmerci dc785a92a7 refactor: make journal-day page's uuid like this
00000001-2024-0620-0000-000000000000
2024-06-20 17:01:58 +08:00
Tienson Qin 62a2564f4d fix: add missing file/created-at attribute for db graphs 2024-06-20 16:57:38 +08:00
Tienson Qin 519f3cab3f fix: don't focus for :many property 2024-06-20 16:45:21 +08:00
Gabriel Horner eae2156f6c chore: move and add create-property-text-block tests 2024-06-19 23:01:44 -04:00
Gabriel Horner c23513eaa8 fix: non :default property reuses existing entities
Also add tests for this and a common set-block-property case
2024-06-19 22:17:03 -04:00
Tienson Qin 626e0b67e8 fix: store latest file stat
Fixes LOG-3143
2024-06-20 09:22:35 +08:00
Tienson Qin adae8ef5eb fix: get-block-and-children returns sorted blocks
Fix unit tests
2024-06-20 07:56:30 +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
Gabriel Horner 7b787a8fb2 fix: db lint 2024-06-19 14:39:39 -04:00
Tienson Qin 71dc122a75 fix: copy block properties doesn't work
Fixes LOG-3160
2024-06-20 00:39:08 +08:00
Gabriel Horner 16248f0bd2 fix: unable to build :default property for sqlite.build
Also add tests for different built-in cases and addressed
related TODO
2024-06-18 16:29:01 -04:00
Gabriel Horner de730e236a fix: outliner lint 2024-06-18 11:03:55 -04:00
Gabriel Horner ee77145caf fix: :checkbox property not working in simple queries and rules
Also fix booleans not rendering in query table
2024-06-18 10:38:09 -04:00
Tienson Qin c3f30a9dc9 fix: lint 2024-06-18 21:37:12 +08:00
Tienson Qin 0bd6c05e69 refactor: add page outliner ops
The rule is to avoid calling worker modules from UI, all db
transactions should go through apply-outliner-ops.
2024-06-18 05:21:00 +08:00
charlie 5b0ed592f0 fix(ux): sometimes the block children can't be collapsed 2024-06-17 17:54:19 +08:00
charlie 5e8e3edc5d enhance(ui): refactor the classic modals with the shui dialog 2024-06-17 13:27:20 +08:00
Tienson Qin 96be194de5 Refactor: use last modified time to decide if file has been changed
Previously, we're using file content.

Fixes LOG-3161
2024-06-16 11:00:40 +08:00
Tienson Qin 54e54ebd63 fix: get-pid not works for non-built-in properties in file graphs 2024-06-15 23:20:13 +08:00
Tienson Qin b294896f8a fix: reuse page uuids when parsing files
This commit also removes `with-id?` because it's too confusing.

Fixes LOG-3143
2024-06-15 22:52:30 +08:00
Tienson Qin 4281274512 fix: graph parser tests 2024-06-15 21:08:25 +08:00
Gabriel Horner 244a86557f chore: rename :property/value to :property.value/content
property-value is widely being used to refer to the entity or value
associated with a property entity. Naming the content of a
property-entity :property/value is confusing. property-value content is
a unique name and consistent with :block/content. Also rename related
fns which had similarly confusing names
2024-06-14 18:11:20 -04:00
Gabriel Horner 04a6aa141e fix: remove unused dep from db 2024-06-14 16:56:27 -04:00
Gabriel Horner 9a8c91c0cc chore: mv logseq.db.sqlite.db into sqlite.cli
for more explicit name and purpose. Also updated outdated db readme
and removed unused fns in logseq.db.sqlite.db
2024-06-14 16:53:19 -04:00
Gabriel Horner 8ba5c15f93 fix: remove cli namespace dependency from electron namespaces
Added a :discouraged-namespace linter check for future times.
Had to add clj-kondo configs for db and outliner since they
were incorrectly inheriting the frontend config, specifically
the :discouraged-namespace linter. Also removed a 'm/=>' in outliner dep
b/c it would've created a complex clj-kondo setup for malli that
would need to be updated for both top-level clj-kondo and deps/outliner
2024-06-14 15:50:05 -04:00
Gabriel Horner 95db811f55 fix: frontend tests shouldn't depend on sqlite3
frontend.test.helper was accidentally coupled to sqlite3 via
logseq.outliner.db-pipeline. Split out sqlite3 dependent fns to
logseq.outliner.cli so it's clear this shouldn't be coupled to frontend
2024-06-14 14:41:24 -04:00
Gabriel Horner 0f122e9a7e fix: schema graph generation
Regressed with property value change. Also updated debug file and
fixed a missing built-in property ns which caused an invalid debug file
2024-06-14 11:38:14 -04:00
Tienson Qin d588df622e fix: :block/uuid not created for property value pages
Related to LOG-3124
2024-06-14 22:15:56 +08:00
Tienson Qin c7827ee268 fix: can't create alias property for file based graph 2024-06-14 21:00:32 +08:00
Tienson Qin 1858180476 fix: don't create bi-directional alias
related to LOG-3124
2024-06-14 20:00:37 +08:00
Gabriel Horner 5f2371486e fix: simple query for :number properties
also fixes deps db tests
2024-06-13 23:16:17 -04:00
Gabriel Horner 137f388edd enhance: property ref values can store their
original value optionally with :property/value.
Currently applies to :url and :number and not :default
as :default is meant to be a block and thus highly coupled
to :block/content. By introducing this, functionality that relies
on original property values automatically work e.g.
sorting by :number property for query results just works
2024-06-13 23:03:18 -04:00
Gabriel Horner 57241d0644 Revert "fix: :block/content should be string including :number properties"
This reverts commit 8a6b44bb31.
2024-06-13 21:25:21 -04:00
charlie 6c7c282a03 fix(pdf): insert keyword property value for the file based graphs 2024-06-13 17:25:05 +08:00
Tienson Qin 4d684a5ec9 fix: throw exception if calling db property fns for file graphs 2024-06-13 14:50:20 +08:00
Tienson Qin 0ce2ee42db Revert "refactor: use files instead of sqlite for electron db storage"
This reverts commit c2c5ab80aa.
2024-06-13 13:04:00 +08:00
Tienson Qin ec25550455 Revert "chore: remove unused fn"
This reverts commit 1ec30bbf1a.
2024-06-13 13:04:00 +08:00
Tienson Qin 596089f161 Revert "fix: add missing fs-extra package"
This reverts commit 032cad0318.
2024-06-13 13:04:00 +08:00
Tienson Qin 6d4f3425cd Revert "fix: nbb compatibility for mv to file db for electron"
This reverts commit 4403b5e52a.
2024-06-13 13:04:00 +08:00
Gabriel Horner 03f797fde3 fix: outliner lint and doc formatting 2024-06-12 15:24:04 -04:00
Tienson Qin 1dc72d79f2 fix: separate page/create impl for db and file graphs
Also, move rtc page create impl to its own fn.
2024-06-12 06:39:06 +08:00
Gabriel Horner 1b51d28682 fix: outliner lint 2024-06-11 16:49:14 -04:00
Gabriel Horner 4403b5e52a fix: nbb compatibility for mv to file db for electron
Followup to c2c5ab80aa
2024-06-11 16:44:19 -04:00
Gabriel Horner 0e1ada2ef6 enhance: bb task for creating graphs from EDN file
Converted inferred graph to an EDN file now that this task exists. Also
merge last of tasks.create-graph to relevant ns so that external users
can also create such tasks
2024-06-11 10:09:37 -04:00
Tienson Qin 2d3f152454 fix: simplify page delete and fix rtc issues 2024-06-11 20:23:57 +08:00
Tienson Qin 032cad0318 fix: add missing fs-extra package 2024-06-11 20:00:32 +08:00
Tienson Qin 1ec30bbf1a chore: remove unused fn 2024-06-11 19:58:54 +08:00
Tienson Qin c2c5ab80aa refactor: use files instead of sqlite for electron db storage 2024-06-11 08:30:49 +08:00
Gabriel Horner dbf263ed7c fix: unbound vars caught by lint
also updated property type for previous commit
2024-06-10 17:12:03 -04:00
Gabriel Horner 0ce4e1b65e fix: query table not displaying user property columns
Also fixed rendering property values for all property types
2024-06-10 16:05:33 -04:00
Gabriel Horner 2d1073fa5b fix: remove outdated clauses for property values
This became outedated with to property values as refs
2024-06-10 13:26:21 -04:00
Gabriel Horner 16cfb76c9b fix: update :query/result-transforms to work with db graphs
since they are the future. Leave example disabled by default as it's
not important to have :sort-by-priority enabled by default and working
for both file and db graphs
2024-06-10 12:38:40 -04:00
Gabriel Horner 04b25a9240 chore: add basic tests for sqlite.build
and added a couple db-graph specific for query-dsl. Also
moved fns in pu that should be in db-pu
2024-06-10 11:52:39 -04:00
Tienson Qin 03a0e99b65 enhance: add block-order malli schema 2024-06-09 11:39:00 +08:00
Tienson Qin 0a77ba077f fix: reuse :block/order if exists when inserting blocks from remote 2024-06-09 11:02:26 +08:00
Gabriel Horner 9636fbe7ab fix: remaining query dsl tests for db graphs
Re-enable CI step for testing query-dsl and db graphs
2024-06-07 18:02:32 -04:00
Gabriel Horner 7f3e22c8eb fix: priority filters for db graphs 2024-06-07 17:58:49 -04:00
Tienson Qin 214eefbf67 enhance: drop -page for filter properties 2024-06-08 05:33:41 +08:00
Tienson Qin b2e113d8eb refactor: db based filters
Uses properties :logseq.property.linked-references/included-pages
and :logseq.property.linked-references/excluded-pages to store filters
instead of a map.

Fixes LOG-3074
2024-06-08 05:28:55 +08:00
Gabriel Horner 039da828ac enhance: infer property schema and add new-pages from properties
for sqlite-build graphs. Also fixed numbered page query not working for
db graphs and related tests
2024-06-07 12:10:15 -04:00
Gabriel Horner 516192fa92 fix: db lint 2024-06-06 17:22:02 -04:00
Gabriel Horner 938dd04811 enhance: add :build/tags and :auto-create-ontology?
for tested+generated graphs. :build/tags allows easy generation of
objects as seen in fixed up inferred graph
2024-06-06 17:05:13 -04:00
Tienson Qin 9b1da32028 fix: simplify deleting refed blocks
The new implementation will replace refs of the current deleting block
with the nearby block (if exists).
2024-06-06 19:36:40 +08:00
Tienson Qin 9e5a002cf8 enhance: avoid replacing page refs if there's no special chars 2024-06-06 15:15:01 +08:00
Tienson Qin 8a6b44bb31 fix: :block/content should be string including :number properties 2024-06-06 14:53:26 +08:00
Tienson Qin fb01f99a4d fix: outliner tests 2024-06-06 07:11:09 +08:00
Gabriel Horner 62701e1b6e fix: tests with outdated datom counts
I think caused by recent macros parsing or whiteboard changes
2024-06-05 17:06:16 -04:00
Gabriel Horner 8f6f52d630 fix: sort-by filter for db graphs
Also fixed a dsl-query sorting bug where nil property values where
incorrectly being treated as greater than non-nil values. Also
fixed a bug where blocks with an explicit :block/created-at weren't
being set for sqlite-build
2024-06-05 16:57:51 -04:00
Gabriel Horner 29faedc4d0 fix: db graph tests with children, created-at properties
and journal pages
2024-06-05 14:47:38 -04:00
Gabriel Horner 916fef8336 enhance: generate any outline structure with :build/children
Already useful for testing and will be for more interesting generation
cases
2024-06-05 12:15:12 -04:00
Tienson Qin 592e2a9b26 fix: add tags when not exists 2024-06-05 22:39:55 +08:00
Tienson Qin 44366dced0 fix: removing a heading's hashtags doesn't delete
fixes LOG-3138
2024-06-05 20:01:46 +08:00
Tienson Qin a314e3469a fix: page can alias itself and then fail to load
fixes LOG-3136
2024-06-05 17:18:32 +08:00
Tienson Qin 7beebedbd2 fix: embed block macro is buggy
fixes LOG-3145
2024-06-05 14:27:13 +08:00
Tienson Qin ed97102b38 fix: can't move block up with a :default property
fixes LOG-3140
2024-06-05 14:08:57 +08:00
Gabriel Horner e7f795103d fix: simple task queries and start fixing db dsl-query tests
Tests caught that task query wasn't working. Also disabled
namaspace test and rule for db graphs since they aren't supported
there
2024-06-04 15:53:36 -04:00
Gabriel Horner 05227f475b chore: mv more tests to appropriate dep enabled by :build/journal 2024-06-04 12:02:25 -04:00
Gabriel Horner 14222a546f enhance: make journals easier to generate with :build/journal
Use it in tests that more appropriately belong in db dep.
Also did minor cleanup around page prep for page-uuids
2024-06-04 12:02:25 -04:00
Gabriel Horner 13066001cd fix: storing and querying of :number property values 2024-06-03 17:41:32 -04:00
Gabriel Horner 5ecb3fe3d4 fix: lints 2024-06-03 14:13:55 -04:00
Gabriel Horner df10beb325 enhance: add schema and validation to sqlite.build
Also renamed block-level keys that are specific to the ns to have
a :build namespace. A lot easier to read, maintain and extend later.
Also cleaned up page naming to consistently require :block/original-name
2024-06-03 12:46:53 -04:00
Gabriel Horner a67e2c8c23 chore: use easier way to build db graph test data
in rules tests
2024-06-03 12:46:53 -04:00
Gabriel Horner 2456deb097 enhance: create sqlite.build ns as a better
load-test-files helper for db graphs and deps.
Most of this ns is split off from create-graph.
Migrated pipeline-test to correct outliner dep and
moved previous pipeline-test to correct db dep
2024-06-03 12:46:53 -04:00
Tienson Qin 721a9e14ad fix: arrow color 2024-06-03 19:20:50 +08:00
Tienson Qin e7de721dde fix: broken block ref after deleting source blocks 2024-06-03 15:33:49 +08:00
Tienson Qin bce5a308bb perf: skip db storage when batch applying outliner ops 2024-06-03 14:53:06 +08:00
rcmerci 8a94b856bd enhance(rtc): add debug prn when failed to transact 2024-06-02 21:19:59 +08:00
Gabriel Horner 03167ae19c enhance: extract block content refs for generated graphs
Also update content with ids and create pages as needed
2024-05-31 17:19:25 -04:00
Gabriel Horner ec7839fcce fix: simple queries in db graphs for most property types
Also fix parse-query was being called in multiple places
without a correct default value for :db-graph? option
2024-05-30 15:54:20 -04:00
Gabriel Horner 790d0460a1 fix: remove + disable :block/macros for db graphs
part of LOG-3137
2024-05-30 11:01:37 -04:00
Tienson Qin da3929376a fix: don't extract macros from block content for db graphs 2024-05-30 21:32:45 +08:00
Tienson Qin 9ce7f5d709 fix: eager loading nested blocks for short pages 2024-05-30 20:01:31 +08:00
Tienson Qin 13b19a1b9c perf: render less blocks and improve app start time
1. load only 1 journal when app starts
2. fix can't load more journals
3. pretend all the unloaded pages as long pages to avoid more
rendering
4. don't send <get-block queries if there're already requests
2024-05-30 18:31:19 +08:00
Gabriel Horner 1dd9823fdf fix: remove alias ref to avoid recursive display bug
A page with aliases resulted in linked references recursively showing the
current page
2024-05-29 13:25:32 -04:00
Gabriel Horner a4d8e05e2f fix: esc saves a tag class with a :db/ident
Also refactor to update class tests to use correct helper
2024-05-29 11:09:09 -04:00
Gabriel Horner cc92702a98 chore: remove unused fn when setting prop values 2024-05-29 11:09:09 -04:00
Tienson Qin f4dd06f959 enhance: display tags the same way as other properties 2024-05-29 15:37:23 +08:00
Gabriel Horner effde81161 enhance: all user classes have :db/ident
This is important as a user's ontology (properties + classes) is now describable
with unique identifiers. This will allow for easy sharing and
importing of ontologies between users.
Also <create-class! now exists to create classes consistently. Will
be helpful when we want to provide some validation for classes
2024-05-28 16:52:12 -04:00
charlie 0dead80fe1 enhance(ui): support more props for the shui dialog config 2024-05-28 17:03:45 +08:00
Tienson Qin 02fcc69928 CSS tweaks 2024-05-28 03:02:22 +08:00
Tienson Qin 8de8377d4b fix: disable shortcut property when property dialog is opened 2024-05-27 23:03:24 +08:00
Tienson Qin 21e480ec3e fix: can't delete :checkbox property 2024-05-27 22:56:49 +08:00
Tienson Qin d432bb1f71 enhance: back to edit mode after setting a property
Except if the editing property is :default type
2024-05-27 21:10:00 +08:00
Tienson Qin 6ced3bff8f enhance: property editing support shortcut 2024-05-27 20:08:43 +08:00
Tienson Qin c326730ce5 fix: retract icon property when settign a closed value's icon to nil 2024-05-27 12:30:45 +08:00
Gabriel Horner 77f14ca1f6 fix: don't delete property values while typing
property values were deleted while typing b/c
content ref re-calculation wasn't considering them.
Related to LOG-2819
2024-05-24 18:14:14 -04:00
Gabriel Horner 7c0b154fff fix: disallow property self-refs
Causes wonky linked reference animations and maybe other
bugs. Can repro by creating a property url and then adding the :url
property as a page property to the url page
2024-05-24 14:03:16 -04:00
Gabriel Horner d2ea12fab6 refactor: simplify schema and creation of kv ents 2024-05-24 09:50:22 -04:00
Tienson Qin 8458b6b21b enhance: rename :key/value to :kv/value 2024-05-24 15:21:10 +08:00
Tienson Qin db7c4e2145 refactor: use one attribute :key/value for all kvs 2024-05-24 14:22:09 +08:00
Tienson Qin b2f38f6f0c Revert "chore: rename :db/type to :logseq.db/type"
This reverts commit 32e6433c44.
2024-05-24 14:06:39 +08:00
Tienson Qin 32e6433c44 chore: rename :db/type to :logseq.db/type 2024-05-24 14:02:16 +08:00
Gabriel Horner 32ca012635 enhance: pretty print + colorize query script by default 2024-05-23 14:58:55 -04:00
Gabriel Horner 0fc01b94a3 fix: tests 2024-05-23 09:45:38 -04:00
Gabriel Horner 26cf70f6cf fix: update schema and remove unused :name in :icon key 2024-05-23 09:45:38 -04:00
Tienson Qin c118271fdd refactor: property position support left/right/below
Removed the limitation that only properties with closed values can
have custom positions.
2024-05-23 20:48:04 +08:00
Tienson Qin 1cfc426486 enhance: properties ux
1. add icons to priorities
2. hide task properties so that blocks are not collapsable
3. block positions support end of block
2024-05-23 17:18:23 +08:00
Tienson Qin c862ad0d10 refactor: db/transact! as outliner op
The benefits:
1. all db transactions from the UI thread can be described in outliner
ops now.
2. batch undo/redo
2024-05-23 05:16:51 +08:00
Gabriel Horner 8de74ce654 fix: lint for large var 2024-05-22 17:03:00 -04:00
Gabriel Horner ceb3681cfe fix: nbb scripts updates :block/refs the same as app
nbb was only handling path-refs previously. Can remove hacky
managing of refs in create-graph. Still a TODO to fix schema graph
lazy loading bug. Related to LOG-2819
2024-05-22 16:51:50 -04:00
Gabriel Horner 67ff14038a enhance: add :config option to schema graph
also fix outliner lints
2024-05-22 13:37:40 -04:00
Tienson Qin d298567737 fix: wrong arguments for delete-blocks 2024-05-23 00:35:22 +08:00
Tienson Qin f218732b17 fix: property path-refs
1. :block/refs support to page properties
2. don't add built-in properties to refs
3. don't add current block or parents' other properties to :default blocks
2024-05-22 23:30:00 +08:00
Gabriel Horner 8b12e7f136 fix: property refs not calculating for file graphs
Fixes a bug where clicking a TODO in a file graph resulted in an error.
Bring back file graph implementation accidentally taken out in
d31b8cd5ae.
Also fixes related test
2024-05-22 10:42:44 -04:00
Gabriel Horner 04e71a9a23 Bump datascript for nbb-logseq 2024-05-22 09:37:16 -04:00
Gabriel Horner 50698c190d fix: update db's nbb.edn to match deps.edn
Looks like we forgot to add malli to deps.edn awhile back
2024-05-22 08:53:13 -04:00
Tienson Qin 5b99610212 fix: use trigger-id instead of target
Because target might already be unmounted
2024-05-22 20:49:44 +08:00
Tienson Qin b4bfd5cc9a chore: use clj-fractional-indexing 2024-05-22 15:21:35 +08:00
Tienson Qin f944dd2de9 fix: can't add existing :many property 2024-05-22 07:55:18 +08:00
Gabriel Horner cfe22e4acc fix: lints 2024-05-21 16:14:05 -04:00
Gabriel Horner c9b579ae01 fix: placeholder valid for a :many property 2024-05-21 16:09:40 -04:00
Tienson Qin e49acf8256 feat: add property :object type 2024-05-21 23:30:54 +08:00
Gabriel Horner fd5b90596b chore: remove nonexistent fix-tx 2024-05-21 11:00:11 -04:00
Tienson Qin 67bd6c6da3 fix: build refs for either pages or tagged blocks (objects) 2024-05-21 21:05:02 +08:00
Tienson Qin 8d959a7c8b chore: bump datascript 2024-05-21 20:51:22 +08:00
Tienson Qin db8d0c53df fix: datascript upsert db/ident 2024-05-21 19:29:21 +08: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
charlie 685b78e2a0 fix(ux): invalid action for the block selection context menus 2024-05-21 11:26:59 +08:00
Tienson Qin ee35854498 fix: delete property value block when it's not used by other blocks 2024-05-21 07:49:33 +08:00
Gabriel Horner 33832f7941 fix: property names with invalid idents display an error notification
instead of silently failing in console. E.g. `123` as a property name
2024-05-20 17:21:56 -04:00
Gabriel Horner fa4b47d16b fix: property value names in developer cmd
and in readable-properties fn
2024-05-20 16:20:31 -04:00
Gabriel Horner 92299347da chore: rename class ident to match name
Root is also a better name than base
2024-05-20 15:55:40 -04:00
Gabriel Horner 0cfc90e0ef fix: remove :string property type as :default
does everything it used to do. Also remove component behavior specific to :string
2024-05-20 11:46:10 -04:00
Gabriel Horner c5911a571b fix: loading of classes for script-generated graphs
Lazy loading of refs for classes isn't supported in the UI yet so
no need to self-inflect this. Also can move schema graph from :string
to :default usage now
2024-05-20 10:45:27 -04:00
Gabriel Horner 47ed035d42 tweak schema as properties always have :type 2024-05-20 09:29:05 -04:00
Tienson Qin 3b975d2fad enhance: show properties configuration for classes in the sidebar 2024-05-20 18:11:14 +08:00
Tienson Qin 29de339fa1 enhance: don't show date picker for one value
Also, set hint background color when hovering property value
2024-05-20 15:31:55 +08:00
Tienson Qin e34af3412e enhance: delay creating new property until type specified 2024-05-20 13:07:21 +08:00
Tienson Qin 4a681d7193 fix: lazy load page/block embeds 2024-05-18 08:20:34 +08:00
Tienson Qin 1c88d7cb00 fix: can't convert ref-type to non-ref (checkbox) 2024-05-18 06:39:47 +08:00
Gabriel Horner efab7f403e chore: Remove unnecessary catch and rethrow for notification
Just encode notification in original exception to make conversion
as reusable as possible. Also make properties readable with :original-name
as they are case sensitive
2024-05-17 17:25:53 -04:00
Gabriel Horner a17ed389e8 fix: can't delete a closed value being used
fixes LOG-3102
2024-05-17 15:37:52 -04:00
Gabriel Horner 4907f0eb74 fix: task related commands e.g. /Doing
Was broken by adding property ref value support to batch-set-property
2024-05-17 12:40:09 -04:00
Gabriel Horner 05b96d53fa fix: display notification when trying to delete built-in choice 2024-05-17 11:07:53 -04:00
Tienson Qin a50177096e chore: remove debug 2024-05-17 21:00:57 +08:00
charlie 3e37fb6b4a fix: typo 2024-05-17 11:25:10 +08:00
Tienson Qin db721ee3f6 enhance: clear selection before closing popup 2024-05-17 11:15:15 +08:00
Gabriel Horner 3fdaf0474f fix: can't add a class schema or page property
Removed related unused upsert property code. This became unused with #11311.
Also fixed new page property not moving focus to property value
2024-05-16 17:47:49 -04:00
Gabriel Horner 35e6ad120d chore: rename pdf specific properties to logseq.property.pdf
also remove deleted property ns
2024-05-16 15:27:24 -04:00
Gabriel Horner d37df950fa fix: property rules now work with property ref values
Also remove use of :string properties in tests
2024-05-16 15:05:37 -04:00
Gabriel Horner 43dfdbe0ae fix: convert remaining built-in :string props to :default 2024-05-16 11:22:09 -04:00
rcmerci a12a0d3d30 refactor(rtc): support refactored update-op, update local db 2024-05-16 19:47:49 +08:00
Gabriel Horner 8921767b69 fix: batch-set-property working with property value refs
Fixed batch-setting background-color. With this fix was then able
to migrate order-list-type to use :default. Also cleaned up
outdated assumptions in batch fn
2024-05-15 17:37:57 -04:00
Gabriel Horner e50d3eff21 fix: setting block properties with raw value
With this fix able to convert 2 built-ins to :default. Also cleaned
up set-block-property! which had outdated assumptions
2024-05-15 16:10:02 -04:00
Gabriel Horner 2117245b28 fix: fetching built-in property values
Fixes :number properties like hl-stamp and hl-page which returned
refs instead of actual values. This will also fix it for
future usage of built-in :default props. Also fixed a db test
2024-05-15 12:23:14 -04:00
Gabriel Horner 980c88b60d fix: remove table v2 properties
Finish removal started by 82a1a18762.
Still need names in exporter so they aren't incorrectly imported
into db graphs
2024-05-15 10:25:31 -04:00
Gabriel Horner ad9dc70b9c fix: finish removing table v2 from shui dep
Followup to 82a1a18762.
Copied more useful intro from shui-graph into README
2024-05-15 10:25:31 -04:00
Gabriel Horner a70499bd8c fix: remove schema hack now that it's been fixed 2024-05-15 10:25:31 -04:00
Tienson Qin 244de2187e fix: quit batch tx mode even with errors
Also, throw errors and send notifications for apply-outliner-ops
2024-05-15 22:19:06 +08:00
Tienson Qin a689266931 fix: don't persist :block.temp/fully-loaded? 2024-05-15 20:41:17 +08:00
Tienson Qin 114c0524fa fix: handle situations when datom entity has gone or children exists 2024-05-15 10:34:34 +08:00
Tienson Qin a5a7a781eb fix: keep the last repeated datom (different value) in batch tx 2024-05-15 07:54:31 +08:00
Gabriel Horner c554627041 fix: outliner lints
While fixing large vars, fixed needless circular dependency between
create-property-text-block and set-block-property
2024-05-14 15:11:29 -04:00
Gabriel Horner 0238aff2ba fix: replace uses of :string closed with :default closed
and remove :string from closed possibilities
2024-05-14 10:34:54 -04:00
Gabriel Horner 4a7dab2763 fix: can't add or update closed values 2024-05-14 09:29:00 -04:00
Gabriel Horner 45bb11d28d fix: db tests and :op typo 2024-05-13 17:05:32 -04:00
Gabriel Horner a2a951ddcb fix: switching to another number closed value
The bug was creating a new block each time a switch was made
because existing closed values didn't have a created-from-property
2024-05-13 13:23:02 -04:00
Gabriel Horner e55927086f fix: creating :number and :url closed values from config
Also add schema hack for fully-loaded being persisted. Also
add :default property examples to example properties graph now that it's
possible
2024-05-13 12:33:31 -04:00
Tienson Qin ce4cad2cc7
Refactor/move property handler to outliner dep (#11311)
The end goal is to get rid of `db/transact!` and send outliner ops to
the db worker.

Currently, some property ops are async, set-block-property! will also
need to be async because when setting a non-ref value (e.g. a number
str "2"), we need to query whether a block with the value exists, this
unfortunately, will be an async query, so we're risking turning more
functions to async in the future which makes it hard to reason about
the implementation.
2024-05-13 18:16:21 +08:00
charlie 061700c6b1 enhance(ui): WIP optimization for the shui popup related fundamental components 2024-05-11 15:14:21 +08:00
Gabriel Horner fcf6ebd0e4 fix: page properties for :default, :number and :url
Also fix page property example in properties graph and removed
unused branches in validation
2024-05-10 16:40:42 -04:00
Gabriel Horner 64786bb258 fix: create :number and :url properties from scripts 2024-05-10 15:19:10 -04:00
Tienson Qin 11c902eb1e refactor: make all user-facing property types refs 2024-05-10 18:03:07 +08:00
Tienson Qin 4a9aa50a7d refactor: use :string type only for internal properties 2024-05-10 11:22:28 +08:00
Gabriel Horner 70d92c8f7a fix: pdf related properties for db graphs
Added to new property ns as file and file-path are too generic to be top-level.
Also fixed bugs in page creation
2024-05-09 13:38:31 -04:00
Gabriel Horner 123cb8fc42 fix: cleanup property tuple validation
Had an unnecessary entity refetch. Also move ui assumptions about :many
validation to ui as this needlessly limits what :many could store
2024-05-09 10:57:18 -04:00
Gabriel Horner 161c5c8565 Merge branch 'master' into feat/db 2024-05-09 08:41:40 -04:00
Tienson Qin 45e5cde3f9 fix: slow popup 2024-05-09 17:24:07 +08:00
Tienson Qin 339883800d fix: property tuple validation 2024-05-09 16:29:55 +08:00
charlie e9b430b1b0 enhance(ui): refactor the shui-related codes 2024-05-09 12:46:52 +08:00
Tienson Qin 61db29ceba Remove [:block/schema :cardinality]
Uses :db/cardinality instead.
2024-05-09 11:24:46 +08:00
Tienson Qin bccf999853 fix: tests 2024-05-09 08:51:49 +08:00
Tienson Qin 45f14d4b76 refactor: property/schema.properties
Replace [:block/schema :properties] with ref type property/schema.properties.

This commit also introduces :logseq.class/base so that all the other
classes will be its children.
2024-05-09 08:29:11 +08:00
Tienson Qin bb5a3364e6 fix: outdent property child block replaces its parent
Fixes LOG-3141
2024-05-09 04:36:14 +08:00
Tienson Qin 5013d34c2f chore: cleanup :block/_left usage 2024-05-09 04:36:14 +08:00
Tienson Qin d6ffd16799 fix: can't move blocks up
Fixes LOG-3140
2024-05-09 04:36:14 +08:00
Gabriel Horner 00e153e866 fix: closed value :number can also be float 2024-05-08 15:23:57 -04:00
Gabriel Horner 949d676f02 fix: number closed value not saved as its original value
A :number closed value saved as a string is problematic for a couple
reasons:
* Not storing a number by the user's intended value means a loss of any
  numeric functionality the property provides. Basic things like sorting
  by the numeric property don't work. This has caused us problems in the
  past and we invented hacky workarounds like logseq.query/nlp-date to
  compensate for this
* Creates inconsistency in how numbers are saved as non-closed values
  are not saved as string. This affects not only the validation layer
  but also creates bugs when querying for these property values as the
  querying interface is inconsistent
2024-05-08 13:49:22 -04:00
Gabriel Horner 298c37ffc7 fix: lints + schema key which shouldn't have been removed 2024-05-08 12:31:08 -04:00
Gabriel Horner 22f15a3fb3 fix: validating closed value ents
Also fix closed value membership not being checked from CLI
2024-05-08 11:47:45 -04:00
rcmerci f69094713f enhance: move missionary-util to src/main/frontend/common/ 2024-05-08 21:56:52 +08:00
Andelf da78593eb1 fix(sync): cannot delete some nested files
Close #11278
2024-05-08 16:42:41 +08:00
Gabriel Horner be9237d101 refactor: move rules deps usage into helper fn
Dries up task dependency that was copied in query-dsl
2024-05-07 22:11:27 -04:00
Gabriel Horner 489e7f3422 fix: :default-queries for db graphs
closes LOG-3042. Moved :default-queries to default-config as this allows
for any future fix to automatically update for a user. There's also a
breaking change with this config key from :block/journal? so moving this
to default-config makes the migration easier e.g. just tell users to
remove the config key
2024-05-07 18:03:50 -04:00
Tienson Qin 89afdcdd7b fix: outliner core tests 2024-05-08 01:29:23 +08:00
Tienson Qin 976e5c2f6b fix: generate n keys for fractional index 2024-05-08 00:37:17 +08:00
Tienson Qin 1cb0896e3b refactor: remove [:block/schema :values]
Some changes:
1. use :block/closed-value-property instead to record which property
this value entity belongs to.
2. use :block/content instead of [:block/schema :value].
3. :page and :date have been removed from closed-value-property-types
because there could be a page/date that's a closed value for multiple
properties, we have no idea what's the `:block/order` for a specific
property.
2024-05-07 23:33:04 +08:00
Gabriel Horner ead9f30f1b fix: typing hashtag sets heading
also remove unused var
2024-05-07 10:53:32 -04:00
Tienson Qin 4e32a5042a fix: reset *max-key when loading graph 2024-05-07 21:52:56 +08:00
Tienson Qin 308c3bcd17 fix: reset max key when generate-n-keys-between 2024-05-07 20:07:06 +08:00
Tienson Qin ee0d89ad85 refactor: replace [:block/schema :value] with :property/schema.value 2024-05-07 17:26:56 +08:00
Gabriel Horner 4c3fc530b9 fix: task rule and filter for db graphs
Part of LOG-3042
2024-05-06 16:55:45 -04:00
Gabriel Horner 4059062919 fix: block property rules for new properties structure 2024-05-06 16:40:55 -04:00
Gabriel Horner 0d95786a7f fix: remove unused db attributes from db graph schema
part of LOG-3042
2024-05-06 11:59:32 -04:00
Gabriel Horner 6a83812ae9 fix: typing TODO/DOING/etc shouldn't create marker pages for db graphs 2024-05-06 11:49:56 -04:00
Gabriel Horner 8a8dba6af8 fix: db graphs shouldn't have :block/marker at all
part of LOG-3042
2024-05-06 11:40:54 -04:00
Gabriel Horner 42e00f00d7 fix: typo and add more fix-mes left from :block/order change
/cc @tiensonqin and @RCmerci for tests to fix
2024-05-06 11:26:16 -04:00
Gabriel Horner 110813accd fix: deps and frontend lints 2024-05-06 10:45:40 -04:00
Gabriel Horner fe27ce9807 fix: remove handling file-graph specific marker 2024-05-06 09:39:02 -04:00
Gabriel Horner 719ba8cdbe Merge branch 'feat/db' into refactor/db-properties-schema 2024-05-06 08:38:32 -04:00
charlie acc9122c36 enhance(ui): refactor the cmdk-related components 2024-05-06 17:00:17 +08:00
rcmerci b0673fc850 refactor(rtc): remake async upload-graph 2024-05-05 18:20:00 +08:00
rcmerci 9bd1b41441 refactor(rtc): ws2 support s3-presign-url resp 2024-05-05 14:30:15 +08:00
rcmerci 64cd588c1a refactor(rtc): update debug ui with new-impl 2024-05-04 19:35:35 +08:00
rcmerci 2e67aed55d refactor(rtc): replace origin rtc-start&stop 2024-05-04 11:46:08 +08:00
Gabriel Horner 333490fde6 enhance: create-graph scripts can generate classes via :classes
Any script can pass a :classes config key. schema script no longer needs
to manage db ids or db idents
2024-05-03 16:24:46 -04:00
Tienson Qin 7aa3bd7d84 fix: issues of :default :one property 2024-05-03 09:59:20 +08:00
Gabriel Horner b5a8f96426 fix: publishing hl-type-area for db graphs 2024-05-02 16:15:06 -04:00
Gabriel Horner 5130ced982 fix: public queries for publishing 2024-05-02 15:53:48 -04:00
Gabriel Horner 24c48e7a87 fix: multiple fixes related to lookup-by-name
- only use it for user properties
- don't use create ident fn to lookup names
- fixed get-area-block-asset-url which didn't work for db graphs without
  the frontend
2024-05-02 15:16:03 -04: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
Gabriel Horner 602b236a4c fix: graph-parser lint 2024-05-02 10:23:20 -04:00
Gabriel Horner 1dbdb16765 fix: whiteboard shapes being invalid 2024-05-02 10:01:08 -04:00
Tienson Qin 89edb3af9a fix: can't remove Many values 2024-05-02 18:03:17 +08:00
Tienson Qin d907eb7654 fix: wrong digs for fractional index 2024-05-02 14:34:38 +08:00
charlie a417c43029 Merge branch 'master' into feat/db 2024-05-02 11:29:08 +08:00
Gabriel Horner d4ecc393f0 fix: schema with :block/order changes 2024-05-01 16:47:25 -04: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 27ed8c7f29 enhance: allow user classes to have db idents
This allows imported and eventually user classes to have db idents.
Updated schema example graph which now imports classes as
:schema.class/X. Also fix schema properties which were removed from
the debug file and remove unused property uuids
2024-05-01 12:20:26 -04:00
Gabriel Horner 5c81b61774 fix: file graphs can't load b/c db specific attribute fetched 2024-05-01 09:07:23 -04:00
Gabriel Horner 2540bb3014 fix: type validations
:default doesn't have closed and tweak validation error messages
2024-04-30 14:14:25 -04:00