Repository navigation
fix: keep heading fold arrows on the right - #13939
Merged
Merged
Conversation
Heading wrappers in block.css are position:relative, which beats the fold-on-right static wrapper and places the absolute arrow on the bullet. Use the mobile app's static wrapper and margin offsets under main.ls-fold-button-on-right. Co-authored-by: Tienson Qin <[email protected]>
megayu
force-pushed
the
logseq/fix-heading-fold-button-right-b3d2
branch
from
November 9, 2026 06:02
37fe8aa to
51d46a3
Compare
megayu
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes logseq/db-test#1509
Cause
On the web build,
state/enable-fold-button-right?addsmain.ls-fold-button-on-rightbelow thesmbreakpoint on a phone. That stylesheet sets.block-control-wraptoposition: staticand.ls-block .block-controltoposition: absolute; right: -4px, so the fold arrow is placed against the block row.block.cssis more specific for h1/h2:Specificity
(0, 3, 0)beatsmain.ls-fold-button-on-right .block-control-wrapat(0, 2, 1). The relative wrapper becomes the arrow's containing block, so the arrow lands on the bullet and the bullet tap folds instead of zooming.The native app already avoids this in
src/main/mobile/components/app.cssby keeping heading wrappersstaticand offsetting them with margin. That file is mobile-app only. Journal blocks are also outside.blocks-container, so copying the mobile selector unchanged would miss the web home page.Fix
The same static wrapper and mobile margins (
mt-[18px]/mt-3, including> .block-control) now live undermain.ls-fold-button-on-right .block-main-container. Those selectors are(0, 4, 1)and(0, 5, 1), so they win over the headingtoprules and over the fold rule'smargin-top: 0. Left-fold desktop never gets the class. On the native app the shared values matchapp.css, so blocks already covered there keep the same offsets.Screenshots
Phone viewport, fold arrows on the right, before:
Before: h2 fold arrow sits on the bullet while a normal block
After, h1 and a normal block:
After: h1 fold arrow is on the right of the heading
After, h2:
After: h2 fold arrow is on the right of the heading
Tapping the h1 bullet zooms into the block:
After: tapping the h1 bullet zooms into the block
Tests
No new unit test. This is computed layout. Checked in the web build at
localhost:3001:mainhasls-fold-button-on-right. Before the change, h1/h2 wrappers wereposition: relativeandelementFromPointon the bullet hit.block-control. After, h1 usesmargin-top: 18px, h2 uses12px, the arrow sits at the right edge, the bullet is the hit target, and tapping it zooms.position: relativewithtop: 16px.stylelintontheme.cssstill reports existing issues in that file. This change does not add a duplicate selector or a new comma-newline warning. Icon headings use the same margin calc as the mobile app and were not clicked through in the browser.To show artifacts inline, enable in settings.