-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[GB Mobile] Apply OS font size changes to the editor #9509
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
Closed
daniloercoli
wants to merge
6
commits into
develop
from
issue/605-Ensure-that-OS-level-font-size-settings-are-honored-in-editor
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c6f9cec
Listen on fontSize changes in EditPostActivity and restart RN context…
daniloercoli d8d7f9e
Restore Title and Content after a config changed event
daniloercoli 2360b00
update GB hash
daniloercoli a13d462
Fix lint
daniloercoli 46a60b8
Make sure title and content are preserved on device rotation while re…
daniloercoli 3015c5c
Make sure to retain `mHtmlModeEnabled` in GBContainerFragment, and fi…
daniloercoli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
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.
I'm quite concerned when we touch the EditPostActivity at a very high level since it means we're effectively touching Aztec-standalone too and the scope if very big there.
In this case, I tried out changing the OS font size on a non-blocks post, in Aztec, and it seems that something goes wrong and all the images/videos/paragraphs are one on top of the other:
If our best solution at the moment is to adopt the
fontScaleconfig change and handle it ourselves, I might feel inclined to propose a solution like the option I mentioned in #8874 (comment), where the idea is to introduce a subclass of the EditPostActivity only to be able to specialize its manifest definition and similar.In the meantime, can you check the issue shown in the gif @daniloercoli to see if it's fixable? Thanks!
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.
Yes, the issue I think is fixable without restarting Aztec but requires small changes to it. Calling
RefreshTextalone doesn't fix it, instead we need to reload the pictures/videos and re-layout them on configChanges. It alone is a rather small change, and we can try it and see the result.Should we invest time on this?
Otherwise, for the reasons you've mentioned above, I think that's best to exclude Aztec from the config changes code altogether, and introduce another Activity...it could be a big PR though. Wondering if we should following this path for an event (font size change in settings) that is going to happen rarely.
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.
I think this might be a rabbit hole. Plus, I don't think we know which other code or flow breaks in Aztec if we lift the assumption of the activity re-creation.
OTOH, going the new-Activity way for this particular issue (the font-size change) that's not critical is a bit much. Let's leave this PR unmerged and we give it some more thought?
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.
Yes, 100% agree with you on the points mentioned above. The only way to be sure to not break Aztec is to duplicate the Activity, but it feels way to much for a very rare writing flow (user needs to change the font size when the editor is open on the screen. If they change the font size and then open the editor the new font size is respected).