Commit Graph

114 Commits

Author SHA1 Message Date
Tienson Qin
eb6e5942f8 fix: lint warnings 2024-01-10 01:34:15 +08:00
Tienson Qin
38ba0dfa7c Move entity plus to db dep 2024-01-08 15:35:09 +08:00
Tienson Qin
46cb78f934 fix: file writes check 2023-12-28 20:56:39 +08:00
Tienson Qin
61bdbcab7e fix: refresh order 2023-12-26 23:00:48 +08:00
Tienson Qin
260ad89937 wip: move pipeline to worker 2023-12-26 22:00:21 +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
Tienson Qin
3bae1cae12 fix: a non-journal home page is empty on initial graph load
FIXES LOG-2813
2023-12-05 13:57:05 +08:00
Tienson Qin
fb9e1057fa chore: remove react/db-graph? 2023-12-05 01:29:05 +08:00
Tienson Qin
7dfbecb3e2 fix: query state should never be cleared for db graphs 2023-12-05 01:16:55 +08:00
Tienson Qin
00b11d6cb0 Add db-based model tests 2023-12-04 20:07:52 +08:00
Tienson Qin
769b541790 enhance: batch refresh! when apply remote ops (#10545) 2023-11-24 18:16:59 +08:00
Tienson Qin
cb7bcb3816 fix: a non-journal home page is empty on initial graph load
Fixes LOG-2813
2023-11-21 11:26:48 +08:00
Tienson Qin
bb5762df62 fix: uuid based property values appear blank on initial graph load
Fixes LOG-2909
2023-11-21 10:48:09 +08:00
Tienson Qin
ee3442a44b Merge branch 'master' into feat/db 2023-11-14 20:40:36 +08:00
Tienson Qin
1ad81121c9 fix: UI doesn't show new blocks after starting the app
The reason is that the reactive query state for the first page has
been cleared.
2023-10-18 23:25:38 +08:00
Tienson Qin
33f8a24397 perf enhancement
1. add :block/tx-id to check whether block has been updated
2. avoid rendering blocks if they're not updated
2023-09-04 14:15:46 +08:00
Ben Yorke
24006b3d82 updates 2023-08-25 15:54:00 +02:00
Tienson Qin
4bf8ba2091 fix: can't create child block after refresh 2023-08-16 15:51:59 +08:00
Tienson Qin
cc769225f9 fix: property date type UX 2023-07-03 17:53:23 +08:00
Tienson Qin
c81e114a1c fix: lint 2023-06-28 15:20:22 +08:00
Tienson Qin
41ef67829b chore: clean code 2023-06-28 13:09:07 +08:00
Tienson Qin
fd6b587235 Merge branch 'master' into feat/db 2023-06-21 14:09:16 +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
Tienson Qin
ed3b063575 perf: using :block/_parent instead of blocks->vec-tree 2023-06-06 02:00:45 +08:00
Tienson Qin
e7dae7728a fix: paginated blocks 2023-06-05 16:45:14 +08:00
rcmerci
628a8b3826 use atom to replace some high frequency used state vars 2023-06-01 00:14:52 +08:00
Tienson Qin
df11ccc17a db wip 2023-05-22 13:01:55 +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
Tienson Qin
f8178bcd9b fix: lazy loading shakes (#9139)
* fix: lazy loading shakes

Also, enable lazy loading on mobile

* enhance(perf): lazy load deadlines and scheduled

* enhance(perf): clean up queries when components are invisible

For queries including both ::ref and ::block.
2023-04-24 18:29:19 +08:00
Tienson Qin
b17c4ea37e enhance: show custom title instead of live query for custom queries (#9026)
* enhance(ui): replace live query with custom title if exists

also moved query related components to frontend.components.query

* fix: simplify query components' state
2023-04-12 11:12:05 +08: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
Tienson Qin
0e365508be fix: wrong usage of :frontend.db.react/refs
Previously, `[:frontend.db.react/refs id]` is used for three places:
1. get-page-referenced-blocks
2. get-block-referenced-blocks
3. get-block-references-count

The cached query atom will be shared between those three functions,
the problem is that both queries in `get-page-referenced-blocks` and
`get-block-referenced-blocks` return data of different formats, which
can result in crashes in some situations (e.g. PR #8423).

This commit removed `get-block-references-count` and use
`model/pull-block` and `(count (:block/_refs block))` instead.

We also need to make sure the `id` in `[:frontend.db.react/refs id]`
will be different for `get-page-referenced-blocks` and
`get-block-referenced-blocks`. We can probably get rid of
`get-page-referenced-blocks` once we refactored both linked references
and filters for pages.
2023-02-21 23:49:25 +08:00
Tienson Qin
3e71b1d6f3 fix: db/entity with interger id is not nil with non-exist block (#7723)
fix: returns nil for db/entity if the entity doesn't exist

Co-authored-by: Junyi Du <junyidu.cn@gmail.com>
2022-12-16 00:21:42 +08:00
Junyi Du
5ee8707469 chore: merge function util/with-time and util/with-time-number 2022-12-15 20:37:17 +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
814e26468a perf: don't refresh ::refs if the editing is inside current page 2022-08-22 17:08:53 +08:00
Tienson Qin
3d5825330e wip: fix wrong refs and filters 2022-08-22 17:08:53 +08:00
Tienson Qin
1fefe92433 fix: query refresh button 2022-08-15 21:58:46 +08:00
Tienson Qin
e5532bfe7e fix: move blocks up/down can still affect path refs 2022-08-15 21:58:46 +08:00
Tienson Qin
08ba4348b9 fix: lint warnings 2022-08-15 21:58:46 +08:00
Tienson Qin
21603f9d1d fix: distinct blocks when sort by left 2022-08-15 21:58:46 +08:00
Tienson Qin
6e87aa9386 perf: don't refresh all paginated blocks queries 2022-08-15 21:58:46 +08:00
Tienson Qin
6bbbccd942 fix: a react component might have multiple reactive queries 2022-08-15 21:58:46 +08:00
Tienson Qin
fd5f3b4f60 perf: refs reactive query 2022-08-15 21:58:46 +08:00
Tienson Qin
d6abc839ec fix: performance degradation for 0.8.0 2022-08-15 21:58:46 +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
56b2405762 fix: Long pages got cut off when toggle on/off a nested bullet
close #5422
2022-07-20 13:56:04 +08:00
Tienson Qin
b7025b9ce4 fix: undo/redo paginations 2022-07-20 13:56:04 +08:00
Tienson Qin
d40c0d8926 fix: WIP broken undo/redo for long page 2022-07-20 13:56:04 +08: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