Commit Graph

4051 Commits

Author SHA1 Message Date
Mega Yu
f8dcaed826 Merge branch 'master' into fix/table-render 2026-05-14 21:27:59 +08:00
Mega Yu
1ce19817d5 add markdown table test 2026-05-14 21:26:41 +08:00
Mega Yu
f134dea06a fix: update table column group logic to use header column count 2026-05-14 21:26:13 +08:00
Mega Yu
cbbe6830e9 fix: improve markdown table row parsing by refining line trimming logic 2026-05-14 21:23:18 +08:00
Mega Yu
a4497a39c7 fix: handle end-idx check in inline macro parsing 2026-05-14 21:22:26 +08:00
Mega Yu
4807578d35 fix: return empty vector for blank input in inline JSON parser 2026-05-14 21:22:08 +08:00
Mega Yu
c09944870e refactor(mldoc): enhance inline parsing to preserve cell content on failure 2026-05-14 21:02:39 +08:00
megayu
e286370c36 Fix Windows file URL opening for block links (#12646)
* fix: preserve Windows file URL handling in path functions

* fix: improve file path handling for Windows file URLs

* fix: correct regex for Windows file URL handling

* improve file path compatibility
2026-05-14 19:13:07 +08:00
Mega Yu
ebb003e51c fix(graph-parser): normalize markdown table cells with escaped/code-span pipes 2026-05-14 18:22:16 +08:00
Cory Donnelly
2169a86f03 fix: honor documented repeater cookie semantics (#12523)
* fix: honor the three documented repeater cookie semantics

Logseq's documented repeater semantics (per docs.logseq.com and
`logseq/docs` `Tasks.md`) define three org-mode-style cookies for
recurring tasks:

  `.+`: repeats from the last completion date
  `++`: advances from scheduled, skipping in whole intervals to future
  `+`:  advances from scheduled by the declared interval (can stack)

The scheduler in `worker/commands.cljs` has been ignoring the cookie
entirely and applying a single, `++`-like semantic for every
recurring task. A user who wrote `.+1w` in markdown — expecting "a
week from when I actually finished" — silently got `++1w` behavior
("a week from the original scheduled date, skipped to future"),
which for a weekly task scheduled 2026-04-01 and completed on
2026-04-05 returns the next occurrence on 2026-04-08 rather than
the documented 2026-04-12.

This change:

  * Adds a closed-values `:logseq.property.repeat/repeat-type` property
    with values `:dotted-plus` / `:plus` / `:double-plus`. Default is
    `:double-plus` so existing recurring tasks see no behavior change
    on upgrade.
  * Rewrites the scheduler to branch on repeat-type and implement each
    semantic: `.+` anchors on now; `+` advances from original once (can
    stack overdue, per org-mode); `++` iterates in whole intervals
    until strictly after now. The `++` path is mathematically
    equivalent to the previous scheduler, so default-path behavior is
    preserved.
  * Guards against frequency <= 0 — the old code would silently produce
    nonsense and, under the new `++` loop, would spin forever. The
    guard short-circuits to `nil`.
  * Extracts `resolve-recur-frequency` and fixes the previous
    `(or [A B] [C D])` pattern in `compute-reschedule-property-tx` —
    any 2-vector is truthy in Clojure, so the default-value branch
    was unreachable and entities without an explicit
    `:recur-frequency` silently fell through to `frequency = nil`.
    `if-let` makes both branches reachable so default-to-1 actually
    works at migration time.
  * Restores the cookie-type selector that was removed from the
    date-time popover in `0a5b88467` (Nov 2020) — in-code support for
    all three cookies has been present but not user-pickable for the
    last ~5.5 years.
  * Adds `docs/recurring-tasks.md` — a technical spec for contributors
    and users that restates and augments the upstream `Tasks.md` text,
    adds decision guidance, and documents the implementation surface.
  * Extends the file-graph → DB-graph migration (built on top of
    `44d6bd49c4` "fix: preserve repeated schedule import") to also
    carry the cookie kind via a new `repeat-types` map in
    `graph-parser/exporter.cljs`, so an imported `.+1w` task lands in
    the DB-graph with `:repeat-type.dotted-plus` rather than picking
    up the `:double-plus` default. Test updated to assert this.
  * Adds deftests covering each cookie's distinctive behavior plus
    boundary cases (non-positive frequency, unknown unit, frequency > 1
    variants, `++` at month/year units, and both branches of
    `resolve-recur-frequency`).

The preexisting `get-next-time-test` passes unchanged under the
`:double-plus` default, preserving the existing regression contract.
Tests pin `t/now` via `with-redefs` for determinism.

Refs #7731, #11260, #6715, #8531. Folds in the small remaining delta
from #12532 (now closed as superseded by `44d6bd49c4`).

* fix: harden recurring task repeat type

* fix: contain repeat type selector

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix: handle clamped monthly repeats

---------

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-14 17:53:11 +08:00
yshalsager
f6e2ab9026 fix(publish): set dir auto for mixed rtl/ltr content 2026-05-14 16:29:02 +08:00
Tienson Qin
1bfc6a7aec Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-14 16:19:02 +08:00
Tienson Qin
127356d753 fix: keep published task bullets clear of status icons
fix https://github.com/logseq/db-test/issues/860
2026-05-14 16:19:02 +08:00
Tienson Qin
4fe42af3ed fix: preserve markdown tag link aliases 2026-05-14 14:52:08 +08:00
megayu
200a6da0d5 deprecated block-ref (#12627)
* feat(graph-parser): convert block-ref syntax to page-ref in titles

* feat(block): deprecate block-ref syntax

* feat(graph-parser): replace block-ref with page-ref in title processing

* fix lint

* chore(i18n): remove deprecated i18n key
2026-05-14 13:21:22 +08:00
megayu
e097ec8cd8 fix(fsrs): cloze macro with superscript/subscript markup and render improvements 2026-05-13 12:00:24 +08:00
Tienson Qin
562e56e4c5 fix: delete recycled node cleanup 2026-05-12 18:39:37 +08:00
Tienson Qin
9c77efda04 [codex] fix import of auto heading pre-blocks (#12612)
* fix(import): handle auto heading pre-blocks (db-test#863, db-test#864)

* fix(import): clean missing OG block refs (db-test#863, db-test#864)

* Revert "fix(import): handle auto heading pre-blocks (db-test#863, db-test#864)"

This reverts commit 08d586a2d8.

* fix(import): propagate missing block ref cleanup

---------

Co-authored-by: Mega Yu <yuhg2310@gmail.com>
2026-05-12 18:07:07 +08:00
ivan-danilov
7c4111b248 Added prettify-url? option to QuickCapture (#12409)
Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
2026-05-12 00:16:03 +08:00
IderAghbal
ba3ff5e5a5 feat: add support for avif and cr2 images (#11997) 2026-05-11 23:57:04 +08:00
Tienson Qin
f42da95204 fix: preserve imported task statuses 2026-05-11 20:42:53 +08:00
Tienson Qin
ee6b38b9d6 fix: import namespaced inline tags 2026-05-11 20:35:29 +08:00
Tienson Qin
44d6bd49c4 fix: preserve repeated schedule import 2026-05-11 20:16:19 +08:00
megayu
1884911cc8 fix(exporter): preserve mixed quote blocks during DB export (#12610) 2026-05-11 18:08:14 +08:00
Tienson Qin
1f9c017998 refactor: graph view V2 (#12604)
* feat(graph): rebuild global graph view with Pixi

Summary:

- Replace /graph route with a new Pixi-based global graph implementation in ClojureScript.

- Build graph data from db-worker only (no UI DB writeback) and default to tags+objects with a toggle for all pages.

- Add fast scene rendering for large graphs with indexed hit-testing, zoom/pan, node dragging, and click/shift+click node actions.

- Introduce dynamic label management (zoom hysteresis, viewport culling, overlap control, hover-emphasis) and fix hook lifecycle cleanup issues.

- Refresh graph UI styling to full-container layout, dot-first settings control, and Logseq button usage.

- Add/expand tests for global graph modes, node actions, and Pixi label/visibility logic.

- Update graph-related dependencies/lockfile as part of the new implementation.

* enhance(graph): improve drag exploration and label visibility

- Dragging a node now pulls connected nodes with depth-based weights for easier structure exploration.

- Labels are rendered only for currently visible node dots; hover no longer reveals hidden-node titles.

- Hovered node title remains promoted in foreground while respecting visibility constraints.

- Add logic/test coverage for connected drag weights and updated label text behavior.

* enhance(graph): use d3 force layout

Summary:
- Move Graph V2 node layout into graph pixi logic.
- Use d3-force link, charge, center, collision, and y forces instead of the hand-written ring/spiral layout.
- Add coverage that linked graph nodes settle closer than an unlinked island.

Dependency:
- Verified d3-force is already latest at 3.0.0.

Tests:
- bb dev:test -v frontend.extensions.graph-pixi-logic-test
- bb dev:test -v frontend.common.graph-view-v2-test
- pnpm install --frozen-lockfile --lockfile-only

* fix: graph view interactions

* enhance: speed up large graph view

* enhance: speed up tags graph

* enhance: speed up tags layout

* enhance: bound tags force layout

* enhance: speed up graph opening

* fix: keep graph objects visible when zoomed out

* fix: resize graph with sidebars

* enhance: select graph nodes

* fix: refine graph selection controls

* support icons

* fix: sharpen graph node icons

* enhance(graph): update graph v2 settings

* fix: re-render graph when theme changes

* enhance(graph): remove legacy graph view

* fix: typo

* fix: improve graph view

* test: cover graph view improvements

* enhance: improve graph view

* test: cover graph time travel behavior

* enhance: refine graph time travel

* test: cover graph layout controls

* enhance: add graph layout controls

* test: cover graph highlight controls

* fix: refine graph highlight controls

* test: cover edge label alignment

* fix: align graph edge labels

* test: keep graph lines visible on highlight

* fix: keep graph lines visible on highlight

* fix: show graph lines by default

* test: filter graph lines on highlight

* fix: filter graph lines on highlight

* test: keep graph depth incremental

* fix: update graph depth incrementally

* test: cover graph label link occlusion

* fix: occlude graph links behind labels

* test: cover graph edge visibility defaults

* fix: smooth graph edges on highlight

* test: cover graph arrow toggle

* fix: toggle graph arrows

* test: cover reciprocal graph edge offsets

* fix: separate reciprocal graph edges

* test: cover duplicate graph edge runs

* fix: dedupe graph edge render runs

* test: cover graph tag clusters

* enhance: cluster graph tags layout

* test: cover graph tag cluster colors

* fix: color graph tag clusters by title

* test: cover subdued graph node colors

* fix: mute graph node colors

* feat: grid layout

* add more options

* enhance(graph): drill into tags on zoom

* map-like navigation

* mod+click to preview node

* edge enhancements

* more tweaks

* fix: block preview

* enhance(graph): speed up large graph layout

* fix: improve graph mode switching ux

* fix: speed up graph view switching

* fix: optimize large all-pages graph render

* fix: speed up graph data build

* fix: collapse graph tag settings on mode switch

* enhance: refine graph panel width

* fix: improve graph zoom performance

* fix: satisfy graph lint

* fix: open graph nodes by uuid

---------

Co-authored-by: rcmerci <rcmerci@gmail.com>
2026-05-10 23:26:32 +08:00
Tienson Qin
cd1a9926e2 chore: remove outdated assert 2026-05-09 15:46:34 +08:00
Tienson Qin
05e8d0c435 fix: remove deleted property pairs from remote tx 2026-05-09 15:26:12 +08:00
Tienson Qin
8857be2baf fix: can't download graphs on Android 2026-05-09 11:44:44 +08:00
megayu
51f0ce261c Enhance breadcrumb display (#12595)
* feat(breadcrumb): enhance breadcrumb functionality and styling

* feat(breadcrumb): enhance breadcrumb label handling and add tooltips

* feat(breadcrumb): add tooltip for breadcrumb search overflow

* fix lint and test

* feat(search): enhance subtitle handling for native search results

* fix doc

* feat(breadcrumb): add accessibility attributes to tooltip button

* fix: no need to pull refs for block parents

* enhance(breadcrumb): remove ref-resolution layer from parent breadcrumbs

---------

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
2026-05-08 17:14:13 +08:00
VictorVow
1423a38062 fix: restore :ref/default-open-blocks-level 0 behavior in DB graphs
Make `:ref/default-open-blocks-level 0` collapse references by default
in the DB version, matching the previous file-graph behavior. The
section fold is scoped to the page-bottom "Linked References" panel
only — the inline "Open block references" popup rendered next to
blocks always shows its references uncollapsed.

1. Collapse the "Linked References" section when the configured level
   is 0, gated on a new `:linked-refs-section?` config flag set only
   by the page-bottom call site in page.cljs. The inline popup at
   block.cljs:3366 passes `{}` and is unaffected.

2. Propagate `:block.temp/has-children?` on the top-level fetched
   block in `get-block-and-children`. The list-view loads linked-
   reference blocks with `:children? false`, so `(:block/_parent ...)`
   is always nil in the client DB and the collapse check in
   `block-default-collapsed?` could never fire. Use a lightweight
   `d/datoms :avet :block/parent` scan that stops at the first match,
   rather than the reverse-ref `(:block/_parent block)` which
   materializes the full child set. Includes a regression test.

3. Fall back to `:block.temp/has-children?` when computing `has-child?`
   in `block-container-inner-aux`. This renders the collapse arrow for
   blocks whose children exist in the worker DB but haven't been
   lazily loaded into the client DB yet (e.g. linked-reference blocks).
   Clicking the arrow calls `expand-block!` which loads them.

The `:ref/default-open-blocks-level 0 → (int? ...)` state.cljs fix
from PR #12228 is already present on this branch.
2026-05-08 11:18:51 +08:00
Tienson Qin
427dbe3f58 feat: export Logseq markdown syntax
Move the Logseq Markdown Mirror syntax/export work out of the two-way sync branch while leaving file-to-DB sync behavior behind.

Details:\n- add docs/logseq-markdown-syntax.md and update ADR 0016 with the one-way mirror syntax contract\n- export mirror files with page id markers, property list items, nested default property values, node page refs, task status markers, and datetime values with time\n- preserve block refs as uuid links where needed while keeping page/node refs readable\n- update focused export and markdown mirror tests

Validation:\n- bb dev:lint-and-test
2026-05-08 10:58:45 +08:00
Tienson Qin
a256c65cbc fix: handle mirror file errors 2026-05-07 18:24:43 +08:00
Tienson Qin
fae97c8003 Merge branch 'master' into feat/markdown-mirror 2026-05-07 14:07:23 +08:00
charlie
66b1140fc9 feat(markdown): enhance markdown block formatting and handling for quotes, code, and headings 2026-05-07 13:54:51 +08:00
rcmerci
5301d39f07 fix(db-worker): compare repo-name failed sometimes because of db-version-prefix 2026-05-06 23:03:11 +08:00
rcmerci
a610925bca fix(export): ignore legacy-property 2026-05-06 21:03:23 +08:00
Tienson Qin
9189755b3a fix: update markdown mirror 2026-05-06 16:06:37 +08:00
Tienson Qin
06dbef8715 feat: add markdown mirror
Add markdown mirror generation for DB graphs, including page and journal paths, regeneration, debounced write handling, and settings UI.

Serialize page and block property values into mirrored Markdown by resolving property-value entities to their display content.

Persist mirror files through the node worker platform and make browser worker mirror storage fail fast as unsupported.

Fix Electron userAppCfgs writes to avoid returning unserializable Electron state over IPC.

Add ADR and targeted tests for mirror generation, worker wiring, platform storage, and graph path handling.
2026-05-06 16:06:37 +08:00
rcmerci
8a7ba2f665 fix(import): preserve emails in quote blocks 2026-05-05 21:13:39 +08:00
Tienson Qin
619be47fe2 add missing thread api tests for db core 2026-05-05 15:30:41 +08:00
Tienson Qin
13779a4047 fix: don't update local tx to 0 except for two cases
1. creating a remote graph
2. uploading a local graph
2026-05-05 13:35:45 +08:00
rcmerci
47407a3d8d fix(import): property value has custom format journal page ref 2026-05-05 12:46:41 +08:00
rcmerci
f5b122ddd5 enhance(cli): add --enable-sync to 'graph create' 2026-05-04 21:13:13 +08:00
rcmerci
137dd7fefd enhance: unify build-version 2026-05-04 12:31:54 +08:00
Tienson Qin
b8ebdd575c add server usage stats script (#12557)
* enhance(db-sync): add usage stats script

* fix(db-sync): use --local for local D1 scripts

* fix(db-sync): record activity only on successful sync requests

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-04 07:59:15 +08:00
Tienson Qin
3f78f3a3d2 chore: remove warning on path join with empty dir 2026-05-04 00:02:59 +08:00
Tienson Qin
c556ce27ed bump datascript 2026-05-03 12:52:27 +08:00
Tienson Qin
627cb619e1 fix: sqlite db backup on desktop 2026-05-03 12:04:22 +08:00
Tienson Qin
e470dfd5f0 fix: remove legacy properties 2026-05-03 11:19:05 +08:00
Tienson Qin
9cfbaf80dc fix: normalize copy/paste export property data
- prefer memory-backed copied blocks before async clipboard read fallback in paste flow
- normalize clipboard write payload construction for web ClipboardItem
- render exported property keys with property titles instead of db ident suffixes
- render datetime property integer values as journal titles using export date formatter
- add regression tests for paste and export property rendering
2026-05-01 00:15:32 +08:00