logseq / logseq/logseq

Enhancement request: Add close timestamp for TODO lists, org-mode style

Open
#5,825 2 comments 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

:type/enhancement format:org-mode logbook query
Dominant language
Clojure
Stars
45k
Forks
2.8k
Avg merge
1d 22h
Merged PRs (30d)
105

Description

Currently, querying on LOGBOOK entries is not possible with logseq. However, a basic use-case of querying for recently closed todo items seems to need much less effort than adding the full LOGBOOK support.

I propose to copy the behavior of org-mode, where once a TODO block is marked as completed, a new CLOSED: [2022-06-24 Fri 10:47] will appear at the block level (similar to DEADLINE and SCHEDULE). This could then get reflected in the schema similarly to https://github.com/logseq/logseq/blob/b43ca96e0a74824b3754a0ef11de17daddb9448f/deps/db/src/logseq/db/schema.cljs#L65-L69

If a todo block gets "undone", that line can simply be removed.

This should enable querying on a closed todo item extremely easy to do.

See discord discussion with @cnrpman

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with deps/db/src/logseq/db/schema.cljs, the schema location linked in the issue, and trace how TODO completion and queries are represented. Done means completed TODO blocks expose a CLOSED timestamp for querying and removing the completion removes that timestamp.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.