Commit Graph

696 Commits (19435347b9ff4f5301a07ae5c2363dd44711e7f1)

Author SHA1 Message Date
Tienson Qin 222b2f84bc fix: remove unused addr+data from sqlite 2023-12-18 20:56:28 +08:00
Tienson Qin 621faf90a4 fix: don't treat a block as pre block if it has auto heading 2023-12-15 17:10:16 +08:00
Gabriel Horner 8dde33e915 chore: Update datascript to latest version before our fork
Also updated db/entity because d/entity returns nil for nonexistent ids since 1.4.2
2023-12-15 09:42:52 +08:00
Tienson Qin a9f62baf6d wip: transact tx to disk to avoid data-loss 2023-12-15 09:39:56 +08:00
Tienson Qin e8e553c08c Remove bak file 2023-12-14 02:14:48 +08:00
Tienson Qin b8a6f820ad New file based graphs works with opfs db 2023-12-14 02:12:24 +08:00
Gabriel Horner ffa6aaae29 fix: remove unused db.sqlite related fns
- remove sqlite-db/close! as its not used and didn't make sense to be
  used in other electron ns
- remove sqlite-db/connections atom as its not needed
- remove read-graph as its not necessary
- rename cli.persist-graph as its primary purpose has changed
- update effected scripts
2023-12-13 12:06:24 -05:00
Tienson Qin f3d032d83d fix: move some fns from db.sqlite to sqlite.common-db
To remove better-sqlite3 dependency on Electron.
2023-12-14 00:34:07 +08:00
Gabriel Horner 79a9c59dd5 fix: lint and minor cleanup from datascript-storage PR
- remove unused electron state
- remove comment with nonexistent fns
- rename fn which didn't read well
2023-12-13 09:53:16 -05:00
rcmerci 7bca037e71 fix: update <transact-data caller, remove unused build-upsert-blocks 2023-12-13 11:18:00 +08:00
Gabriel Horner e228bd1fb6 fix: tweak schema to be valid for new db graphs
Also reuse initialization data
2023-12-12 16:05:06 -05:00
Gabriel Horner 36a553e4a1 chore merge sqlite-restore into sqlite-db
Also use it on the frontend. Also remove another unnecessary sqlite.db fn
2023-12-12 15:41:02 -05:00
Gabriel Horner a207296a42 chore: reuse some sqlite db fns
Also removed datascript db atom fetching, unused fns and dep in sqlite.db
2023-12-12 15:09:44 -05:00
Gabriel Horner 0f4cdbbadf bump outdated nbb-logseq and fix lint 2023-12-11 15:55:38 -05:00
Gabriel Horner fb3e8e8d8a fix: update ds sqlite persistance to match latest frontend
also removed unused util fns
2023-12-11 13:52:26 -05:00
Gabriel Horner e0901b9d04 bump nbb-logseq to first version
that works for forked datascript. Deps tests pass locally
without needing to rely on local builds
2023-12-11 13:52:15 -05:00
Gabriel Horner b5eabc80ee fix: db and graph-parser nbb tests to pass locally
Updated sqlite fns to use updated approach. Deleted some unused
fns from old approach
2023-12-11 13:51:47 -05:00
Tienson Qin ed06991f46 fix: remove :pdf from allowed formats 2023-12-06 17:39:31 +08:00
Tienson Qin 17f10edb39 fix: ignore binary files and other formats from watcher 2023-12-06 17:39:31 +08:00
Tienson Qin 75c010e1c3 WIP: use OPFS db for electron 2023-12-06 15:03:29 +08:00
Tienson Qin ea3f5973b7 Merge branch 'feat/db' into feat/datascript-storage 2023-12-06 01:10:23 +08:00
Tienson Qin 3df099a15e fix: don't retract attributes for db if block content is not updated 2023-12-05 18:07:48 +08:00
Tienson Qin 67fd609170 fix: typing a normal page as a tag silently changes its page type
User can choose to create either a page or a class with '#' now.
FIXES LOG-2742
2023-12-05 17:31:21 +08:00
Gabriel Horner e847c0899a enhance: bring back built-in properties using closed values
Fixes LOG-2903. Also fixed a bug with logseq.color property
not working with latest accent color
2023-12-04 17:29:41 -05:00
Gabriel Horner 2554016d63 enhance: make closed values scriptable
Added closed value examples of all 5 property types
to properties graph. Part of LOG-2903
2023-12-04 10:11:52 -05:00
Tienson Qin e04a5b4316 Merge branch 'master' into feat/db 2023-12-04 20:47:37 +08:00
Tienson Qin ecde2c3bfc
fix: cross-platform shotcuts (#10590)
This PR also simplifies the implementation of shui/shortcut a lot.

* fix: consistent char for the Enter key

* fix: show ctrl instead of ⌘ for copy ref

* fix: "Ctrl" should be split from "Ctrl X"
2023-12-03 12:40:08 +08:00
Gabriel Horner 0ffce18d15 chore: rename property.type vars
- renamed schema-type to property-type as its not
  a type of schema and schema is an ambiguous context
  as it also applies to a class
- renamed builtin to built-in to be more correct
2023-11-30 16:26:44 -05:00
Gabriel Horner f5e339293f fix: add validation for property types and :schema attributes
Part of LOG-2953. We shouldn't persist unusuable property type
configurations as shown by this bug. By enumerating what schema
attributes are allowed for each type, we can prevent future bugs
like this. When changing between property types, this also cleans up
:classes, :position and :values that were accidentally hanging around
for certain types. Also modify test since we don't allow users
to use a :default property with :cardinality
2023-11-30 16:24:11 -05:00
Tienson Qin 47082c8a16 fix: do not hide shortcuts in the search modal
Fixes #10575
2023-11-30 22:31:27 +08:00
Gabriel Horner d218db4e6f fix: fixes bug with unusuable :default property
Part of LOG-2953. Also fixes bug when a new property first displays
configure modal and incorrectly shows cardinality for :default property
2023-11-29 17:15:35 -05:00
Andelf f1d763aa12 chore: comment out electron? feature gate 2023-11-30 02:29:08 +08:00
Gabriel Horner 1117ad3cb4 fix lint
also comment out print that prevented chaining query results with bb
2023-11-29 10:14:53 -05:00
Gabriel Horner 6517f6f12a Merge branch 'master' into feat/db 2023-11-29 09:56:12 -05:00
Tienson Qin e60ea3ac10 fix: remove debug assert 2023-11-29 21:03:52 +08:00
Gabriel Horner 548fa98605 enhance: allow CLI and github action to set color accent 2023-11-28 22:32:34 +08:00
Tienson Qin 86b70e3b33 update datascript 2023-11-28 15:10:43 +08:00
Tienson Qin 716c496590 Update datascript 2023-11-28 14:57:06 +08:00
Andelf 68bae90039 test(fs): add unittests for new fn 2023-11-28 02:39:52 +08:00
Andelf 3069f5d7e3 fix(fs): path-join testcase 2023-11-28 02:39:52 +08:00
Andelf 61a3c19176 fix(fs): windows unc path support 2023-11-28 02:39:52 +08:00
Gabriel Horner 5e547a1663 fix: open db graph urls
Also introduced var for logseq_db_ in deps
2023-11-27 10:55:22 -05:00
Tienson Qin 232c1cb4c2 wip: debug 2023-11-26 15:58:26 +08:00
Tienson Qin a4c30bc62f Works!! 2023-11-25 14:14:02 +08:00
Tienson Qin a408f93b26 fix: db restore 2023-11-25 11:58:11 +08:00
Tienson Qin 6ff1207339 Replace data load and transact 2023-11-25 11:51:59 +08:00
Tienson Qin b7ce9a7ca5 fix: add transact and datoms load 2023-11-25 11:22:59 +08:00
Tienson Qin 67cb8d6213 wip: persistent datascript storage on Electron 2023-11-25 10:49:01 +08:00
Tienson Qin 40bffa32b0 Use forked datascript 2023-11-25 09:12:59 +08:00
Gabriel Horner 6c5072e7e6 fix: property completion should only include properties
Was including classes and blocks with :block/schema. Also not
hiding icon property correctly. Also updated outdated docstrings
2023-11-22 12:29:57 -05:00
Gabriel Horner f64f1461a3 enhance: make bb dev:db-transact usable for any task
closes LOG-2647. This task was used to update multiple graphs
that were now invalid with the removal of :block/type "object"
2023-11-16 16:40:35 -05:00
Gabriel Horner cca80e37a7 fix: remove unused :block/type "object"
fixes LOG-2914
2023-11-16 14:50:21 -05:00
Andelf 60159eba87 enhance(db): use wasm-based sqlite storage 2023-11-16 21:15:25 +08:00
Gabriel Horner d43fb23ef0 enhance: allow CLI and github action to set color accent 2023-11-15 16:37:03 -05:00
Gabriel Horner b359694c4b fix: multiple fixes for property validation
- couldn't use :default block property values
- couldn't add new closed number value
- couldn't select existing :page or :date closed values
- editor/CLI validation wasn't working - see failing db-graph-test job
- update schema for closed-value
Part of LOG-2871. Also fixed typo in ui.cljs
2023-11-15 14:55:57 -05:00
Tienson Qin 443eb3f2b8 fix: closed value validation
A closed value must be a UUID and exists in the predefined schema
values from its property.

Related to LOG-2871.
2023-11-15 22:58:05 +08:00
Gabriel Horner 86eb1b394d fix: update schema for latest changes to closed values
part of LOG-2871
2023-11-14 16:08:03 -05:00
Tienson Qin ee3442a44b Merge branch 'master' into feat/db 2023-11-14 20:40:36 +08:00
Tienson Qin 6a47648c6c
Replace enum type with available choices (#10438)
* Add type schema for enum values

* Refactor: closed values instead of enum to limit values

There's no need to add the enum type, we just want to limit the
values.

* feat: :page type supports closed values

* fix: can't set property values for text/number types

* fix: don't trigger on-chosen when unmounting any select component

* fix: can't apply both page classes limitation and closed values

* fix: merge conflicts

* fix: ui not refresh when changing closed value

* fix: can't set icon for closed value
2023-11-14 18:48:34 +08:00
Tienson Qin 2a62767f34 chore: replace shui__ with ui__
Theme creators don't need to know about shui.
2023-11-13 22:39:53 +08:00
charlie 0e1295b142 fix(ui): shui button internal theme state 2023-11-13 21:57:16 +08:00
Tienson Qin e4714668b9 fix: cmdk on mobile 2023-11-13 16:41:00 +08:00
Tienson Qin eaadd462ff fix: listitem hardcode css variable 2023-11-13 13:37:21 +08:00
Tienson Qin 80703328b0 fix: keyboard shortcuts style 2023-11-13 13:09:14 +08:00
Tienson Qin 96693439d0
Feat/cmdk radix tweaks (#10493)
* prefer --lx-gray-11

* Fix sidebar item color

* Update theme mode images

* Update shortcuts globally

* Assets updated to support radix

* fix: add missing keyboard-shortcut class

* fix: custom button background

* fix: lower case shortcuts

* chore: remove old shortcut list

* fix: shortcut ns

* enhance: shortcut accepts both sequence and string

* fix: shortcut remap ux

* fix: remove codemirror box shadow

---------

Co-authored-by: Ben Yorke <ben@yorke.io>
2023-11-12 20:43:10 +08:00
Gabriel Horner 61eeb96709 fix: 3 bugs with persisting whiteboard data
- :block/uuid was a string
- no timestamps on whiteboard blocks
- no created-at on whiteboard shape blocks

Also added missing page attributes for whiteboard page. Initially I
modeled whiteboards as its own schema type with fewer page attributes
but then I noticed it got format and journal? when referenced so just
added the missing attributes. Fixes LOG-2915
2023-11-09 11:21:18 -05:00
Tienson Qin f52e6bf127 enhance: replace ui/button with shui/button 2023-11-09 00:37:14 +08:00
Ben Yorke 018835b700 Specify gradient stops 2023-11-08 15:59:48 +01:00
Tienson Qin 117ebe0768 fix: create button bg 2023-11-08 22:00:59 +08:00
Tienson Qin 05da1618b6 enhance: tip style tweaks based on jakob's suggestions 2023-11-08 20:41:07 +08:00
Ben Yorke 1896d372b1 fix highlighted text color 2023-11-07 16:35:31 +01:00
Tienson Qin 69370db70e fix: esc handler 2023-11-07 16:49:00 +08:00
Gabriel Horner 3162a06c3d fix: page-tags filter shouldn't show :block/link duplicates 2023-11-06 14:22:44 -05:00
Tienson Qin eeeea39fa4 fix: button doesn't support href attribute 2023-11-06 22:34:17 +08:00
Tienson Qin b0b24f795a fix: lint 2023-11-06 22:09:41 +08:00
Tienson Qin 04b85f6572 fix: hidden text 2023-11-06 11:35:23 +08:00
Tienson Qin fc4c1d4c71 fix: highlight match 2023-11-05 21:37:55 +08:00
Tienson Qin 2d1d841926 fix: white text icon for dark theme only 2023-11-05 19:56:12 +08:00
Tienson Qin 3f18cebe7d enhance: add fade-in to shortcut 2023-11-03 01:48:16 +08:00
Tienson Qin 6e046fb3d1 enhance: display shortcut when highlighted 2023-11-03 01:03:09 +08:00
Tienson Qin 12ddf65a22 Add shui/shortcut component
Display mod+up/down for show more/less
2023-11-03 00:47:31 +08:00
Tienson Qin 8d2d857ca3 fix: add default value for button theme 2023-11-03 00:19:17 +08:00
Tienson Qin 07146f4b81 enhance: ESC to quit filter 2023-11-03 00:16:36 +08:00
Tienson Qin f16127c80b enhance: tile sm size 2023-11-03 00:16:36 +08:00
Tienson Qin 439d08cf8a enhance: move tip to the left 2023-11-03 00:16:36 +08:00
Gabriel Horner 3ccf80fcba add docs for new linter
also fix outliner lint
2023-11-02 09:32:51 -04:00
Tienson Qin 42aa66c8e1 fix: replace buggy shortcuts handler with mixins
Also, removes :none for sections expand/collapse because:
1. It's not needed that often, we also have filters
2. Highlighted item will be invisible when collapsing the section
2023-11-01 16:47:44 +08:00
Tienson Qin 3b336ba9b1 fix: display block breadcrumb instead of its page for search items 2023-11-01 13:18:24 +08:00
Gabriel Horner 3c134d4716 enhance: Make db validation configurable
Added 3 db validation options to more aggressively notify and to provide
stricter levels of validation. Part of LOG-2818
2023-10-30 17:25:12 -04:00
Gabriel Horner c88b0a2a4e fix: remove broken built-in enum properties from app and script
It's too complicated for now but hope to bring this back
Part of LOG-2871
2023-10-30 10:43:58 -04:00
Gabriel Horner 5f392a2260 fix: update schema to include new enum value block
Part of LOG-2871.
Also fixed create-graph failing due to renamed ns
2023-10-30 10:43:58 -04:00
Tienson Qin 8c7098b21f enhance: move enum property choices to hidden page
related to LOG-2871
2023-10-30 20:35:39 +08:00
Gabriel Horner 2ce35667c5 First pass at a general transact script for db graphs
Moved persist-graph ns into outliner dep so it can be used
by scripts
2023-10-27 17:40:12 -04:00
Gabriel Horner a6c30554af fix: 3 date related attrs missing from block schema 2023-10-27 15:13:32 -04:00
Tienson Qin e8d411b837 fix: typing markdown property results in a blank line
Fixes LOG-2741
2023-10-27 14:23:26 +08:00
Gabriel Horner 075efcb222 fix: malli schema missing two ref attributes
Validator errored when I collapsed a property. Added a sync
check so that future changes to datascript schema alert developer
to make a change in the malli schema.
Also removed a ds attribute for DB schema
2023-10-26 15:44:14 -04:00
Gabriel Horner d571e90d3e fix: new hidden pages showing up in search
part of LOG-2854
2023-10-26 13:58:44 -04:00
Gabriel Horner e5e25bb403 update schema for new hidden page attributes
part of LOG-2854. Also update --closed-maps to use library fn
2023-10-26 12:05:12 -04:00
Ben Yorke 184dfd7d54 More design tweaks 2023-10-26 14:24:12 +02:00
Gabriel Horner 2acac87094 fix: macros were not being saved
macros were being discarded as unknown blocks when they should've been
saved as a block with a known type.  Introduced a new type number as
macros don't have most of the attributes that blocks or pages do.
Features like collapsible queries now work in db graphs. Also removed
an outdated reference that assumed macro was a page (which it no longer
is)
2023-10-25 17:05:31 -04:00
Gabriel Horner 211dd6aea7 enhance: disable preferred-format and setting org-mode
for db graphs. Also deprecate in config
2023-10-24 17:15:05 -04:00
Ben Yorke 7a7c3b9c62 Design refresh 2023-10-24 17:35:51 +02:00
Ben Yorke 3325f47136 resizing 2023-10-21 16:28:17 +02:00
Gabriel Horner 4fd591620b validate entities that are changed per transact!
This should help us catch bugs due to invalid data fairly quickly.
This only runs when in dev?
part of LOG-2818
2023-10-20 16:57:00 -04:00
Gabriel Horner f860553d89 enhance: add enum choices to built-in table properties
Also hide all built-in table properties like we do for file graphs
2023-10-19 11:57:27 -04:00
Gabriel Horner b4e5e4b640 enhance: tags dropdown autocompletes to classes
Autocompleting all pages including journals and built-in pages is
noisy and misleading. By autocompleting classes we give user
a better experience and avoid creating buggy edge cases like built-ins as a
class. Properties can also choose to class page autocompletion by
choosing "Logseq Class" for their property's :classes
2023-10-18 16:43:40 -04:00
Gabriel Horner c7c438b85a fix: last-modified-at not being set for files
Also fixed a bug with the all-files view where the current time was
being displayed instead of a file's last modified time. Also updated
db graph's schema for files
2023-10-17 16:12:24 -04:00
Gabriel Horner edaf9b286a chore: move frontend db namespaces to a dedicated parent ns
Moved these namespaces to logseq.db.frontend.* to make their purpose
explicit and make the namespaces easier to maintain
2023-10-16 17:24:51 -04:00
Gabriel Horner b1b830c872 fix tests I forgot to update with :block/format fix 2023-10-16 16:14:53 -04:00
Ben Yorke 69e02edaeb Merge branch 'master' into feat/cmdk 2023-10-16 21:02:12 +02:00
Ben Yorke 9d6154937a Save dialog 2023-10-16 20:39:04 +02:00
Gabriel Horner e09a5d9988 fix: pages didn't consistenly have :block/format
Making attributes consistent reduce bugs in components and query layer (where
most wouldn't know to use get-else)
2023-10-16 12:58:11 -04:00
Gabriel Horner 8756600fd7 Add CI job to test creating and validating a db graph
also update older actions
2023-10-13 10:53:01 -04:00
Gabriel Horner 1aa1d46474 fix: db and most frontend lints 2023-10-12 16:30:04 -04:00
Gabriel Horner cd6b50459d fix: bring back property creation from new class modal
also loosened property schema as irreversible :type
has changed how :block/schema is set
2023-10-12 13:36:34 -04:00
Gabriel Horner 82bcd01525 simplify :map declarations in db schema
Make :closed opt in rather than required in order for --closed-maps
to work
2023-10-12 10:02:45 -04:00
Gabriel Horner 4f7baaaffe fix: icon page failed to load
caused by icon having wrong type
2023-10-12 09:22:11 -04:00
Gabriel Horner 8eeeef536b fix: using enum values shouldn't create unknown blocks
also updated enum schema
2023-10-11 18:07:08 -04:00
Gabriel Horner c8ccc79e82 fix: db/ident and schema/version shouldn't create unknown blocks
Also log unknown blocks and make their entity more explicit with the
goal of eventually resolving all unknown blocks. Also added
a query bb task. Part of LOG-2818
2023-10-11 16:02:13 -04:00
Gabriel Horner fe7a46eac9 Move db malli schema into db dep since it's stable
Also add a validate-db task. Part of LOG-2739
2023-10-11 08:40:26 -04:00
Gabriel Horner ccc0bf9bad Add validation for property values
Reuse schema for property types and values from frontend. Moved into db
deps as it will soon be needed for a db namespace. Also tweaked schema
for :template type
2023-10-10 17:31:30 -04:00
Tienson Qin 7138be295f remove :blocks-container-id usage 2023-10-11 00:46:47 +08:00
Ben Yorke 2d659e8058 Indice being built async + jakob feedback 2023-10-10 15:47:19 +02:00
Ben Yorke 2730f3bc0e another round of logging 2023-10-09 17:08:40 +02:00
Ben Yorke 145c519e1a Add logging to highlight query 2023-10-09 16:05:14 +02:00
Ben Yorke 6247cc35fe Abandon perf fix attempt 2023-10-09 15:00:35 +02:00
Tienson Qin 00445910c7 fix: both tagged blocks and pages are objects 2023-10-09 00:43:36 +08:00
Gabriel Horner df8f16ba2c add validation for internal and user properties
by reusing existing schema-types for db properties
2023-10-06 15:18:37 -04:00
Gabriel Horner 83e9cda446 fix: new properties that didn't have :block/journal?
Some page queries depend on the existence of this attribute including
graph view ones. This was caught by the validation script. After the fix
all pages have this attribute. Creation scripts also updated to use
standard timestamp approach
2023-10-06 12:29:33 -04:00
Tienson Qin 85d1a82340 fix: cleanup block parents created from properties when reset value 2023-10-04 20:53:08 +08:00
Gabriel Horner a0441f3ddf enhance: move db-based recent pages and search to local storage
These read-only actions were saved to datascript storage and would
cause needless conflicts for multiple users
Fixes LOG-2833
2023-10-03 10:58:19 -04:00
Gabriel Horner 8df7c37245 disable nlp-date? property in db graphs
We have date properties in db graphs and users should be using them
instead of this poor performing approach
2023-10-02 16:44:03 -04:00
Gabriel Horner fcd4ee1d33 chore: block/pre-block isn't used in db graphs
Move related fn into a file only ns and fix lints in that ns
2023-09-29 22:21:34 -04:00
Ben Yorke 79a11f8b88 Jakob IV 2023-09-29 17:03:31 +02:00
Ben Yorke 2ab619e44a Fix build error 2023-09-29 16:21:14 +02:00
Ben Yorke 328cd58c9f Jakob round III 2023-09-29 16:11:20 +02:00
Ben Yorke 3106eeff99 Fix breaking normalization 2023-09-29 11:24:21 +02:00
Ben Yorke 7868b3aee7 Jakob feedback 2023-09-29 11:17:52 +02:00
Tienson Qin 83723cb5fd fix: page icon display 2023-09-27 21:50:29 +08:00
Ben Yorke 3893d26445 Fix lower case bug 2023-09-26 15:32:13 +02:00
Gabriel Horner 7ba09bdb69 fix: has.*property rules incorrectly match blocks that had date properties
Adding a property to a block and then deleting it used to leave empty
values on all property types. Thx to the recent multi-select ux update
, this mainly just happens with the date type
2023-09-26 09:29:29 -04:00
Gabriel Horner 93d544e96a fix: toggling ordered list number
also removed and fixed related property type that was invalid
2023-09-25 16:55:29 -04:00
Gabriel Horner 4d819ac1b3 fix: slides and aliased page navigation for db version
Update a few fixmes for properties.
Also add built-in prop which we've documented for slides.
Also show hide for built-ins properties as built-ins also use it
2023-09-25 15:29:24 -04:00
Gabriel Horner 82994cb79d fix: tests related to :block/type arity change 2023-09-25 12:30:21 -04:00
Ben Yorke e3407138cd Updates 2023-09-25 16:21:41 +02:00
Tienson Qin 0e8653985d refactor: allow a block to have multiple types
For example, a whiteboard page can be used both as a property and a class.
2023-09-25 10:46:00 +08:00
Ben Yorke 2ee777ae97 Updates 2023-09-24 21:31:45 +02:00
Gabriel Horner 358987d7b3 Fix icon property and update property related fixmes 2023-09-21 16:34:06 -04:00
rcmerci b12432bcd6 feat(rtc): support :block/alias sync
also update `ref-type-attributes`, `card-many-attributes`,
`card-many-ref-type-attributes`, `card-one-ref-type-attributes`
in ns `logseq.db.schema`
2023-09-21 00:31:38 +08:00
Gabriel Horner 71060a847e fix publishing lint 2023-09-20 10:45:12 -04:00