Commit Graph

379 Commits

Author SHA1 Message Date
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
Tienson Qin
9318205c32 fix: improve graph view interactions 2026-05-13 21:38:19 +08:00
rcmerci
3f5b52cc07 feat(cli): unify backup impl for desktop and cli 2026-05-13 16:27:00 +08:00
rcmerci
d12beff383 feat(graph-view): add task zoom-in view 2026-05-13 13:40:55 +08:00
rcmerci
a3e4d8a902 feat(cli): add qmd query (4) 2026-05-10 15:48:26 +08:00
rcmerci
5ec5b258c9 feat(cli): add qmd query (2) 2026-05-10 14:53:55 +08:00
rcmerci
635d4b7a73 feat(cli): add qmd query (1) 2026-05-10 14:53:55 +08:00
rcmerci
9288c1de7e enhance: markdown-mirror blocks embed id in comment 2026-05-10 14:53:54 +08:00
rcmerci
314c68cd9a enhance(cli): warn about outdated installed skill 2026-05-09 10:42:37 +08:00
rcmerci
319d07a2e5 enhance(cli): show --page-hierarchy 2026-05-08 21:36:22 +08:00
rcmerci
9aa73a1976 enhance(cli): show --page library 2026-05-08 20:40:03 +08:00
rcmerci
08a479f2c8 feat(cli): add cmd 'sync asset download' 2026-05-08 15:23:36 +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
8bc8c435ba Merge branch 'master' into feat/markdown-mirror 2026-05-06 20:47:32 +08:00
rcmerci
c6d21e2006 fix(db-worker): protect db-worker server-list writes 2026-05-06 20:37:38 +08:00
Tienson Qin
1ed14885cd doc: move old adr to archive 2026-05-06 17:57:40 +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
7a731c6044 enhance(cli): render block/link in show 2026-05-06 15:29:01 +08:00
rcmerci
ebb0732f45 dev: remove ns logseq.cli.integration-test 2026-05-04 21:54:47 +08:00
rcmerci
f5b122ddd5 enhance(cli): add --enable-sync to 'graph create' 2026-05-04 21:13:13 +08:00
rcmerci
7488b92407 fix: switch graph if db-worker-node server unreachable 2026-05-04 14:07:03 +08:00
rcmerci
2f0a4f37e5 enhance(db-worker-node): restart server on version mismatch 2026-05-04 10:36:20 +08:00
rcmerci
7b68c57056 enhance(cli): add options in export cmd 2026-05-03 20:01:16 +08:00
rcmerci
1d027cba3a fix(cli): cli block-ref rendering 2026-05-01 22:43:50 +08:00
rcmerci
94c942bf7c enhance(cli): limit list cmds table output to at most 3 lines 2026-05-01 18:12:46 +08:00
rcmerci
5dd041b83e doc: update 001-logseq-cli.md 2026-04-30 20:35:22 +08:00
rcmerci
559ee28a32 doc: merge logseq-cli related docs 2026-04-30 20:35:22 +08:00
Tienson Qin
e750c79e34 chore: remove unused node persist-db impl 2026-04-30 01:01:17 +08:00
rcmerci
eca0ab1a36 Merge remote-tracking branch 'origin/master' into feat/cliable 2026-04-28 18:17:17 +08:00
megayu
79c25837cb Migrate from yarn to pnpm (#12529)
* migrate yarn to pnpm

* chore: update pnpm version to 10.33.0 across all package.json files

* chore: update .npmrc and package.json for improved dependency management

* chore: unify Clojure, Node, and Java version in workflow files

* fix: enable shamefully-hoist for now and add electron, keytar to onlyBuiltDependencies

* feat: add cider/piggieback dependency and update nREPL middleware configuration to silence warnings

* ensure pnpm setup prior to node setup

* fix: update logseq/bb-tasks git SHA

* feat: add pnpm configuration for onlyBuiltDependencies in package.json

* feat: add onlyBuiltDependencies configuration for better-sqlite3 in pnpm settings

* chore: update pnpm lockfile

* fix: resolve merge conflicts

* fix: remove invisible characters from markdown headers

* fix: update .npmrc comments for clarity on lockfile usage

* Revert "feat: add cider/piggieback dependency and update nREPL middleware configuration to silence warnings"

This reverts commit 70a111936f.

* fix: remove invisible characters from various README files and add .editorconfig

* fix: clarify lockfile resolution process in SKILL.md

---------

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
2026-04-24 23:40:25 +08:00
rcmerci
f751f27a63 refactor(cli): remove --data-dir, add --root-dir
--data-dir: ~/logseq/graphs
--root-dir: ~/logseq

All other configuration files and data directories are derived from the root-dir
2026-04-24 22:35:00 +08:00
rcmerci
aee05aa5d4 enhance(cli): default list order to desc 2026-04-24 15:00:33 +08:00
Tienson Qin
e048996880 Merge branch 'master' into feat/cliable 2026-04-22 21:07:00 +08:00
megayu
6df9d43c26 update logseq-i18n-lint (#12527)
* chore: update logseq-i18n-lint binaries to 5cb43a2cc559

* chore: update PR creation to use default branch and repo owner variables

* feat(i18n): add check for missing translations in validation process

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-04-21 11:11:37 +08:00
Gabriel Horner
82dfda0355 enhance(cli): Add more docs for cli.edn
Especially custom queries and env vars
2026-04-20 21:30:11 -04:00
Mega Yu
59e599ec9f refactor(i18n): refine naming standard and skill, sync review/dev workflow, and align related keys 2026-04-18 16:55:00 +08:00
rcmerci
4b13d67a88 Merge remote-tracking branch 'origin/master' into feat/cliable 2026-04-18 10:25:32 +08:00
Mega Yu
007e80d74d enhance(lang): update translation summary to include untranslated count 2026-04-17 11:11:30 +08:00
rcmerci
1f2eac1adc enhance(cli): breadcrumb in show 2026-04-16 21:51:01 +08:00
Mega Yu
81b42a8249 enhance(i18n): add translation summary stats and sorting functions 2026-04-16 16:03:42 +08:00
Mega Yu
a4644a2699 update contributing to translations md about bb lang:pseudo 2026-04-16 11:12:46 +08:00
Mega Yu
ed4aa26c05 add logseq-i18n skill and polish docs 2026-04-15 22:14:06 +08:00
rcmerci
1db53d14fb enhance(cli): humanize human-mode output formatting 2026-04-12 21:24:01 +08:00
rcmerci
1ae912fd92 feat(cli): add list/upsert asset 2026-04-11 17:31:49 +08:00
rcmerci
94be3a0bbb enhance(cli): remove 'server status'; add 'server cleanup' 2026-04-10 23:07:04 +08:00
rcmerci
9bac1ae4dd feat(cli): add skill show/install 2026-04-10 11:38:42 +08:00
Tienson Qin
bbe75823c0 add ADR to store client ops in sqlite tables 2026-04-10 04:39:17 +08:00
Tienson Qin
1cb3158208 enhance(db-sync): harden server tx batch handling and protocol 2026-04-09 03:27:41 +08:00
rcmerci
d36dfc9947 enhance(cli): options cleanup in task cmds 2026-04-08 17:51:17 +08:00