Is there a way to "collapse" a single block in a way that it would only show the first line (X characters)?


I am finding it not ideal that I have no (at least to my knowledge) means to just collapse (minimize) a block that has many lines of text. I often write a single block that is -say- 20 lines and, when both left and right panes are visible, it covers all the real estate of the center pane. FreePlane, the MindMapping Tool has a feature called ‘minimize node’, which just limits what can be seen from the whole node to a certain number of words and it gets a […]-style icon so that one knows it’s collapsed. Can something like this be adapted for Logseq? Maybe via CSS?

Thank you.

in settings (/logseq/config.edn) set :outliner/block-title-collapse-enabled? true
this will let you collapse multi-line blocks to its title (note that a title can also be multi-line, it will collapse everything after the first soft break – shift+enter)

I wouldn’t have expected that this would be helpful (i have stumbled on some reddits about this feature having been default in some Logseq version) because I believed that soft breaks would break markdown flow and be badly rendered. So I tried copying a Logseq paragraph with soft-breaks, from the markdown file on disk into an online markdown previewer and to my surprise it shows as continuous text, as if there is no soft-break.

Thanks for the answer, this realization clears up for me more than the problem I have opened this issue for.

:grey_question: On a side note: is there a way that a collapsed block can show a […] at the end of the visible line?

about the ellipsis for collapsed blocks, you could write a custom.js script, afaik a css-only solution would require the :has selector which is not available in the current electron desktop app (would need an upgrade to electron 20).

I am not familiar with .js coding to do that but from your answer I get it that at some point (next release?) Logseq will feature electron 20 and this issue would be solved by a simple .css anippet?

I don’t know when the devs plan to update electron to v20, when they do, it should theorically be possible to use the :has selector in a custom css. I wouldn’t bet on the next release though.