Fix text overflowing to the right in progressive web app - #4844
Open
confusinguser wants to merge 2 commits into
Open
Fix text overflowing to the right in progressive web app#4844confusinguser wants to merge 2 commits into
confusinguser wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #4842 by adjusting how the reader computes the effective page width used for column-based pagination, aiming to prevent slight horizontal drift that can cause text to be clipped on the right in “1 Column” mode (notably on smaller screens / PWA).
Changes:
- Recomputes
pageWidthbased on the actual.book-contentelement width rather than deriving it from the outer reader width and a calculated margin. - Forces
pageWidthto re-evaluate whenpageStyleschanges (so margin/style adjustments can affect pagination math).
Suppressed comments (1)
UI/Web/src/app/book-reader/_components/book-reader/book-reader.component.ts:1741
pageWidthaddsCOLUMN_GAP, but the actual CSScolumn-gapfor this component is defined inrem(1.25rem). If the root font size / text scaling changes, the JS math can drift from the real column gap and cause small horizontal misalignment/overflow. Consider reading the computedcolumnGapfrom the element instead of assuming 20px.
const columnGapModifier = this.columnGapModifier();
const bookContent = this.bookContentElemRef()?.nativeElement;
if (this.readingSectionElemRef() == null || bookContent == null) return 0;
return bookContent.clientWidth + (COLUMN_GAP * columnGapModifier);
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Fixed