Skip to content
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

Fix layout issues on iOS on the new architecture #199

Merged
merged 42 commits into from
Apr 10, 2024

Conversation

j-piasecki
Copy link
Collaborator

@j-piasecki j-piasecki commented Feb 22, 2024

Details

Fixes layout issues on the new architecture on iOS.

In more detail:

  • adds a turbomodule responsible for registering the newly added commit hook
  • adds a custom shadow node responsible for passing the family of markdown decorator to the commit hook
  • adds a commit hook that applies the markdown formatting to the text input during the shadow tree transactions

One caveat: in general we only want to apply formatting when the stored attributed string is using Mode::Value, otherwise (when it's using Mode::OpaquePointer) the formatting should already be applied. There is one exception - before the text input is mounted, markdown tooling around it is not initialized, so even if the attributed string is using Mode::OpaquePointer in this case, we should apply formatting during the transaction. This is done by forcing state updates for certain react tags since we don't have direct access to the shadow family from the decorator component.

Before
Screen.Recording.2024-02-22.at.17.20.46.mov
After
Screen.Recording.2024-02-22.at.17.20.08.mov

Related Issues

Manual Tests

Linked PRs

Copy link

github-actions bot commented Feb 22, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@j-piasecki
Copy link
Collaborator Author

I have read the CLA Document and I hereby sign the CLA

ios/MarkdownCommitHook.h Outdated Show resolved Hide resolved
ios/MarkdownCommitHook.h Outdated Show resolved Hide resolved
ios/MarkdownCommitHook.mm Outdated Show resolved Hide resolved
ios/MarkdownCommitHook.mm Outdated Show resolved Hide resolved
ios/MarkdownCommitHook.mm Outdated Show resolved Hide resolved
ios/MarkdownTextInputDecoratorState.h Outdated Show resolved Hide resolved
ios/MarkdownShadowFamilyRegistry.h Outdated Show resolved Hide resolved
ios/MarkdownCommitHook.mm Outdated Show resolved Hide resolved
ios/MarkdownCommitHook.mm Outdated Show resolved Hide resolved
ios/RCTLiveMarkdownModule.mm Outdated Show resolved Hide resolved
@j-piasecki j-piasecki marked this pull request as ready for review February 27, 2024 11:14
@tomekzaw
Copy link
Collaborator

tomekzaw commented Apr 8, 2024

  1. Let's revert the example app to Paper
  2. It looks like some C++ files are not formatted properly (?)
  3. I get the following error when trying to build the example app on Paper:
Screenshot 2024-04-09 at 00 31 00

Copy link
Collaborator

@tomekzaw tomekzaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yolo

@j-piasecki j-piasecki merged commit 7455208 into Expensify:main Apr 10, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants