logseq / logseq/logseq

Toggle open blocks on long page causes two bugs including a crash

Open
#6,268 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

can-be-reproduced editor:lazy-loading
Dominant language
Clojure
Stars
45k
Forks
2.8k
Avg merge
1d 22h
Merged PRs (30d)
105

Description

### What happened?

I tried toggling open blocks on https://docs.logseq.com/#/page/changelog to get an overview of the page. I encountered two bugs

### Reproduce the Bug

1. Go to https://docs.logseq.com/#/page/changelog page in docs graph
2. Run `Toggle open blocks` command to close blocks
3. First bug: Only first 3 top-level blocks are shown as collapsed and other top level blocks are not visible
4. Run `Toggle open blocks` command to open blocks
5. Encounter crash `Error caught by UI! Error: Assert failed: Each block should have a different left node (= (count blocks) (count (set (map :block/left blocks))))`

### Expected Behavior

I can close and expand blocks on a long page and see all top-level blocks correctly

### Screenshots

_No response_

### Desktop Platform Information

osx 12.0.1

### Mobile Platform Information

_No response_

### Additional Context

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue on the docs graph's long changelog page and inspect the implementation of the `Toggle open blocks` command alongside the reported UI assertion. Done means all top-level blocks remain visible when collapsed and expanded, with no crash or duplicate left-node assertion.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.