#161 - Fix expand in edit mode with Readable line length - #176
Open
aioue wants to merge 2 commits into
Open
Conversation
Make ```expand``` code blocks work in live preview when Readable line length is on: wrapped blocks stay in the normal column, unwrapped blocks grow with the content and scroll in the editor, and the Plain text / wrap controls stay visible when the pane is narrow.
Add a short design note covering intended behavior, architecture, and dead ends so future work on Readable line length expand does not repeat failed approaches.
Owner
|
@aioue Wasn't this working correctly? If I remember correctly (I might be wrong) it worked for me also when "readable line length" was enabled/disabled. Anyway, thanks for PR. I will look at it, but unfortunately it could take some time. I am currently under a "little" more workload than usually 😄 |
Author
|
Unfortunately not, it didn't change the codeblock size or extend the text. Of course, happy to wait. If you think it's too much change to merge, that's ok too. |
Owner
|
Ah ok. I will definitely check out, what you did :) |
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.
Summary
This continues the work from #161.
You already added
expandfor reading mode and shared a test build. This PR fixes the remaining live-preview / edit-mode case when Readable line length is turned on.This took a while 😪
What users should see
With Readable line length on, in live preview:
expandblock that is wrapped lines up with that same column (same left edge and width) and soft-wraps long lines.expandblock that is unwrapped stays left-aligned with the column, but grows as wide as the longest line. If it is wider than the pane, you scroll the editor horizontally.What changed (high level)
Expand.ts) that cooperates with Obsidian’s readable-line CSS variables instead of fighting them.rightonly, so the language label does not get crushed into a vertical stack.How to test
```lang expand` fence that has a long line.title:...), and a note with a callout code block above an expand block.Built
styles.cssis included.main.jsis left unchanged in git (same as the repo’s usual release flow) - please rebuild for a release artifact.Thanks again for implementing the first pass on #161 - happy to adjust based on review.