-
Notifications
You must be signed in to change notification settings - Fork 41
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
Replybox richtext placeholder with modified behavior #597
Replybox richtext placeholder with modified behavior #597
Conversation
48396fc
to
d8d57b9
Compare
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.
This is looking great. I followed the test plan and it works as advertised. Looks like tests still need to be added, I would suggest looking at this test for reference on how to trigger a mocked event (for you it'll be for focus).
Since you're adding rich text formatting, it would make sense to also update the text for offline mode to include the blue and bold "Sign in" text as you see here: https://app.zeplin.io/project/5c807ea562f734bd2756b243/screen/5cd3b87518e9f734ae0218bb
The design of offline mode is still being discussed and reviewed and being tracked here so it would be sufficient for now to update the text so that:
- "You need to log in to send replies." -> "Sign in to compose or send a reply."
- "to compose or send a reply." is
18px, Montserrat-Regular, rgba(42, 49, 157, 0.6)
- "Sign in" is
Montserrat-Bold, 18px, #2a319d, with letter-spacing 0.25px
e6010b3
to
2938bf2
Compare
This has been added now, but with a few problems: (the greyed out background is not part of the commit) problems:
Having two labels (one for "Sign in" and the other one for the rest) will probably have problems with the localization because one needs to start where the other one ends. I think these two problems are issues on their own and should be left for another PR @creviera I'll finish the tests 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.
letter-spacing 0.25px not implemented: property does not exist in Qt css and also would require another label (in total two labels side-by-side) so that we ca apply the css property individually to each chunk of text
See comment on how to do this here: #503 (comment) (you'll need to use setLetterSpacing
which you can see an example of in various widgets in widgets.py)
I think these two problems are issues on their own and should be left for another PR @creviera
Sounds good to me. Could you please add followup issues?
7a8302d
to
69f12b5
Compare
Previous test was overly complicated and was more an integration test than a unit test. So it was refactored to accommodate the changes of the PR.
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.
There is a bug in the code that I just came across where after you send a reply and click outside of the ReplyBox, the Compose a reply
message no longer appears, even when you click on another source in the source list and then return back to the original source. The ReplyBox remains blank.
To get the default text to show up again you have to click into the reply box and then click out of it again.
Yeah, you're right. I had not thought of that. I'll add a fix shortly |
Cross-posting as it might be relevant here: UX pilot of offline mode is finished #593 (comment) |
If you decide to resolve this issue in this PR, just remember to add a "resolves [issue #]" comment |
I made a fix for this, and added a regression test to make sure I also updated the tests like I suggested in the PR comment since it was a small change. This is ready for a review from someone other than me since I made some changes. |
The commit is fully functional. I just have some questions regarding tests.
Description
Tweaks reply box according to #594:
Fixes #594
Test Plan
Compose a message to [source name]
Checklist
If these changes modify code paths involving cryptography, the opening of files in VMs or network (via the RPC service) traffic, Qubes testing in the staging environment is required. For fine tuning of the graphical user interface, testing in any environment in Qubes is required. Please check as applicable:
Comments
The implementation uses a
QLabel
to act as a fake placeholder. Another alternative was to use theQTextEdit.setPlaceholderText()
, given the constraints that:PlainTextEdit
solves itQTextEdit.setPlaceholderText()
does NOT allow html as inputQTextEdit.setText()
allows for html but for some reason it does not work if we wanted to set it as a "placeholder" (meaning that we cannot setText as soon as the text box is created)