Commit Graph

358 Commits

Author SHA1 Message Date
Junyi Du
bd3479abda fix: cache key bindings 2022-12-06 21:00:47 +08:00
Tienson Qin
81f22da35d fix: paste nested blocks 2022-11-29 16:49:13 +08:00
Tienson Qin
f61f0deb78 Merge branch 'cnrpman-page-level-fts' 2022-11-28 10:45:54 +08:00
Gabriel Horner
043fa90dab Merge branch 'master' into mrtracy/ref_sync_fix 2022-11-26 01:10:01 -05:00
Gabriel Horner
e2fe300da7 Move delete-blocks-fn to graph-parser for reuse for nbb
Also:
- Move test to a more appropriate ns - model-test isn't for testing
  higher level parse file behavior
- Delete model fns that are no longer used
- Fix tests which had incorrect target-page-content and were no longer
  testing retractAttribute
- Add options to cli ns for related nbb reuse
- Light cleanup of block deletion
2022-11-26 01:01:36 -05:00
Junyi
b8bb5c9dc6 test: update cases for page content search 2022-11-25 21:26:07 +08:00
Junyi
95d79877c0 feat: highlight page content fts result 2022-11-25 21:26:07 +08:00
Junyi
48445c9149 fix: filename format revert manual title check 2022-11-24 15:57:27 +08:00
Tienson Qin
c44b20ad22 Merge branch 'master' into mrtracy/ref_sync_fix 2022-11-23 14:28:24 +08:00
Gabriel Horner
3440a3d433 Add back fix from #6147 along with its test cases
Also fix testing sexp and reset state
2022-11-23 12:21:36 +08:00
Andelf
674022d4fb test(editor): page-search-hashtag at handle-last-input 2022-11-23 12:21:36 +08:00
Andelf
e31cfb1c65 fix: lint 2022-11-23 12:21:36 +08:00
Andelf
40366f6dbf fix(test): use e2e to test hashtag 2022-11-23 12:21:36 +08:00
Zhizhen He
7fdb9aaffb fix: typo 2022-11-21 17:58:13 -05:00
Gabriel Horner
70a476dde3 Fix up model tests and remove unused rules 2022-11-21 14:02:58 +08:00
Matt Tracy
2848d101b0 Address Review Feedback
- Fixed new page name not being cleared
- Clarified some fn and parameter names
- Added test for reload page w/ title:: property change
2022-11-18 15:35:29 -08:00
Charlie
dd2ef163ba Enhance/PDF viewer (#7369)
* fix(pdf): WIP potential memory leaks
* enhance(pdf): sync page number in highlights metafile
* enhance(pdf): support preview highlight area image in a lightbox
* fix: clojurescript unit tests
* fix(pdf): page number overflow when more digits
2022-11-17 20:31:08 +08:00
Matt Tracy
be7e37e924 Retain block references on file reload
Commit fixes a bug where block references (i.e. `:block/refs`
association in the db) are lost when the page containing the referenced
block is re-loaded due to an update of its underlying file.

Description of Bug:

The bug occurs because when a file is re-loaded to the DB from disk, all existing blocks
belonging to the file are deleted via `retractEntity`, and then blocks
from the parsed file are added. If the file had only had small changes,
the new block set will be very similar to the previous one, although
with different db/ids.

However, while new blocks with "id:: " properties will assume the UUID value
of the previous version of the block, any references to that block via
UUID will *not* be restored in the DB; they are deleted with the
retractEntity command. This results in an inconsistent DB state, where references that should
exist do not.

Description of Fix:

The 'delete-blocks-fn' passed to the graph_parser has been modified as
such:

- It now accepts a list of block uuids to *retain*; graph parser will
  pass the blocks parsed from the new file content.
- For any blocks which match a UUID in the retain list, instead of
  deleting via retractEntity, the individual attributes are deleted via
  retractAttribute (the `retract-attributes` from schema.cljs is used
  for this purpose).
2022-11-16 14:05:19 -08:00
Junyi Du
160793e0d1 fix: some date related issues 2022-11-11 17:32:44 +08:00
Tienson Qin
7038261fad Merge branch 'master' into enhance/ios-folder-picker 2022-11-08 16:06:03 +08:00
Junyi Du
70b41ad7d1 feat: don't rename capitalization 2022-11-08 15:12:00 +08:00
Junyi Du
a1605f301f test: update file rename test cases to latest rule 2022-11-08 15:12:00 +08:00
Nate McIntosh
94d868ca7f fix total time calculation (#7238)
* fix total time calculation

* Added tests for clock conversion
2022-11-08 14:25:55 +08:00
charlie
08758fa0ea enhance(mobile): normalize url protocol path for capacitor fs all operations 2022-11-04 16:35:47 +08:00
Gabriel Horner
55f73c091f Cleanup local test for #6892 and update localCompare to use user's language 2022-10-21 12:09:29 -04:00
Seth Yuan
bc7d37d43e feat: support locale sensitive string comparisons for table sorting (#6892)
* feat: support locale sensitive string comparisons for table sorting

* refac: code review

* refac: add tests
2022-10-21 12:09:10 -04:00
Gabriel Horner
5914c5ebe5 Add unit tests for query table sorting
Serves as example for #6892
2022-10-20 17:40:02 -04:00
sallto
2883bae097 fix: Sorting of Pagelinks in Query tables 2022-10-20 15:04:41 -04:00
Junyi Du
705c0cbf96 test: recover zotero property test 2022-10-18 16:54:16 +08:00
Junyi Du
31cc71cfa3 test: enable Node-test on namespaces with dependency on hickory 2022-10-18 16:54:16 +08:00
Gabriel Horner
2685cd1325 Fix bug with certain plugins and misc cleanup
- Plugins that used effects weren't loading correctly e.g.
  logseq-power-plugin
- Cleaned up translation, docs and some fn naming
2022-10-17 10:31:07 -04:00
Gabriel Horner
0c570a0300 Fix more bugs, move plugins.edn and add enabled
- Move plugins.edn to config/ as it is user configuration
- Add plugin-config enabled flag and moved plugin enabled
- Fixed bugs with manual install
- Refactored plugin-config component to have its own listener
- Split out shared plugin fns to a common ns - plugin-config shouldn't
  need to depend on a component like plugin-handler
- Bump rewrite-edn to include upstream fix and avoid tons of cljs
  warnings with earlier versions
- Fix react warning introduced outside this PR in ui/icon
2022-10-17 10:13:27 -04:00
Gabriel Horner
784ad7cce3 Add unit tests for create-if-not-exists and misc test improvements
- Added unit test as it is used by several handlers
- Fixed test suite failing from last commit now that a test fs is used
- Fixed test stat implementation
- Extracted out Plugin schema to make usage of it less impl dependent
- Made test.helper alias consistent
- Made async testing consistent for export-test
2022-10-17 10:13:27 -04:00
Gabriel Horner
c8cda90373 Fix plugin install bugs and add plugin-config tests
- Add validation for plugins.edn with malli
- Add bb task using malli schema
- Add first async test that interacts with frontend.fs
- Add test helpers to make future async testing easier
2022-10-17 10:13:27 -04:00
Junyi Du
99dc9c371c test: double queare bracket in title 2022-10-16 12:17:11 +08:00
Charlie
d53ac94bfc Enhance/pdf improvements (#6475)
Full-text search, highlights and assets alias support 
It also exposes a plugin API for highlight context menu   
    ```ts
    /**
       * Current it's only available for pdf viewer
       * @param label - displayed name of command
       * @param action - callback for the clickable item
       * @param opts - clearSelection: clear highlight selection when callback invoked
       */
      registerHighlightContextMenuItem: (
        label: string,
        action: SimpleCommandCallback,
        opts?: {
          clearSelection: boolean
        }
      ) => unknown
    ```
2022-10-09 20:44:18 +08:00
Junyi Du
0e4037ab61 Feat: new file name escaping rules (#6134)
* feat: new file name escaping for namespace

feat: new file name decoding back to page name

* test: file name sanitization

feat: use _0x to encode %

feat: don't create title property

test: extra URL encoding for escaped file names

fix: fit pdf prefix into new file name rules

fix: encoding rules on some characters

fix: handle the buggy file names imported by users

fix: pdf block ref failed to jump

fix: #6167

* fix: enhance backward compatibility

chore: title validation

test: fix namespace queries test

chore: use index version stored in config.edn instead of search.versions

* feat: convert old version graph mechanism

ui: file conversion UI

feat: rename files for conversion

feat: don't trigger conversion when title property is manually edited

fix: file conflict notification while renaming files on some OS

feat: re-index on update version

feat: clicking NO in the re-index dialog would update the index-ver flag to suppress the dialog

feat: use html entities for reserved char escaping

dev: remove unresolved vars & minor refactor

chore: move file name sanity from gp-util to fs-util, as it's for encoding only but not parsing

test: update file name tests to html entities rule

test: convert files from dir ver 3 for repo_tests

feat: convert Windows reserved file names

fix: save index version into idb instead of file

fix: decode uri of path while parsing files on mobile

fix: couple dir version and index version to ensure only re-index on converted dirs

feat: go back to url-encode for special chars

* chore: fix lint

chore: improve codebase to address Gabriel's comments

fix: remove file remnants on add conflict

fix: remove file remnants on rename conflict

chore: add test ns to nbb runner

Also fix typoed fn and remove unused code

* fix: issues of rebase PR6134 to master after file-sync merged

* feat: switchable filename format

* fix: use  go block to replace promesa for rename all with blocking

* feat: re-index after apply rename all

* ui: file conversion enhancement

* fix: merging filename format PR with master

* fix: filename format lint & CI

* ui: filename format flow

* fix: error handling on the rare internal file path confliction case

* chore: shorten component code for files-breaking-changed

* chore: fix CI

* Minor fixes per latest code review

- Remove unused page-name-order
- Update catch usage to be consistent with what's on master
- Place state fn in right place
- Wording fixes:
  - select and apply -> manual. There are no checkboxes for the user
  - Update -> Edit. We use edit for all other settings button
  - Alternatives to starting sentences with May. Not a common way to
    start a sentence
  - update outdated template comment

* ux: rename instruction update

* ux: rename instruction update (2)

* Tweak wording of conversion modal

Simplifed first paragraph and explained the page to the user in first
sentence, may isn't a common way to start sentences and updated outdated
wording

* Fix large-var warning by splitting out a piece of component

* fix: right slash on Windows; legacy format file sanitization

* fix: triple lowbar renaming fns

Co-authored-by: Gabriel Horner <gabriel@logseq.com>
2022-10-08 15:47:45 +08:00
Gabriel Horner
1f0e22275d Add ns docstrings for most ns in src/main
- Added to CI now that it passes
- Added no-doc for docstrings that don't add any more than what's in the
ns name or for ones where I didn't know the ns that well
2022-09-27 13:55:16 +08:00
Gabriel Horner
9d9e976b8c Merge branch 'master' into refactor/refs-from-property-values 2022-09-21 15:34:47 -04:00
Gabriel Horner
91d6d14720 Fix sort-by not working for blocks
- Also add sort-by support for pages which fixes #5643
- Add sort-by tests
- Fix sample producing weird queries e.g. mixed block and page clauses
- Clean up last, hard to read test setup in query-dsl
2022-09-20 12:20:17 -04:00
Tienson Qin
585e0dbf9d Merge branch 'master' into refactor/refs-from-property-values 2022-09-14 22:25:09 +08:00
sallto
20542700a5 fix: Date sorting is nonsensical #6363 (#6596)
* fix: Date sorting nonsensical
* simplify normalize-block
* adjusted handling of sets and added tests

Co-authored-by: Junyi Du <junyidu.cn@gmail.com>
2022-09-14 22:13:58 +08:00
Tienson Qin
9e2d6e7cfb fix: page refs 2022-09-09 12:37:57 +08:00
Tienson Qin
336fa578d5 refactor: replace directives(front matter or org) with properties 2022-09-09 12:37:55 +08:00
rcmerci
4f3d26c2ca fix: FileMetadata, <get-local-files-meta, <get-local-all-files-meta 2022-09-06 20:27:16 +08:00
Tienson Qin
cc66195b58 fix: remove monitor-dirs 2022-09-03 19:31:17 +08:00
Charlie
01d879c18e feat!: File Sync (#5355)
- file sync for electron/ios/android
- age encryption of both file content and file path
- massive UI enhancement
- corresponding CI tasks

Co-authored-by: llcc <lzhes43@gmail.com>
Co-authored-by: rcmerci <rcmerci@gmail.com>
Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Co-authored-by: Andelf <andelf@gmail.com>
Co-authored-by: Gabriel Horner <gabriel@logseq.com>
2022-09-01 00:31:49 +08:00
Junyi Du
8dfa8dfb49 fix: CJK hashtag update failure 2022-08-25 22:07:09 +08:00
Gabriel Horner
55ccc2d17c Rename config to :rich-property-values?
Name should allow for additional functionality later
2022-08-23 09:55:15 -04:00
Gabriel Horner
39b43b363c Fix page-properties bug and dsl-query bug
parser test caught page properties bug and dsl-query tests once written
correctly exposed another bug. Also remove unit test as they are
replaced by integration style tests in graph-parser-test
2022-08-11 16:32:00 -04:00