Commit Graph

17706 Commits

Author SHA1 Message Date
rcmerci
35e335178e Coerce CLI content options to string 2026-05-14 23:27:17 +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
Victor239
c37386e393 fix: firefox paste 2026-05-14 19:28:28 +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
Mega Yu
a20939292f fix: preserve resized network image width 2026-05-14 16:27:16 +08:00
Mega Yu
c84e7de0fb fix: preserve spaces between refs in headings 2026-05-14 16:25:20 +08:00
Tienson Qin
e97cc497f3 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-14 14:52:08 +08:00
rcmerci
37789780cd fix: preserve block refs when merging hashtag link refs
Handle both map refs and lookup vector refs when deduping block refs.
Add regression coverage for multiple block refs in wrap-parse-block
2026-05-14 14:52:08 +08:00
Tienson Qin
4fe42af3ed fix: preserve markdown tag link aliases 2026-05-14 14:52:08 +08:00
Tienson Qin
03adb8c7f8 fix: hide tag aliases from tag completion 2026-05-14 14:46:39 +08:00
Tienson Qin
8d83c7985a [codex] hide class hierarchy (#12640)
* fix: hide class hierarchy

* fix: resolve class label maps
2026-05-14 14:41:28 +08:00
Tienson Qin
7838becdf0 fix: preserve code block language 2026-05-14 13:23:26 +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
64b78b69e4 fix: resolve uuid refs in breadcrumb labels (#12636)
* fix(breadcrumb): resolve uuid refs in breadcrumb labels

* feat(breadcrumb): add functionality to resolve and hydrate breadcrumb reference titles
2026-05-14 13:20:25 +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
51c9c2970d fix lint 2026-05-13 13:51:53 +08:00
rcmerci
d12beff383 feat(graph-view): add task zoom-in view 2026-05-13 13:40:55 +08:00
Tienson Qin
cf24914e6c fix: dedupe raw node choices 2026-05-13 12:04:23 +08:00
Tienson Qin
b2fc00b31b fix: handle sidebar asset drops 2026-05-13 12:03:29 +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
58098303e0 fix: stop cmdk sidebar shortcut propagation 2026-05-13 11:42:28 +08:00
Tienson Qin
c8d00f5a7b fix: dedupe node property choices 2026-05-13 11:35:13 +08:00
Tienson Qin
00964157b1 dev: run lint-and-test in parallel
run cljs tests in parallel too
2026-05-12 23:36:42 +08:00
Tienson Qin
1b9a1999ac fix: block selection while scrolling 2026-05-12 21:38:21 +08:00
Tienson Qin
1c061cc871 fix: align heading bullets 2026-05-12 20:28:38 +08:00
Tienson Qin
96bf1f074b fix: align dark right sidebar header 2026-05-12 18:50:30 +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
Charlie
7194e54925 fix(ux): incorrect reaction for the order list sibling blocks (#12617)
* fix(ux): incorrect reaction for the order list sibling blocks

* Potential fix for pull request finding

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

* Potential fix for pull request finding

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

* fix: lint

* chore(test): add tests for order list type and sibling block interactions

* fix: refresh nested ordered lists

* fix: split affected query keys helper

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
2026-05-12 18:06:12 +08:00
Mega Yu
4c98cc6b51 fix: clear stale title when converting code block 2026-05-12 17:03:01 +08:00
megayu
7cb9144422 enhance(editor): support dollar autopair for markdown math (#12618)
* feat(editor): add support for dollar sign in autopair feature

* fix(editor): handle dollar autopair for markdown math

* feat(help): add inline math example

* fix(editor): double dollar autopair behavior
2026-05-12 16:09:06 +08:00
Grandroot
e63bc56750 Merge pull request #12470 2026-05-12 13:35:25 +08:00
Tienson Qin
3ae4d92adc fix: invalid data from old graphs
fixes https://github.com/logseq/db-test/issues/795
2026-05-12 10:52:45 +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
Kidy Lee
be34b7904a feat: add "Always on Top" in window menu. 2026-05-12 00:00:14 +08:00
IderAghbal
ba3ff5e5a5 feat: add support for avif and cr2 images (#11997) 2026-05-11 23:57:04 +08:00
megayu
755840c474 fix: heading icon alignment and menu active state
1. Derive the effective heading level consistently for auto headings, and reuse it for block icons, page-ref icons, and heading layout attributes.
2. Align heading bullets and page-ref icons so h3-h6 and auto heading changes no longer shift vertically.
3. Show the active heading and background color in the single-block context menu.
2026-05-11 23:26:46 +08:00
Tienson Qin
634ba33b3e fix: render markdown headings in quote blocks (#12611)
Preserve parsed Markdown heading levels for display-type blocks so quote blocks render '# heading' consistently with explicit heading properties.

Adds an app E2E regression test covering both quote heading creation paths.

Fixes logseq/db-test#599
2026-05-11 19:25:20 +08:00
Tienson Qin
e03e019a19 fix: export sqlite db as binary 2026-05-11 18:18:33 +08:00
megayu
1884911cc8 fix(exporter): preserve mixed quote blocks during DB export (#12610) 2026-05-11 18:08:14 +08:00
charlie
5726ecaa21 enhance(plugin): add thumbnail icon handling for plugin items 2026-05-11 16:32:04 +08:00
Tienson Qin
0b26f16422 fix: can't export client ops db on web 2026-05-11 16:15:22 +08:00
Tienson Qin
c32428702f fix: wrong datoms format when fixing invalid data 2026-05-11 14:45:39 +08:00
Charlie
cba65ee479 enhance(plugins): improve legacy storage apis (#12605) 2026-05-11 10:26:46 +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
rcmerci
a3e4d8a902 feat(cli): add qmd query (4) 2026-05-10 15:48:26 +08:00
rcmerci
b06eaa48a9 feat(cli): add qmd query (3) 2026-05-10 14:58:47 +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