Commit Graph

167 Commits

Author SHA1 Message Date
Tienson Qin
d911a03c90 fix: lint warning 2022-10-18 16:52:25 +08:00
Tienson Qin
170eb1d791 fix: can't collapse/expand in the exported public graph 2022-10-18 16:52:25 +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
2ce6dfad41 Use catch :default for default error handling in cljs
This is considered normal practice for cljs. See
https://clojure.atlassian.net/browse/CLJS-661 for when it was introduced
and background on it
2022-09-23 02:00:55 +08:00
Tienson Qin
7fa9209e29 fix: load global config synchronously instead of relying on watcher
This commit also refreshs the shortcuts when config files has been edited.
2022-09-08 12:34:27 +08:00
Tienson Qin
30e87ec5ea fix: linked blocks are not modified when renaming a page 2022-08-23 21:23:42 +08:00
Tienson Qin
a1ca6820df Fix: broken linked references (#6105)
* enhance: clicking the refresh button if a query is slow

* fix: skip running slow queries if there's no need to refresh

* fix: linked reference filtering does not work on TASK items

close #1669

* fix: each block should have its own page as a reference when query page references

* fix: references

* fix: non consecutive blocks in query result and filtered linked references

* simplify filters logic

* fix: ref numbers

* Save both :block/refs and :block/path-refs for different usage

* fix: block refs

* enhance: move scheduled and deadlines to its own ns

* linked references performance tweaks

* mouse hover filters icon to expand the collapsed linked refs

* perf: react/refresh! once instead twice

* enhance: compute flashcards every hour instead of every 5s

* feat: macros as blocks

* feat: flashcards list

* fix: refed pages count

* fix: can't select in linked references

* fix: block editing on linked refs

* perf: editing in linked references

* enhance: update srs cards number when clicking flashcards

* Add a test for the case fixed in #6100

* Address feedbacks from Gabriel

* fix: Block Ref Indicator is missing from the references-blocks class

close #5375

* fix: referenced pages

* fix: page refs

* fix: Using filters pushed the title property to the second block

close #5845

Co-authored-by: Gabriel Horner <gabriel@logseq.com>
2022-08-04 13:03:12 +08:00
Tienson Qin
d40c0d8926 fix: WIP broken undo/redo for long page 2022-07-20 13:56:04 +08:00
Junyi Du
47f5c650f9 fix: edn import: keep block uuid; remove redundant last block
fix: json import uuid failure

enhance: improve get-all-referenced-blocks-uuid query
2022-06-24 17:11:24 +08:00
Junyi Du
0cdacc35e2 feat: import from logseq edn
feat: import edn with provided uuid

feat: overwrite page uuid; use properties in content

feat: error handling for importing

feat: support json import

chore: fix lint by splitting setup ui
2022-06-24 17:11:24 +08:00
llcc
7c8ae98911 fix save issues after iOS app re-installation (#5697)
* fix save issues after iOS app re-installation
* fix: ios installation id updates when switching graphs
* fix duplicated file-paths in db

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
2022-06-14 18:22:40 +08:00
Gabriel Horner
6608537909 Move logseq.graph-parser.db* namespaces to their own dep
Also add its own CI file
2022-06-10 15:39:11 +08:00
Gabriel Horner
83a4e62bfd Merge branch 'master' into enhance/graph-parser-part-four 2022-05-30 10:18:34 -04:00
Tienson Qin
06e932d130 refactor: listen to db changes for outliner pipeline 2022-05-30 12:16:46 +08:00
Gabriel Horner
2b48d95493 Move frontend db namespaces that graph-parser depends on
graph-parser should be independent of the app
2022-05-26 18:04:45 -04:00
Gabriel Horner
5bce219ca4 Remove unused db-type being passed to start-conn
Also removed other unused db fns
2022-05-26 18:04:45 -04:00
Gabriel Horner
11d3d5b3cd Remove unused :me/* attributes
These were removed in b3f67c69b1.
Also removed related, unused spec
2022-05-26 18:04:45 -04:00
Tienson Qin
d93911b44c Remove both unused :git/** and :project/** dict keys 2022-04-24 11:17:47 +08:00
Tienson Qin
b3f67c69b1 misc: delete both web github integration and encryption 2022-04-24 11:17:47 +08:00
Tienson Qin
403bb10b14 Fix: creating new pages from bracketing text is broken #4971
close #4971
2022-04-23 06:50:22 +08:00
Tienson Qin
904eff6d9d Core outliner operations refactoring (#4880)
* Add outliner nested transact!

Copied the code mostly from https://github.com/logseq/logseq/pull/4671
by zhiyuan

* refactor: insert-blocks

* fix: insert-blocks

* fix: move cursor to the last block when inserting

* fix: replace the current block when inserting and its content is empty

* keep only :insert-blocks

* expose only :delete-blocks

* Use existing implementations for move-nodes-up-down and

indent/outdent.

* fix editing state not updated immediately

* fix editing status

* fix: avoid recursive copy

* fix: inserting blocks after an empty block

* Implement move-blocks with insert-blocks

* fix: block left

* Implement move-blocks-up-down with move-blocks

* fix: paste text

* Implement indent-outdent-blocks with move-blocks

* fix: indent/outdent

* feat: multiple blocks drag && drop

* fix: indent/outdent blocks

* fix: drag drop

* Port unit tests for outliner.core

* enhance: open collapsed parent when indenting blocks

* refactor: block selection

* fix: indent/outdent blocks with different levels

* Add instrument on invalid outliner structure

* fix: can't write a block if the page has any outdated blocks

* fix: editing status for empty page

* fix: multiple drag & drop

* fix: drag & drop disallows moving from parents to its child

* fix: public property

* fix: can't delete first empty block

* Remove unused code

* fix: e2e tests

A workaround is to not select/highlight the block when pressing esc if it has
fenced code.

* remove unused code

* Add batch transaction test

* fix: update :block/page when dragging targets' children to another page

* Add more tests

* Simplify extract

* Replace db/get-conn with db/get-db

* Simplify extracting blocks from ast

* Code cleanup

* Code cleanup

* Add outliner core fuzzy tests

* Remove unused code

* fix: cursor not jump to the upper block when pressing Enter in the beginning

* fix: Enter in the beginning of a non-empty block

* Fix lint warnings

* Add editor random e2e tests

* Fix typo

* enhance: move some fns and add some comments

* enhance(outliner): add page-block? util

* fix: increase td width to prevent content overflow

Signed-off-by: Yue Yang <g1enyy0ung@gmail.com>

* First pass at file tests for file-sync

Each action usually passes by 5th try

* Fix two incorrect calls caught by tests

* More test improvements

- Easier auth setup
- subdirectory is configurable
- list graphs api also exercised

* Address cleanup from #3839

- Remove unused translation key
- Delete or TODO commented code
- Capitalize notifications to users

* fix quick capture template not working

* enhance(sync): add logout

* enhance: add logout i18n

* fix(plugin): sometimes plugin settings of gui not work when entry from app settings

* enable show-brackets? toggle for orgmode [[file:./pages/demo.org][demo]]

* fix(sync): fix unfinishable sync loop

* feature: logseq protocol; refactor persistGraph

* fix: deeplink support

* fix: broadcast persist graph on opening new graph with logseq protocol

* feat: logseq protocol open action for page-name and uuid

* fix: logseq protocol graph param validation

* ux: copy logseq URL of block

* enhance: remove the redundant 'open' from logseq protocol (v0.1)

* ux: page dropdown button for copy page URL

* chore: logseq protocol comments

* don't create new contents file when changing format

Logseq now creates a new contents file when users try to toggle the
preferred format, which causes file duplications error.

* fix pasting in src block not working on iOS

close https://github.com/logseq/logseq/issues/4914

* fix playing video goes into editing mode on iOS

* fix copy to clipboard failure on iOS

* add Podfile item

* fix mobile toolbar order not persisting after restart

* test(e2e): add test for backspace and cursor pos (#4896)

* test(e2e): add test for backspace and cursor pos
* fix(test): refine, fix wrong helper

* fix(ui): warn about illegal git commit interval

* enhance(editor): allow global git cmd shortcut

* style(settings): line-space of general/journals

* enhance(editor): accept enter in dummy block

Fix #4931

* fix editing state not updated immediately

* fix: can't write a block if the page has any outdated blocks

TODO: clean outdated blocks

* fix: editing status for empty page

* Random tree for outliner core tests

* Add pre assertions and fn docs based on Zhiyuan's suggestions

* Made some changes based on Gabriel's suggestions

* fix: tests

* fix: save current block before moving

* Updated the timeout to 100ms based on llcc's suggestion

https://github.com/logseq/logseq/pull/4880#discussion_r851966301

* api-insert-new-block! supports replace-empty-target?

* fix: replace all :reuse-last-block? usage

Co-authored-by: rcmerci <rcmerci@gmail.com>
Co-authored-by: Yue Yang <g1enyy0ung@gmail.com>
Co-authored-by: Gabriel Horner <gabriel@logseq.com>
Co-authored-by: llcc <lzhes43@gmail.com>
Co-authored-by: charlie <xyhp915@qq.com>
Co-authored-by: Junyi Du <junyidu.cn@gmail.com>
Co-authored-by: Andelf <andelf@gmail.com>
2022-04-19 11:14:38 +08:00
Junyi Du
ee2dcd8f09 enhance: remove the redundant 'open' from logseq protocol (v0.1) 2022-04-15 17:16:27 +08:00
Junyi Du
31e3617e20 feat: logseq protocol open action for page-name and uuid 2022-04-15 17:16:27 +08:00
Tienson Qin
c37b5bd622 enhance: only restore the last opened graph 2022-04-02 21:52:31 +08:00
Tienson Qin
b9df07ee45 Merge page and block queries to get-paginated-blocks 2022-04-02 21:40:28 +08:00
Junyi Du
4f533fd5a8 fix: load transit file on graph switching 2022-03-20 19:02:51 +08:00
Andelf
194bc9dc88 fix(ci): lint errors 2022-03-10 12:22:03 +08:00
Tienson Qin
b453fed819 fix: can't collapse/expand in publishing
close #4304
2022-03-10 11:50:18 +08:00
Junyi Du
9eaec328a9 enhance: add :graph/ready event; check search version of each repo 2022-02-23 11:35:50 +08:00
Tienson Qin
ee9b52248e Performance improvement: incremental queries (#4002)
Incremental queries
2022-02-17 20:26:03 +08:00
Tienson Qin
faea913a40 enhance: cut memory usage 2022-02-08 15:49:09 +08:00
Gabriel Horner
54420c9a5d Address review feedback 2022-01-28 10:48:44 -05:00
Tienson Qin
3a2724fb4d chore: remove prn 2022-01-19 13:53:34 +08:00
Tienson Qin
da58f57383 fix: invalid graph cache 2022-01-19 13:44:46 +08:00
Tienson Qin
6aba8c3241 Improve long page editing performance (#3855)
* Remove expensive parsing when saving files

* Add limit to page blocks query

* Don't collapse block's body to make it compatible with other tools

* Alert if there're unsaved changes when switching graphs

* DB schema migration for :block/collapsed? from it's property

Co-authored-by: Andelf <andelf@gmail.com>
2022-01-18 10:37:31 +08:00
Gabriel Horner
3ec587d6eb lint :all-the-things: 2022-01-16 12:42:34 +08:00
Tienson Qin
aa0ce9a3b1 enhance: sync databases between multiple windows on Electron 2021-12-29 15:59:57 +08:00
Tienson Qin
40db76e034 fix: ci 2021-12-21 23:05:28 +08:00
Tienson Qin
6fb7121397 feat: multiple windows support 2021-12-21 23:05:28 +08:00
Tienson Qin
77ce2d8eaa fix: empty block not deleted when there's new file detected from
the disk.

close #3387
2021-12-09 12:15:02 +08:00
leizhe
08b4451d55 fix https://github.com/logseq/logseq/issues/3221 2021-11-22 13:58:28 +08:00
leizhe
b0b4edc7a6 enhance: update pages if nested reference exists in page name 2021-11-12 11:41:08 +08:00
Tienson Qin
ce511e1b84 enhance: add alerts before both refresh and re-index 2021-09-07 23:23:07 +08:00
Tienson Qin
f6bbac0d29 fix: block reference count doesn't work properly
close #2467
2021-07-30 16:22:23 +08:00
Tienson Qin
1581e473c0 refactor: remove markdown migration 2021-07-28 14:47:48 +08:00
Tienson Qin
4e09dc2d52 enhance: publishing
also, hide built-in pages in "All Pages"
2021-07-11 21:43:37 +08:00
Tienson Qin
5a41300e80 Graph revamp (#2372)
Graph revamp
2021-07-06 23:48:58 +08:00
rcmerci
e3e4f55efa fix: check ast-version after restore-and-setup! 2021-07-06 23:07:01 +08:00
rcmerci
d58dd4d88d enhance: add notification for ast-version
- :ast-version < db-schema/ast-version
- :ast-version is nil
2021-07-02 17:40:05 +08:00