-
Notifications
You must be signed in to change notification settings - Fork 0
YPE-1002 - Fix the UI overflow of the Bible abbreviation inside of the square box #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 122fbff The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Greptile SummaryThis PR fixes Bible version abbreviation text overflow by implementing dynamic font scaling. The solution extracts the inline abbreviation rendering logic into a dedicated Key changes:
The implementation uses a 5-iteration convergence loop to calculate optimal font sizes for both the prefix and digit portions of version abbreviations, ensuring text fits within 70% of container width and 40% of container height. Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant VersionPicker as BibleVersionPicker
participant VersionIcon as VersionAbbreviationIcon
participant ResizeObserver
participant DOM
User->>VersionPicker: Opens picker
VersionPicker->>DOM: Renders version list
loop For each Bible version
DOM->>VersionIcon: Mount component with abbreviation text
VersionIcon->>VersionIcon: Parse text into prefix + digits
VersionIcon->>ResizeObserver: Create observer on container
ResizeObserver->>VersionIcon: Observe container element
ResizeObserver->>VersionIcon: Trigger resize event
VersionIcon->>VersionIcon: Calculate prefix size (5 iterations)
VersionIcon->>DOM: Set fontSize on prefix element
VersionIcon->>DOM: Measure scrollWidth & offsetHeight
VersionIcon->>VersionIcon: Calculate digits size (5 iterations)
VersionIcon->>DOM: Set fontSize on digits element
VersionIcon->>DOM: Measure scrollWidth & offsetHeight
VersionIcon->>VersionIcon: Update state with final sizes
VersionIcon->>DOM: Re-render with calculated font sizes
end
User->>VersionPicker: Select version
VersionPicker->>User: Close picker & update selection
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 files reviewed, 1 comment
|
I imagine this will require a changeset update, and that's something I don't know how to do yet. We'll need to learn from Brenden |
within box boundaries
overflow Adjust text scaling to account for container height, preventing overflow. Also, ensure text does not wrap by adding `yv:whitespace-nowrap` class.
Removes unused digitsRef and digitsSize state. The font size for digits is now derived from prefixSize, ensuring consistent scaling.
72d7c96 to
4459560
Compare
|
Okay, so I ran through and made a small change where the font size of the text is just one font size and not two different font sizes. And then the second thing that I did was create a change set. And the third thing that I did was create or to rebase. And that's it. This is ready to be merged upon your approval @bmanquen |
Here's a quick video overview.
As you can see in here, the Bible abbreviations and the years fit within the boundaries of the box and do not overflow.