Commit Graph

463 Commits

Author SHA1 Message Date
Gabriel Horner
2432230c22 Some more query cleanup
Remove unused query-triggered atom, remove duplicative state in result
ns and rename query maps to query-m as query being used to refer to
multiple concepts - the query map and the :query inside a query map
2023-06-20 11:53:22 -04:00
Gabriel Horner
144fc5196f Fix block hidden editable properties with user properties
Fixes
https://github.com/logseq/logseq/issues/9489#issuecomment-1590974141 .
Moved logic to util ns to simplify hairy component and test it
2023-06-16 00:11:06 +08:00
Gabriel Horner
29ebf73476 Upgrade clj-kondo in frontend with new fixes
- Couple tests didn't have an is so nothing was tested
- test-non-consecutive-blocks->vec-tree test was fixed
  by updating block->entity-map to include nil attributes
  as the original test wanted
- Also removed a stray :focus
2023-06-13 14:48:50 +08:00
Gabriel Horner
57c3253761 Test another paste scenario and some refactor
Split up fairly long fn and comment understand cases
2023-06-08 11:55:30 -04:00
Gabriel Horner
26dfa792ff Fix formatted link pasting for special links - close #8981 2023-06-08 11:55:30 -04:00
Gabriel Horner
c3aa16de3e Fix query functions not working when in page view 2023-06-06 22:12:08 +08:00
Gabriel Horner
e2214b9963 Add tests for function macro
Split out macros ns that it can be tested. Merged in handler ns as it is
only used for the function macro
2023-06-06 22:12:08 +08:00
Gabriel Horner
064132954c Fix query table functions not evaluating 2023-06-06 22:12:08 +08:00
Gabriel Horner
4c2e61cbd3 Remove deprecated :editor/command-trigger option
This option has been deprecated for a couple months
2023-06-02 11:49:08 -04:00
situ2001
235c9fbb58 fix(editor): handle backspace when at beginning of line in embed page/block (#8421)
* fix(editor): handle backspace when pos is 0 on embed page

* fix(editor): embed block should also be handled

* fix(editor): handle backspace when pos is 0 on embed page

* fix(editor): embed block should also be handled

* refactor(editor): reduce repeated code

* Add tests for deleting block with backspace

Also replace get-prev-block-non-collapsed-in-embed which
isn't being used enough to merit another copy and paste

---------

Co-authored-by: Gabriel Horner <gabriel@logseq.com>
2023-05-31 15:37:39 -04:00
Gabriel Horner
51a23934a4 Fix parse-graph not ignoring correctly for relative dir
parse-graph now returns absolute file paths
2023-05-19 21:49:58 -04:00
Gabriel Horner
514b5faf6e Refactor and simplify dicts
- frontend.dicts encapsulates dicts behavior for all other namespaces
- Each dict ns only has one var which prepares us
- No longer need shortcut.dicts
- Fix remaining lints that were broken
- Also bring back frontend.dicts
- Update guide
- Add a false binding to :editor/toggle-undo-redo-mode which throws a
  needless warning
2023-05-18 18:13:50 -04:00
Avelino
a2d1f65c2f shortcut/i18n: isolate package languages
Signed-off-by: Avelino <avelinorun@gmail.com>
2023-05-18 18:05:22 -04:00
Gabriel Horner
47508ac2ac Add :hidden config support to graph-parser.cli
Also fix lints and tests from previous commits
2023-05-18 23:25:15 +08:00
Gabriel Horner
91beda09d5 Split out graph fns and reuse them b/n gp-cli and electron
Also added test
2023-05-18 23:25:15 +08:00
Gabriel Horner
7d50520f5d test refactor
Bring back helper and cleanup lets
2023-05-17 11:13:19 -04:00
clstb
cf02fed080 feat: improve test comment 2023-05-17 11:13:19 -04:00
clstb
7461d2bc4e feat: add test for save-block 2023-05-17 11:13:19 -04:00
Gabriel Horner
decbc12c53 Add a test to ensure there's no regression on bug
Also introduce helper fn for common db fixture setup
2023-05-16 11:35:18 +08:00
Gabriel Horner
7335a6f623 Fix org mode page refs - close #9367 2023-05-15 11:55:59 +08:00
Tienson Qin
d4cde54510 fix: api get current block (#9372) 2023-05-12 15:13:16 +08:00
Gabriel Horner
b26d83d2fc Fix mailto and other links creating invalid pages
Fixes #9346 and fixes #5926.
Also fixes case where relative paths for unsupported paths were creating
pages per directory e.g. `deps/graph-parser/yarn.lock` created deps and
graph-parser pages
2023-05-11 13:56:25 +08:00
Tienson Qin
01479ef9da enhance(perf): insert and delete blocks (#9142)
* enhance(perf): improve performance for both insert and delete

* fix: remember cursor pos before executing the body in a transaction

Otherwise, the edit-block and position could be changed

* fix: disable delete-concat when there's no child or right sibling

---------

Co-authored-by: Gabriel Horner <97210743+logseq-cldwalker@users.noreply.github.com>
Co-authored-by: Gabriel Horner <gabriel@logseq.com>
2023-05-09 17:24:09 +08:00
Gabriel Horner
8eb1c1f439 Page tags and aliases should be deleted when removed by user
Fix #8627, fix #7720 and fix #8282
2023-05-05 13:49:39 +08:00
Gabriel Horner
f70fbaf5e0 Fix children blocks having stale :block/path-refs
when parent block's refs change.
Fixes #5759, fixes #5992, fixes #6990, fixes #8430 and fixes #4116
2023-05-04 15:38:14 +08:00
Gabriel Horner
1067ffde38 Enhance: Add :remove-block-children? query option for advanced queries and an advanced query :template fix (#9229)
* Add query option :remove-block-children? to remove

There are cases where we want to see block children e.g. using the
:current-block input. Still kept the existing behavior as most users
probably still want children removed. Also fix result count when
removing children

* Remove confusing :template block filtering

Fix #3260 and fix #9045

* enhance: apply tree filter only if the query result are blocks

---------

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
2023-04-25 19:56:27 +08:00
Andelf
f0faf65fca chore: rm unused safe-path-join 2023-04-24 21:30:18 +08:00
Gabriel Horner
8697d59b72 Add test to prevent regression on #9119 2023-04-24 11:08:35 +08:00
Gabriel Horner
a03bd6002c Split sorting tests to make them more readable 2023-04-24 11:06:17 +08:00
Gabriel Horner
43d137cd56 Fix sorting by page column for block queries
Fix #9055
2023-04-24 11:06:17 +08:00
Tienson Qin
bcf575ebd3 add tests 2023-04-19 15:35:54 +08:00
Gabriel Horner
7d801c0f10 Add tests for result related transform and grouping
Also fixed two bugs related to new :group-by-page? option
2023-04-19 14:03:34 +08:00
Tienson Qin
b359718f4a fix: insert properties will truncate other properties if there's any empty property (#9117)
fix: insert properties not working when there's any empty property
2023-04-18 14:01:13 +08:00
Junyi Du
8f647519b2 dev: diff-merge error capturing, with unit test case 2023-04-17 09:41:39 -04:00
Junyi Du
6d89f309db fix: buggy diff-merge case happens when prepend new blocks before first base block 2023-04-17 09:41:39 -04:00
Junyi Du
5aba871ead deps: diff-merge
dev: graph parser IoC hook

test: use test db for diff-merge tests

fix: ci lint

dev: refactoring post block-parsing process

feat: diff-merge 2 way merge integration

fix: key namespace of uuid in fix-duplicated-id

fix: duplicated uuid ci
2023-04-17 09:41:39 -04:00
Gabriel Horner
a53ebf1750 Fix parse-graph namespace bugs
parse-graph didn't have all the extract-options that the app does.
Adding them fixed the bugs.
Also fix publishing bug where old :all-pages-public? option wasn't
respected
2023-04-14 09:35:55 -04:00
Gabriel Horner
eac3c273ca Updates docs version for parse-graph integration tests 2023-04-14 09:35:55 -04:00
Tienson Qin
9d14b8a071 comment require too 2023-03-30 15:44:28 +08:00
Tienson Qin
e8b6561fee fix: disabled html-parser-test temporally 2023-03-30 15:44:28 +08:00
Tienson Qin
c3e401b359 fix: lint 2023-03-30 15:44:28 +08:00
Tienson Qin
18dcc65a07 fix: paste html
Add missing `\t` to the md/org converted from HTML
2023-03-30 15:44:28 +08:00
Gabriel Horner
1e9fac25e4 Add aliase and replace an outdated alias
Also start making node-path consistent for frontend
2023-03-30 12:57:22 +08:00
Gabriel Horner
2a78e72f46 Add a test for copied blocks
Also removed a prn
2023-03-29 18:41:04 +08:00
Gabriel Horner
07a3adcb52 Fix pasting file - fixes #8926
Also remove unused mocks in formatted paste and clean up
editor-on-paste!
2023-03-29 18:39:21 +08:00
Andelf
babb2b1d84 refactor(fs): refine stat fn of Fs protocol 2023-03-28 09:14:42 +08:00
Andelf
8ed5b983b5 refactor(fs): unused mobile fs fn 2023-03-28 09:14:42 +08:00
Gabriel Horner
1d91b9cfd8 Add :page column for block results
As asked for in
https://discuss.logseq.com/t/add-pagename-field-to-the-list-of-table-fields-in-simple-query/15176/2
2023-03-24 10:16:00 -04:00
charlie
fc3e5ac59e refactor: utils for html5 media formats 2023-03-24 10:13:37 -04:00
Tienson Qin
db6fc6b7ee feat: simple query builder (#8774)
Simple query builder

---------

Co-authored-by: Gabriel Horner <gabriel@logseq.com>
Co-authored-by: charlie <xyhp915@qq.com>
2023-03-21 14:27:00 +08:00