Commit Graph

23309 Commits

Author SHA1 Message Date
scheinriese
c2e5f34a32 feat: add text-picker gallery with Initials/Abbreviated/Custom modes and live persistence
- Add derive-abbreviated, normalize-word-boundaries, and abbreviated-stop-words
  for smart title abbreviation (e.g. "Software Engineer" → "Soft Eng")
- Replace single preview with gallery row of 3 selectable style tiles
- Add ::mode and ::deleted? state atoms; persist mode in icon data
- Live-persist on gallery click, alignment change, and text input (300ms debounce)
- Guard will-unmount with ::deleted? to prevent re-persisting after delete
- Add gallery CSS (.text-picker-gallery, -item, -preview, -label) and
  color-picker nested styles in .text-picker-actions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 12:57:05 +01:00
scheinriese
3b780f56da fix: unify asset URL loading, add collapsible sections, fix cond-> corruption
- Merge load-image-url!, try-load-image-with-extensions!, and duplicate
  <load-asset-url! into a single unified <load-asset-url! with retry logic,
  extension guessing, and per-component stale guard
- Fix concurrent asset loads dropping by replacing global *load-id-counter
  with per-component ::load-id atoms
- Add on-error handler to image-icon-cp <img> tag for graceful fallback
- Wire up collapsible sections in asset-picker using rum/react on
  *section-states (fixes reactivity with @ plain deref)
- Restore correct } placement in cond-> forms (emoji-cp, text-cp, avatar-cp)
  that clj-paren-repair had corrupted by absorbing test/expr pairs into maps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 12:38:52 +01:00
scheinriese
25457481c4 fix: use neutral grey for drag overlay corner brackets
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-23 12:01:15 +01:00
scheinriese
b7dd0a3bc0 fix: deduplicate assets by checksum and prevent zombie re-transaction
Asset queries now require checksum (filtering orphaned entries) and
deduplicate by checksum to prevent showing duplicate thumbnails.
Changed async query to transact-db? false so deleted assets don't get
re-transacted from worker DB back into frontend. Added debug logging
across asset URL resolution, picker mounting, and view lifecycle.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 00:59:40 +01:00
scheinriese
1b839f00d3 fix: add asset URL retry mechanism and prevent orphaned asset property leaks
Ghost assets now retry URL resolution 3 times with 1s delay, show a
clickable refresh icon for manual retry, and handle invalidated blob
URLs via img on-error. Orphaned asset properties (type without
checksum+size) are auto-retracted on save, and block rendering requires
all 3 asset properties to prevent false asset treatment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 00:29:27 +01:00
scheinriese
13da2d3415 feat: improve empty state copy and drag overlay for asset/icon picker
- Context-aware empty states: "No images yet" (first use) vs "No matching
  images" (search) with appropriate icons (photo vs search-off)
- Add .asset-picker-empty CSS class with grid-column: 1/-1 to fix text
  wrapping bug where empty state was confined to a single 65px grid column
- Refine drag overlay: frosted glass backdrop, corner bracket indicators,
  file type subtitle (PNG, JPG, SVG, GIF, WebP), shared CSS between pickers
- Lock scroll on drag-active to prevent content shifting under overlay

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 00:10:40 +01:00
scheinriese
8079717f85 fix: match overscroll background color to lx-gray-02 on icon picker root
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-18 00:02:59 +01:00
scheinriese
a6cb734251 feat: add drag-and-drop image upload to icon picker with frosted glass overlay
Allow users to drag image files directly onto the icon picker popup to set
as icon, bypassing the Custom > Image tab navigation. Features a frosted
glass overlay with backdrop blur, radial edge glow using theme-aware accent
colors, decorative corner brackets, and scroll locking during drag.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 23:59:52 +01:00
scheinriese
2e65a0c190 feat: hide section collapse controls when only one search category visible
When search filters results to a single category, the chevron toggle
and keyboard shortcut hints are unnecessary — collapse the only visible
section makes no sense. Uses simple header mode instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 21:20:19 +01:00
scheinriese
c1a054fcb4 feat: improve icon picker UX — keyboard hints, highlight scoping, empty states
- Show section shortcut hints (⌥⌘1/2/3) only when focus is on grid/tabs,
  hidden when typing in search
- Restore ⌥⌘1/2/3 to toggle section collapse (was incorrectly switching
  tabs); remove tab-switching shortcuts
- Scope keyboard highlight to active section only, preventing duplicate
  highlights when same emoji appears in Recently used and Emojis
- Unify hover shape from circle to rounded-rect (8px) matching keyboard
  focus, with consistent visual hierarchy (hover < focus < ghost)
- Add "No results found" empty state with search-off icon and subtitle
- Show ghost asset placeholder for missing image files instead of hiding
  them entirely
- Unify Emojis/Icons virtual list height (358px) to match All tab,
  eliminating height jump when switching between browsing tabs
- Bump picker max-height to 442px to accommodate taller virtual lists

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 20:27:18 +01:00
scheinriese
493bae1dca debug: add console logs to diagnose asset/type ghost block bug
Temporary debug logging to trace how :logseq.property.asset/type "jpg"
leaks onto regular text blocks during icon picker avatar→tabler-icon
switching. Logs at: save-image-asset!, wrap-parse-block, save-block-inner!,
api-insert-new-block!, and icon on-chosen callback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 19:27:23 +01:00
scheinriese
6d97c97a20 feat: improve icon picker with asset management and avatar rendering
Enhance unified icon picker: refine asset-picker section navigation,
improve avatar/image icon handling in on-chosen callbacks, add asset
alignment support for images, and update icon rendering for block and
page contexts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 19:25:26 +01:00
scheinriese
cca45c4f7f style: adjust icon sizes and picker UI styling
Bump sidebar icon sizes to 20px, increase avatar font-size in sidebar,
fix page title avatar dimensions, refine icon picker tabs and layout,
add keyboard focus styles for tab items, and prevent bold layout shift.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 19:25:16 +01:00
scheinriese
e782310e57 feat: add unified icon picker with emoji, text SVG, and image icon support
Introduces a comprehensive icon picker system supporting 5 icon types:
emoji, tabler icons, text (SVG viewBox), avatar, and image assets.

Key features:
- Text icons rendered as crisp SVG with smart text splitting
- Image asset picker with grid view, drag-and-drop upload
- Wikipedia Commons image search with license confirmation
- URL-based asset import with validation
- Recently used assets tracking
- Unified icon format with normalize-icon for consistent storage
- DB migrations for default-icon, wikidata-id, property-key-width properties
- Context menu "Set icon" / "Change icon" entry points
- Bordered tooltip arrows for web image info
- Photo-icon sizing in CMD+K and page title contexts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 13:38:14 +01:00
Rustum Zia
5fe47fb69f fix(left_sidebar): don't activate resizer when sidebar is closed (#12455) 2026-03-17 13:43:09 +08:00
Tienson Qin
b27272828d code cleanup round 2 2026-03-17 00:07:33 +08:00
Tienson Qin
db6fee669a sync client code cleanup 2026-03-17 00:07:33 +08:00
Tienson Qin
917309113f feat: sync checksum 2026-03-17 00:07:33 +08:00
Tienson Qin
6183ba2375 fix(rtc): recover legacy rebased tx tempids 2026-03-17 00:07:33 +08:00
Tienson Qin
33098113ee enhance: returns rejected tx 2026-03-17 00:07:33 +08:00
Tienson Qin
e3366e8e07 enhance(rtc): preserve rebased tx boundaries 2026-03-17 00:07:33 +08:00
Tienson Qin
071d922442 fix: sync tests 2026-03-17 00:07:33 +08:00
Tienson Qin
68476aee3e refactor(outliner): batch ops via temp conn 2026-03-17 00:07:33 +08:00
Tienson Qin
42fec8324e simplify sync by applied txs sequentially 2026-03-17 00:07:33 +08:00
Tienson Qin
b8d7483a81 add scripts to manage graphs 2026-03-17 00:07:33 +08:00
charlie
f023071ac3 fix(ui): improve dropdown menu for the choices values 2026-03-14 15:44:46 +08:00
Tienson Qin
01c1a498cd fix: uploaded graph not ready 2026-03-14 10:11:34 +08:00
scheinriese
e8bddda236 fix(shortcut): limit prefix-conflict detection to same-handler only
Cross-handler prefix overlaps don't cause chord dormancy because each
Closure KeyboardShortcutHandler instance has its own independent key
tree and state machine. Only same-handler prefix conflicts (where
Closure's tree can't have a node be both leaf and branch) cause
actual chord dormancy.

- Change binding-match? to use same-handler? instead of handler-match?
  for prefix overlaps (exact matches still use handler-match?)
- Update test to verify cross-handler prefixes are NOT detected

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 21:10:35 +08:00
Tienson Qin
32d5aaf29d fix: don't show upload-temp graph 2026-03-13 21:00:57 +08:00
Tienson Qin
6a019909cb Merge pull request #12447 from logseq/enhance/shortcut-redesign
enhance(ux): redesign shortcut component and keymap settings page
2026-03-13 20:59:57 +08:00
Tienson Qin
33b2bc0c14 chore: remove unused dict 2026-03-13 20:59:00 +08:00
Tienson Qin
3f6788410a fix: lint 2026-03-13 20:58:36 +08:00
Tienson Qin
088b7be0b0 adjust keymap space 2026-03-13 20:45:58 +08:00
scheinriese
a3471e0406 refactor(shortcut): defer prefix-conflict banner to post-reassign state
Show the amber "Deactivates" banner only after the user confirms
Reassign, not alongside the red "Used by" prompt. Reduces visual
noise during the decision step and shows consequences after the action.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00
scheinriese
22a165472a feat(shortcut): inline compact keycaps in prefix-conflict banners
Show chord keycaps alongside action names in the amber "Deactivates"
banner so users can see both the chord pattern and what it does.

- n=1: inline keycap + quoted name
- n=2-3: vertical list with keycap + name per row
- n≥4: count-only fallback
- Proportional auto-fade: 6s/8s/10s based on item count
- Chord strokes visually grouped with 6px gap between strokes
- Compact keycaps tinted amber-12 inside warning banners

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00
scheinriese
1cd7cad8ae feat(shortcut): tiered prefix-conflict banners and cross-handler detection
Prefix conflicts (chord shortcuts that go dormant when a simple key
shadows their leading stroke) are now shown as amber warnings instead
of red blocking errors.  Exact-match conflicts remain red with
Reassign.

Key changes:
- Extend binding-match? from same-handler? to handler-match? so
  cross-handler prefix overlaps between co-active handlers are detected
- Add partition-conflicts-by-type and conflict-has-exact? helpers in
  data_helper to split conflicts into exact vs prefix sub-maps
- Three-way debounce in shortcut dialog: exact → red blocking,
  prefix-only → amber auto-save with undo, mixed → stacked banners
- Widen Closure error catch to handle both chord-prefix conflict
  directions ("shortcut: null" and "shortcut: <id>")
- Add CSS color override for undo link inside amber warning banner
- Add i18n keys: deactivates-chord, deactivates-chords
- Add tests for partition-conflicts-by-type and cross-handler detection

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00
Tienson Qin
b3c9f75eec fix(shortcut): handle prefix conflicts and disabled edits
Cover the three regression cases from review.

- block same-handler leader/chord prefix collisions in keymap conflict detection so bindings like mod+c cannot silently leave mod+c mod+s or mod+c mod+c dormant at runtime
- collapse canonical-equivalent bindings back to default when saving so recorded meta/cmd variants do not linger as redundant custom overrides
- allow disabled shortcut rows to reopen the customize dialog and normalize false defaults into editable empty bindings
- add focused regression tests for conflict detection and shortcut persistence/editability
2026-03-13 20:45:58 +08:00
Tienson Qin
4956f6aef6 wrong comments
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-13 20:45:58 +08:00
scheinriese
57adfb144a Assorted code quality cleanups
- Remove unused clojure.string require in core_test.cljs
- Replace promesa.core p/delay with js/setTimeout, remove import
- Remove redundant final-result binding in print-shortcut-key
- Flatten nested if chain to cond for raw-binding
- Fix nested button inside button (keystroke-active → div)
- Remove dead .cp__shortcut-table-wrap CSS
- Align global-handlers set in get-cross-context-conflicts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00
scheinriese
6502bb53f6 Suppress shortcut-row-sweep animation for prefers-reduced-motion
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00
scheinriese
e7eb6f3241 Add role and aria-expanded to category header toggles in keymap list
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00
scheinriese
01f9904062 Fix conflict detection between block-editing and editor-global handlers
block-editing-only was missing from the global-handlers set in
get-conflicts-by-keys, so conflicts between block-editing-only and
editor-global shortcuts (e.g. assigning ⌘X to Create new block vs Cut)
showed as amber warnings instead of red blocking conflicts. Also remove
dead chord-prefix code from same-leading-key? and add a comment about
the brittle Closure error string match for chord-prefix detection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00
scheinriese
aaa7b566ad Remove console debug block in favor of existing log/error call
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00
scheinriese
4fa8b43c84 Extract max-key-sequence-length constant for magic number 5
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00
scheinriese
8d62b4d6bc Use cond-> for container-attrs in shortcut badge components
Replace chained if/assoc rebindings with idiomatic cond-> in
combo-keys, separate-keys, and compact-keys.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00
scheinriese
e02810f983 Show readable PgUp/PgDn labels in shortcut kbd badges
The page-up and page-down keys were mapped to Private Use Area Unicode
characters (U+F571, U+F572) that don't exist in any font loaded by the
kbd elements, rendering as invisible/empty badges.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00
scheinriese
3aa5a36d4a Fix tab order accessibility in keymap settings list
Make the shortcut list a single tab stop (<ul> tabindex=0) with arrow
key navigation between rows (tabindex=-1). This eliminates ~583 tab
stops while preserving full keyboard access. Also fix focus restoration
after closing the recording popup by disabling the popup infrastructure's
competing focus logic (focus-trigger? false, onCloseAutoFocus preventDefault)
and using focusVisible:true for visible focus rings on programmatic focus.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00
scheinriese
b076ce9fc0 Make kbd top inset glow transparent in light mode for better vertical centering
The white-on-white highlight was invisible yet shifted perceived letter
center downward. Variable is preserved so custom themes can still set it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00
scheinriese
bf7ebc8d7e Add gradient fade to keymap header when section headers are absent
Uses :has(.th) to detect when category section headers are in the DOM.
When searching/filtering removes them, the header's bottom padding fades
to transparent so list items scroll away smoothly instead of a hard cutoff.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00
scheinriese
6cfbaf93d1 Add spacing and fix vertical alignment for sidebar shortcut badges
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 20:45:58 +08:00