Commit Graph

4990 Commits

Author SHA1 Message Date
Tienson Qin
18c69fe1a8 fix: handle desktop sqlite binary export
Fixes logseq/db-test#873
2026-05-15 16:11:38 +08:00
Tienson Qin
2de6597811 fix: hide tag alias conversion action 2026-05-14 23:00:18 +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
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
1b9a1999ac fix: block selection while scrolling 2026-05-12 21:38:21 +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
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
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
megayu
0fb9c20d30 Support fullwidth left square bracket input with IME auto-completion (#12606)
* feat(editor): normalize ime-producted fullwidth ref input

* fix(editor): handle non-enter processed state in keyup handler
2026-05-10 11:53:25 +08:00
Charlie
4970a83a1e enhance(plugins): uninstall unused plugins (#12603)
* feat(plugin): add bulk removal of disabled plugins and related UI components

* enhance(plugin): add bulk removal feature for disabled plugins and themes

* Potential fix for pull request finding

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

* enhance(plugin): update bulk remove disabled plugins and themes messages

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-09 15:22:37 +08:00
Tienson Qin
c19eca0fd6 fix: handle wrong e2ee password on download 2026-05-09 12:18:45 +08:00
Tienson Qin
8857be2baf fix: can't download graphs on Android 2026-05-09 11:44:44 +08:00
Charlie
3c2359a79e enhance(plugins): libs improvements (#12588)
* enhance(libs): add Commands proxy and unified command APIs

* enhance(plugin): improve unregistering of simple and palette commands

* enhance(plugin): add unregister functionality for plugin commands

* chore(libs): add logseq.Commands API guide and implementation

* enhance(libs): introduce LSPluginNet for HTTP client functionality

* fix(ipc): ensure proper handling of IPC messages and improve plugin call structure

* enhance(libs): add HTTP methods (GET, HEAD, POST, PUT, PATCH, DELETE) and error handling

* enhance(api): support additional identifier types for opening blocks in sidebar

* 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>

---------

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-07 15:21:48 +08:00
Tienson Qin
46227b05eb fix: queue tab for pending new block
Fixes rapid Enter then Tab applying indentation to the previous editing block while the newly inserted block is still pending.

fixes https://github.com/logseq/db-test/issues/821
2026-05-07 13:23:21 +08:00
Tienson Qin
5bc8fafb1b fix: debounce search results 2026-05-06 21:38:04 +08:00
PlunderStruck
3b7bc2e5d8 dev: remove developer command cycle 2026-05-06 08:15:04 +08:00
Tienson Qin
a544e7f407 fix: guard focused root block indent/outdent and move ops 2026-05-05 16:56:19 +08:00
Will Wu
79f55b978a fix: prevent blocks from being outdented past zoom root in focused view
When viewing a page in zoom/focus mode, pressing Shift+Tab could outdent
blocks past the zoom root boundary, causing them to disappear from the
focused view. This adds a guard in both single-block (indent-outdent) and
multi-block (on-tab) code paths to check for the zoom boundary.

Fixes #12582
2026-05-05 16:56:19 +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
7488b92407 fix: switch graph if db-worker-node server unreachable 2026-05-04 14:07:03 +08:00
rcmerci
137dd7fefd enhance: unify build-version 2026-05-04 12:31:54 +08:00
Tienson Qin
ac102e70fe fix: correct db-worker ui request response args 2026-05-03 22:22:45 +08:00
rcmerci
17ae997013 enhance(db-worker): remove direct-pass in thread-api calling 2026-05-03 20:01:16 +08:00
Tienson Qin
6bfb7963d5 fix: recover stale sync resume paths 2026-05-03 15:28:10 +08:00
Tienson Qin
d1ac0836be enhance(ux): add block content conflicts notice 2026-05-01 12:12:55 +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
Tienson Qin
72252e5b58 refactor: move create-remote-graph to db worker
also, don't use :logseq.kv/graph-uuid to detect whether it's still
a remote graph, since it's not retracted when deleting a remote graph.
2026-04-29 22:45:49 +08:00
rcmerci
6d91d8ccae Merge remote-tracking branch 'origin/master' into feat/cliable 2026-04-28 22:59:59 +08:00
rcmerci
eca0ab1a36 Merge remote-tracking branch 'origin/master' into feat/cliable 2026-04-28 18:17:17 +08:00
Tienson Qin
200569e512 fix: web backup 2026-04-28 18:06:45 +08:00
TechnoHouse
80344840c4 feat: configurable publish server URL (#12520)
* feat: configurable publish server URL

Mirror the Custom Sync Server URL pattern (#12459) for the single-page
publish service. Settings -> Advanced -> Publish server URL opens a
dialog that writes the URL to localStorage; frontend.config/publish-api-base
reads it on each call so URL changes take effect without a restart.

Unlike sync, publish does not need a push-config-to-worker step because
the handler is purely HTTP request-response with no long-lived connection.

* fix(i18n): resolve en.edn merge after master sync

---------

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
2026-04-28 15:44:55 +08:00
charlie
5907b09824 fix(i18n): update interpolate function reference in plugin 2026-04-28 15:35:00 +08:00
Charlie
cfa90139b4 enhance(plugins): custom block renderer (#12533)
* enhance(plugins): add block properties and block renderers with conditional rendering

* chore(libs): bump version

* enhance(docs): update Experiments API guide with detailed usage examples and best practices

* enhance(ui): implement plugin renderer effects and enhance action bar visibility

* enhance(plugin): improve router refresh mechanism for dynamic plugin routes

* chore(libs): rename development notes and add SKILL.md for plugin SDK

* enhance(plugin): enhance PluginLogger with structured log entries and UI for viewing logs

* fix: lint

* Update src/main/frontend/components/block.cljs

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

* Update src/main/frontend/handler/plugin.cljs

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

* Update src/main/frontend/handler/plugin.cljs

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

* Update libs/src/modules/LSPlugin.Experiments.ts

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

* Update src/main/frontend/handler/plugin.cljs

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

* enhance(plugin): add rich text interpolation to i18n translation

* fix: lint

* fix: lint

* fix: remove unnecessary newlines and clean up code formatting

* fix: lint

* fix(libs): incorrect entry path for js mode

* enhance(docs): add custom theme plugin guide and update SKILL.md

* enhance(plugin): add 'open logs' option in multiple languages

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-28 15:17:55 +08:00
Tienson Qin
1bcd855542 fix: flashcards dialog closed immediately after finishing one card 2026-04-28 13:29:22 +08:00
Tienson Qin
0d5986eb90 fix(flashcards): load collapsed children when revealing answers
fixes https://github.com/logseq/db-test/issues/828
2026-04-28 12:50:13 +08:00
rcmerci
2e4922b60d Merge remote-tracking branch 'origin/master' into feat/cliable 2026-04-23 21:55:05 +08:00
Tienson Qin
d54484dff2 fix(test): silence expected errors and task fail arity 2026-04-23 19:54:00 +08:00
Tienson Qin
8353f574ae fix(sync): reject stale numeric history ops and surface worker ex-data 2026-04-23 18:58:23 +08:00
Tienson Qin
fa01a05f41 fix(regression): page title control disappear and not center aligned 2026-04-23 17:09:52 +08:00
Tienson Qin
e048996880 Merge branch 'master' into feat/cliable 2026-04-22 21:07:00 +08:00
Tienson Qin
6e2acc0af1 enhance: no need to block waiting previous graph server down 2026-04-22 17:54:53 +08:00
Tienson Qin
fd6bdff4cc fix(cli-e2e): disable keychain only in e2e runs 2026-04-22 15:31:13 +08:00
Tienson Qin
3503570f8e remove warning on missing-home-dir since electron ipc is not called 2026-04-21 21:36:59 +08:00
Tienson Qin
28c5795219 fix: can't download graph on electron 2026-04-21 18:57:32 +08:00