4080 Commits

Author SHA1 Message Date
megayu
a3837bc654 clean redundant class extends (#12735)
* fix(outliner): clean redundant class extends

* perf(outliner): query redundant extends cleanup directly

* fix(log): improve function signatures for clarity

* fix(outliner): handle lookup-ref vectors in class extends normalization

* fix lint

* fix(outliner): clean redundant class extends

---------

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
2026-05-28 14:29:05 +08:00
Tienson Qin
e25a41abd7 fix: export scalar property values 2026-05-27 18:30:51 +08:00
Tienson Qin
cbf160656e fix: edn export 2026-05-27 08:23:17 +08:00
Tienson Qin
ae2ba48c81 enhance: improve gallery view (#12698)
* enhance: improve gallery view

* fix: tune gallery card sizing

* fix: load gallery asset properties initially

* chore: cleanup code

* fix: gallery view should load block fully

* fix: align gallery card media

* fix: render asset class gallery cards

* fix: align gallery images with header

* fix: fit gallery images to card width

* fix: polish gallery view actions

* fix: improve gallery view behavior

* fix: guard gallery asset loading

* fix: hide asset placeholders while loading

* fix: clean up gallery view loading

* fix: improve gallery selection actions

* fix: clean up gallery selection state

* fix: improve grouped gallery view
2026-05-25 18:28:10 +08:00
rcmerci
3922e5df24 fix: avoid shadowing cat in outliner test 2026-05-25 14:48:59 +08:00
rcmerci
c8ab870a68 fix: add Task tag when setting status 2026-05-25 14:34:09 +08:00
Tienson Qin
2efa164717 fix: repair comment thread metadata 2026-05-25 11:54:56 +08:00
Gabriel Horner
1e2848e824 fix(build-edn): property with alias fails to build alias
Caught with `bb dev:cli export-edn --roundtrip` on a graph with this
use case
2026-05-24 01:06:36 -04:00
Tienson Qin
aae14bb007 fix: allow moving comments block as sibling 2026-05-22 23:27:53 +08:00
rcmerci
9f3d6c79b8 fix lint 2026-05-22 21:07:43 +08:00
rcmerci
d1e4c3a077 fix: create-graph bootstrap 2026-05-22 17:47:37 +08:00
rcmerci
aeeb32935b fix: :logseq.property/assignee definition 2026-05-22 17:19:22 +08:00
rcmerci
5efb86793a enhance: update :logseq.property/assignee definition 2026-05-22 17:12:52 +08:00
rcmerci
a2a1381817 fix lint 2026-05-22 17:00:36 +08:00
rcmerci
203ca43ffb fix: agent bridge and logging 2026-05-22 15:56:19 +08:00
rcmerci
73fccfb0a9 enhance: update :logseq.property.agent/session-id 2026-05-22 15:56:19 +08:00
rcmerci
5688b40786 fix: issues found by logseq-review-workflow 2026-05-22 15:56:19 +08:00
rcmerci
07c5aa95df enhance(skill): update logseq-review-workflow 2026-05-22 15:56:19 +08:00
rcmerci
507a39fff4 feat(cli): agent bridge 2026-05-22 15:56:18 +08:00
megayu
b3c200206d Enforce strict page alias ownership and improve alias search (#12662)
* feat(search): add support for page aliases in search results

* enhance(alias): enforce strict alias ownership invariants

* fix(exporter): streamline page extraction and alias sanitization

* fix(search): add alias support to search result mapping

* fix(exporter): handle self-alias in page alias sanitization

* feat(outliner): enhance alias handling in set-block-db-attribute!

* fix(outliner): remove redundant db reference in set-block-property

* fix(search): keep canonical page title for alias-indexed results

* feat(property): enhance alias handling for source page identification

* feat(search): improve alias handling for snippet display in search results

* fix: correct alias assignment in block processing

* feat: add validation for batch alias assignment to prevent multiple owners

---------

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
2026-05-21 21:04:48 +08:00
Tienson Qin
ec0c01fd97 enhance: use graph identity in URLs (#12693)
* enhance: use graph identity in URLs

* fix: resolve graph identity URLs

* fix: satisfy graph url lint

* fix: resolve graph id from hash urls

* fix: preserve tab graph on reload

* fix: initialize tab graph before render

* enhance: open graph in another tab

* fix: open graph tabs by graph id

* fix: open local graph tabs by registry id

* fix: avoid duplicate rtc graph id

* fix: open electron graph window on shift click

* fix: address graph identity review
2026-05-21 14:52:28 +08:00
Tienson Qin
0a28fb40ce fix: share block unique title for search (#12695) 2026-05-21 13:07:19 +08:00
megayu
d130d72579 Fix external asset rendering and journal import namespace handling (#12673)
* fix render external asset fail

* fix: handle nil stat in exteranal asset size calculation

* fix: normalize journal UUIDs and prevent namespace creation for slash-formatted journals

* fix: update journal UUID generation and prevent namespace creation for slash-formatted journals

* fix(import): avoid namespace pages for slash journal refs

* fix: clarify journal uuid option docs

Agent-Logs-Url: https://github.com/logseq/logseq/sessions/d8292bbe-fc6f-4c74-91cd-5705571a89b2

Co-authored-by: tiensonqin <479169+tiensonqin@users.noreply.github.com>

---------

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: tiensonqin <479169+tiensonqin@users.noreply.github.com>
2026-05-21 12:04:02 +08:00
Tienson Qin
f791ecc45b publish style tweaks 2026-05-20 18:16:59 +08:00
Tienson Qin
bb04428527 update publish version 2026-05-20 18:05:40 +08:00
Tienson Qin
22609130c4 fix: undo lost created-by 2026-05-20 03:06:00 +08:00
Tienson Qin
8e48079bfb fix: comment issues 2026-05-20 02:33:06 +08:00
Tienson Qin
29854b9708 enhance: tag comment blocks 2026-05-19 22:08:02 +08:00
Tienson Qin
4afc96114e chore: remove :block/content usage from publish worker 2026-05-19 20:57:08 +08:00
Tienson Qin
0e87a830a4 feat: comments (#12672)
* feat: comments

* comments ux enhancements

* fix: skip comments during cursor navigation

* enhance: support comments on selected blocks

* fix: store comment range targets by uuid

* fix: delete orphaned range comments

* fix: navigate across comments blocks

* refactor: move comments to its own namespaces

* fix lint and tests

* fix: polish block comments

* enhance: add related property to #Comments

* fix: align comments migration test

* fix: non logged in user can't edit or delete comment

* fix: keep comments in place on outdent

* enhance: put comments at top of page

* fix: remove empty comments area

* refactor: split move blocks transaction
2026-05-19 20:04:30 +08:00
Gabriel Horner
6af3934dd3 enhance: export-edn exports ::sqlite-export/graph-files
in an idempotent/roundtrippable way
2026-05-17 01:55:56 -04:00
Gabriel Horner
c89c7eaacc fix: build-edn fails to export :build/class-properties that roundtrip
When running `bb dev:cli export-edn --roundtrip` on a graph with
included test, :build/class-properties sort order kept changing
because built-in properties order is lost on export
2026-05-17 01:26:45 -04:00
rcmerci
ebb227851d Merge pull request #12650 from logseq/fix/residual-property-value
fix: block property values deletion
2026-05-14 23:34:40 +08:00
rcmerci
5afaf32378 fix: reparent closed values on conversion 2026-05-14 22:39:54 +08:00
A. S.
ce61af1483 feat: add :asset property type with thumbnail picker (#12506)
* feat(property): add :asset property type with thumbnail grid picker

Introduces a new user-facing "Asset" property type, modeled on :node but
restricted to blocks tagged with :logseq.class/Asset. Unlike :node's text
search dropdown, the :asset picker opens a 4-column thumbnail grid popup
populated from db-async/<get-tag-objects, filtered to image assets via
common-config/img-formats.

Once a value is set, the property cell renders an inline asset-cp preview
alongside "View" and "Swap" action buttons. View dispatches a new
:asset/show-preview event that opens the image lightbox for images, the
PDF viewer for PDFs (same path as the inline open-pdf-file handler), and
falls back to redirect-to-page! for other asset types. Swap reopens the
grid popup so the user can pick a different asset.

- Register :asset in user-built-in-property-types, user-ref-property-types,
  and property-types-with-db; add asset-entity? validator that requires
  :block/title and :logseq.class/Asset in :block/tags.
- Label the type as "Asset" in property-type-label so it appears in the
  property type sub-pane.
- Add asset-grid-popup-content and asset-value-picker components in
  property/value.cljs, dispatch :asset ahead of the generic select branch
  in property-scalar-value-aux, and include :asset in the reference
  display set used by select-item.
- Wire :asset/show-preview in handler/events/ui.cljs using the existing
  lightbox, pdf-assets, and assets-handler plumbing.

* fix(property): refresh asset thumbnail after Swap

asset-cp captures the asset block in :will-mount, so React reconciling
the same component in place across re-renders left the old thumbnail
rendered even though the underlying property value had been updated
(visible because the View button opened the newly chosen asset).

Keying asset-cp on (:block/uuid value) forces React to remount it on
swap so :will-mount re-runs with the new block.

* fix(property): let image clicks select the asset in picker grid

asset-cp renders an <img> with its own click handler that opens the
image preview lightbox, which swallowed clicks before they could reach
the grid cell's select-this-asset handler. Users had to click the
padding around an image to pick it. Disabling pointer events on the
thumbnail wrapper lets the click bubble straight to the parent button.

* fix(property): fit asset thumbnails without cropping any aspect ratio

asset-cp emits the <img> with explicit width/height attributes (default
250px) wrapped in a div.asset-container that has no size constraint of
its own, so neither square nor tall images respected the thumbnail
bounding box: max-h-full on the img resolved against an auto-sized
parent and tall images overflowed the property row.

Constrain every descendant with !important max-w-full / max-h-full and
force the img to w-auto h-auto object-contain, and give the block
property thumbnail a fixed 80x80 bounding box instead of the previous
120x80 max that let the asset-container stretch. Same override is
applied to grid picker cells so they stay uniform regardless of source
aspect ratio.

* fix(property): stop tall images cropping in asset picker grid

The previous fix applied max-w/max-h-full to all descendants, but
div.asset-container's own height stayed auto, so max-height: 100% on
the img resolved against an auto-sized parent and tall images still
overflowed their grid cell.

Force div.asset-container itself to w-full h-full (and flex-center) so
the img's max-h-full resolves against a real bounded height. Same fix
is applied to the block property thumbnail for consistency.

* feat(property): show all asset types in picker grid with title bar

Drop the image-only filter so the asset picker grid lists every block
tagged :logseq.class/Asset, not just images. Non-image assets render as
a centered tabler icon + uppercase extension label chosen by a new
asset-icon-for-type helper (photo / music / movie / file-type-pdf /
file fallback); image assets keep the existing asset-cp thumbnail.

Each grid cell is now a vertical flex with a small title strip at the
top showing :block/title (truncated) and the thumbnail body filling
the rest of the square. min-height: 0 on the body lets the flex child
shrink inside the aspect-ratio box so square images still fit without
pushing the title off screen.

* feat(property): skip image sizing constraints for non-image asset values

The filled asset-value-picker used to force every asset-cp render into
a fixed 80x80 box with img overrides meant for bitmap thumbnails. That
mangled PDF link icons, audio <audio> controls and video <video>
players because those elements have their own intrinsic layout.

Branch on (:logseq.property.asset/type value): image assets keep the
80x80 constrained box so square/tall/wide bitmaps still fit without
cropping, while every other asset type renders asset-cp in a plain
flex-shrink-0 wrapper at its natural size.

* feat(property): preview video assets in a modal instead of inline

Inline asset-cp for videos rendered a full <video> player in the
property row, which was oversized and awkward next to the View/Swap
buttons. Replace it with a compact shui button showing a movie icon
plus the truncated asset title; clicking the button dispatches the
existing :asset/show-preview event.

The :asset/show-preview handler grows a video branch that resolves the
asset URL via <make-asset-url and opens a centered shui dialog with an
autoplaying <video controls>, capped at 80vh so it never exceeds the
viewport. Image lightbox and PDF viewer paths are untouched.

* refactor(property): drop redundant View button on asset property values

Every asset type already has a native click-to-preview path: image
thumbnails open the lightbox via resizable-image's handler, PDF links
open the PDF viewer via asset-link, audio/video players are clickable
in place, and the video-asset fallback button itself dispatches
:asset/show-preview. The separate View button just duplicated those
actions, so remove it and leave only Swap next to the thumbnail.

* fix(property): let video asset button grow to fit title

The video preview button capped itself at max-w-[240px] with a
truncated title span, cropping any video whose name was longer than
the cap. Drop the cap and truncation so the button sizes to its
content, and add h-auto whitespace-normal text-left so titles that
wrap onto multiple lines stay visible instead of being clipped by
shui's fixed button height.

* refactor(property): review cleanups for :asset property type

Addresses review feedback from the branch self-review:

- Extract the asset-cp-fit CSS escape hatch into an asset-thumb-fit-class
  def with a docstring explaining why .asset-container needs forced
  sizing, and reuse it in both the grid cell and the filled-state
  thumbnail instead of duplicating the 60-char tailwind arbitrary
  variant soup in two places.
- Simplify the two-clause cond in asset-value-picker's filled branch
  to an if now that the :else is the only fallthrough.
- Wrap set-block-property! in the grid picker on-click with p/catch so
  transact failures log and surface a notification toast instead of
  being silently swallowed after the popup hides.
- Replace the bespoke :content-props {:class "max-w-[min(90vw,1200px)]"}
  on the video preview dialog with shui's supported :auto-width? true
  option, which applies max-w-[90vw] w-max sm:max-w-[960px] via the
  data-auto-width CSS hook.
- Add a new logseq.db.frontend.property.type-test ns covering both the
  :asset property type registration (present in user-built-in /
  user-ref / all-ref / property-types-with-db, absent from
  cardinality / closed-value) and the asset-entity? validator against
  a real datascript db built via db-test/create-conn-with-blocks.
- Add a comment above asset-entity? documenting that :logseq.class/Asset
  lives in ldb/private-tags, so the class is used programmatically for
  scoping rather than via #Asset inline tagging.

* fix(property): satisfy CI lint checks for :asset property type

Address two lint failures on PR #12506:

- Drop the unused datascript.core require in property/type_test.cljs
  (clj-kondo unused-namespace warning failed the deps/db lint job).
- Replace four hardcoded user-facing strings in the asset grid picker
  with i18n keys, adding :asset/picker-empty, :asset/picker-fallback-type,
  and :asset/picker-set-failed to the English dictionary; reuse
  :ui/loading for the loading state.

* fix(property): address upstream review on :asset property type

Two follow-ups from the copilot-pull-request-reviewer review on PR #12506:

- Guard :asset picker against edits in publishing mode. show-grid!
  short-circuits when config/publishing? is true so the empty-state click
  and the Swap button can no longer open the picker, and the
  Backspace/Delete branch of the keydown handler no longer fires
  delete-block-property! Mirrors how single-value-select gates its
  popup. Read-only paths (image lightbox, video preview dialog) are
  left intact so published readers can still view embedded assets.

- Localize the Swap button label. Adds :asset/swap "Swap" to en.edn
  and replaces the hard-coded literal with (t :asset/swap), matching
  the other strings in asset-value-picker (picker-empty,
  picker-set-failed, picker-fallback-type).

* fix(property): use letter-a icon for :asset property type

Without an entry in property-icon's case form, :asset properties fell
through to the default "letter-t" glyph, which collides visually with
the Text type. Map :asset to "letter-a" so the column header reads as
"A".

* fix: improve asset property picker

---------

Co-authored-by: Victor239 <12621257+Victor239@users.noreply.github.com>
Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
2026-05-14 22:00:00 +08:00
rcmerci
fc51c77765 fix: prevent partial property value writes 2026-05-14 21:12:56 +08:00
rcmerci
4e6b9a2225 fix: block property values deletion 2026-05-14 20:14:15 +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
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