fix: arrow keys skip empty icon bottom-property row by tiensonqin · Pull Request #13166 · logseq/logseq · GitHub
Skip to content

fix: arrow keys skip empty icon bottom-property row - #13166

Open
tiensonqin wants to merge 2 commits into
masterfrom
logseq/fix-icon-bottom-property-row-1493
Open

fix: arrow keys skip empty icon bottom-property row#13166
tiensonqin wants to merge 2 commits into
masterfrom
logseq/fix-icon-bottom-property-row-1493

Conversation

@tiensonqin

@tiensonqin tiensonqin commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Fixes logseq/db-test#1145

Icon-only blocks were classified as :block-below (:logseq.property/icon is a :map) and mounted an empty .bottom-properties-row (tab-index -1). That invisible row became a Down stop, and bottom-properties-row-in-block used .querySelector(".bottom-properties-row"), so Up from a child icon block could match the child's row inside the parent.

This change:

  • Filters :logseq.property/icon out of the block-below list before mounting the row, and skips the row when there are no visible pills and no expand / add-property / hidden-properties controls
  • Resolves a block's bottom row by [data-bottom-properties-row="<uuid>"] so a parent never owns a child's row
  • Leaves Status / Scheduled / other real bottom pills in place

Tests cover icon-only blocks not emitting a nav stop, parent lookup ignoring a child's row, and scheduled still rendering on the bottom row.

Lint and tests:

  • bb lint:dev passed (clj-kondo 0 errors / 0 warnings, carve, large-vars, worker/frontend split, translations, ns-docstrings)
  • pnpm cljs:test compiled with 0 warnings
  • frontend.components.block.positioned-properties-test and frontend.handler.editor-test: 86 tests, 230 assertions, 0 failures
Open in Web Open in Cursor 

cursoragent and others added 2 commits September 3, 2026 16:53
Icon-only blocks were classified as block-below and mounted an empty
focusable row. Filter icon out before mounting that row, and look up
bottom-property rows by the owning block uuid so parents do not steal
a child's row.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
Move the owned-row query after node-attr so cljs and kondo can resolve
the helper used to read blockid.

Co-authored-by: Tienson Qin <tiensonqin@gmail.com>
@tiensonqin
tiensonqin marked this pull request as ready for review September 3, 2026 17:00
Copilot AI lite review requested due to automatic review settings September 3, 2026 17:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

It changes core editor keyboard-navigation behavior and UI mounting logic, and I couldn’t perform runtime interaction verification in this review context.

Pull request overview

This PR fixes an editor keyboard-navigation edge case where icon-only blocks could mount an invisible .bottom-properties-row that became an unintended arrow-key navigation stop, and where parent blocks could mistakenly resolve a descendant’s bottom row.

Changes:

  • Filter :logseq.property/icon out of block-below “bottom pill” rendering and avoid mounting the bottom-properties row when there are no visible pills and no bottom-row controls.
  • Make bottom-row lookup in the editor target the row owned by the current block via data-bottom-properties-row="<block-uuid>", preventing parent/child row collisions.
  • Add focused tests covering icon-only behavior, correct row ownership resolution, and ensuring real pills (e.g. Scheduled) still render.
File summaries
File Description
src/main/frontend/components/block.cljs Filters icon from bottom pills and gates bottom-row mounting when the row would be empty/invisible.
src/main/frontend/handler/editor.cljs Resolves the bottom-properties row by block ownership attribute instead of a generic descendant selector.
src/test/frontend/components/block/positioned_properties_test.cljs Adds new unit tests validating icon-only blocks don’t emit a bottom-row navigation stop and that scheduled still renders.
src/test/frontend/handler/editor_test.cljs Adds a test ensuring bottom-row lookup only matches the row owned by the current block, not a child’s.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI Regression - block with icon has two bugs related to keystrokes

3 participants