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

Rich Text Composer: On iPhone in Landscape mode the fullscreen toggle should be hidden #7097

Merged

Conversation

Velin92
Copy link
Member

@Velin92 Velin92 commented Nov 22, 2022

IMG_6710FAB796C9-1

Also moved the position of underline and strikethrough to match the design and improved the landscape sizing, when the view is compressed.
Also I removed a constraint reference from the XIB, that was probably causing a freezing when minimising in some cases.

…he positioning of the strikethrough and underline, and the maxCompressed size in landscape mode is always adapted to be visible.
@codecov
Copy link

codecov bot commented Nov 22, 2022

Codecov Report

Base: 11.74% // Head: 11.73% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (91ba86d) compared to base (daa48a8).
Patch coverage: 27.02% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7097      +/-   ##
===========================================
- Coverage    11.74%   11.73%   -0.01%     
===========================================
  Files         1620     1620              
  Lines       159179   159199      +20     
  Branches     64743    64763      +20     
===========================================
+ Hits         18688    18689       +1     
- Misses      139855   139874      +19     
  Partials       636      636              
Flag Coverage Δ
uitests 54.89% <50.00%> (-0.03%) ⬇️
unittests 5.95% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../WYSIWYGInputToolbar/WysiwygInputToolbarView.swift 0.00% <0.00%> (ø)
...s/Room/VoiceMessages/VoiceMessageAudioPlayer.swift 0.00% <0.00%> (ø)
...I/Modules/Room/Composer/Model/ComposerModels.swift 79.03% <ø> (ø)
...es/Room/Composer/ViewModel/ComposerViewModel.swift 29.78% <0.00%> (-4.36%) ⬇️
...tSwiftUI/Modules/Room/Composer/View/Composer.swift 86.09% <50.00%> (-1.82%) ⬇️
...odules/Room/Composer/MockComposerScreenState.swift 93.33% <100.00%> (ø)
...odules/Room/Composer/Model/ComposerViewState.swift 86.95% <100.00%> (+1.95%) ⬆️
...ojiPicker/Data/EmojiMart/EmojiItem+EmojiMart.swift 95.34% <0.00%> (-0.31%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@aringenbach aringenbach left a comment

Choose a reason for hiding this comment

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

LGTM

But I think we can improve this further, if you look at Composer.swift line 125. We are already hiding this button depending on plainTextMode (which is actually in sync with the Element-iOS viewModel's textFormattingEnabled) and we are also forcing the minimise when toggling in WysiwygInputToolbarView.swift line 346

What I think we can do is handling both the textFormattingEnabled and the isLandscapeIphoneon the ComposerViewModel and expose a property that computes both into something like forcedMinimise (with a better name maybe) that means the button is hidden and we should minimise if it was previously maximised.
That way the Composer view is "dumber" and just responds to a single property telling it what it should do with this button 🙂

@@ -33,20 +31,25 @@ struct Composer: View {
@Environment(\.theme) private var theme: ThemeSwiftUI

@State private var isActionButtonShowing = false
@State private var isToggleButtonHidden = false

private var isLandscapeIphone: Bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

I fear Apple is gonna reject our application because of this capital 'I' :trollface:

@Velin92
Copy link
Member Author

Velin92 commented Nov 23, 2022

@aringenbach Actually your suggestions made a lot of sense, I think I have improved the code quite a lot in this way, may you give another quick re-review of the changes?

@sonarcloud
Copy link

sonarcloud bot commented Nov 23, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@aringenbach aringenbach left a comment

Choose a reason for hiding this comment

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

Nice ! Works well on my side 👍

@Velin92 Velin92 merged commit 8bd53e2 into develop Nov 23, 2022
@Velin92 Velin92 deleted the mauroromito/fullscreen_mode_hidden_on_landscape_iphone branch November 23, 2022 14:02
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.

Rich Text Composer: On iPhone in Landscape mode the fullscreen toggle should be hidden
2 participants