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 Placeholder Text #6938

Merged
merged 9 commits into from
Oct 20, 2022

Conversation

Velin92
Copy link
Member

@Velin92 Velin92 commented Oct 19, 2022

Implemented a responsive placeholder text in the RichTextComposer using the same logic of the normal composer

RPReplay_Final1666187799.MP4

@Velin92 Velin92 linked an issue Oct 19, 2022 that may be closed by this pull request
@Velin92 Velin92 requested a review from langleyd October 19, 2022 14:35
Comment on lines 5001 to 5006
if (!savedInputToolbarPlaceholder)
if (toolbarView.placeholder)
{
savedInputToolbarPlaceholder = toolbarView.placeholder.length ? toolbarView.placeholder : @"";
savedInputToolbarPlaceholder = toolbarView.placeholder;
}

toolbarView.placeholder = nil;
Copy link
Member Author

@Velin92 Velin92 Oct 19, 2022

Choose a reason for hiding this comment

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

This code was a bit unreliable so I improved it, since sometimes it removed the placeholder text when the height of it did change, without restoring it properly.
In reality I think most of the code of this function can safely be removed.

I actually tested removing this code alongside lines 5014 to 5020, and actually the placeholder works fine since both in the new composer and the old composer it uses the redraw contentMode.
And it looked even better on both composers, since the placeholder did even stop blinking

Can I actually just remove it?
@langleyd

@codecov
Copy link

codecov bot commented Oct 19, 2022

Codecov Report

Base: 6.15% // Head: 11.75% // Increases project coverage by +5.60% 🎉

Coverage data is based on head (debf954) compared to base (69aa870).
Patch coverage: 1.21% of modified lines in pull request are covered.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #6938      +/-   ##
===========================================
+ Coverage     6.15%   11.75%   +5.60%     
===========================================
  Files         1590     1592       +2     
  Lines       156596   156638      +42     
  Branches     63190    63255      +65     
===========================================
+ Hits          9633    18418    +8785     
+ Misses      146534   137599    -8935     
- Partials       429      621     +192     
Flag Coverage Δ
uitests 54.84% <14.28%> (?)
unittests 6.14% <0.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
Riot/Modules/Room/RoomViewController.m 0.00% <0.00%> (ø)
...les/Room/Views/InputToolbar/RoomInputToolbarView.m 0.00% <ø> (ø)
...Room/Views/InputToolbar/RoomInputToolbarView.swift 0.00% <0.00%> (ø)
.../WYSIWYGInputToolbar/WysiwygInputToolbarView.swift 0.00% <0.00%> (ø)
...odules/Room/Composer/Model/ComposerViewState.swift 85.00% <ø> (+85.00%) ⬆️
...es/Room/Composer/ViewModel/ComposerViewModel.swift 50.00% <0.00%> (+50.00%) ⬆️
...tSwiftUI/Modules/Room/Composer/View/Composer.swift 90.25% <100.00%> (+90.25%) ⬆️
Riot/Modules/MatrixKit/Models/Account/MXKAccount.m 13.23% <0.00%> (-0.39%) ⬇️
...SwiftUI/Modules/Common/Locale/LocaleProvider.swift 100.00% <0.00%> (ø)
RiotSwiftUI/RiotSwiftUIApp.swift 95.65% <0.00%> (ø)
... and 300 more

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.

@sonarcloud
Copy link

sonarcloud bot commented Oct 19, 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

@ismailgulek ismailgulek left a comment

Choose a reason for hiding this comment

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

LGTM!

@Velin92 Velin92 merged commit 00cf240 into develop Oct 20, 2022
@Velin92 Velin92 deleted the mauroromito/6935_wysiwyg_placeholder branch October 20, 2022 08:04
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 does not have a placeholder text
2 participants