-
Notifications
You must be signed in to change notification settings - Fork 293
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 note rendering for those that contain previewable items or leading and trailing whitespaces #2890
base: master
Are you sure you want to change the base?
Conversation
} | ||
|
||
func abbrev_pubkey(_ pubkey: String, amount: Int = 8) -> String { | ||
func abbrev_identifier(_ pubkey: String, amount: Int = 8) -> String { |
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.
Renamed because it was already abbreviating more than only pubkeys.
Hmm, there's a bug rendering invoice strings in the selectable view. |
OK, fixed it in my second commit. Screen.Recording.2025-03-01.at.8.43.08.PM.mov |
Oh, there's another issue that I didn't account for. If there are multiple consecutive previewable blocks at the end of the note content, their text should probably be hidden. I'll work on that. |
d1a7961
to
2ccd3d3
Compare
OK, fixed. PR is ready for review again. |
Thanks @tyiu, I will take a close look at this PR soon (probably in a few days), I just need to get through 2 other items first! I added this to my list on this cycle. |
…g and trailing whitespaces Changelog-Fixed: Fixed note rendering for those that contain previewable items or leading and trailing whitespaces Closes: damus-io#2187 Signed-off-by: Terry Yiu <[email protected]>
Changelog-Added: Added inline note rendering of invoices to pull up wallet selector sheet Signed-off-by: Terry Yiu <[email protected]>
82fcf12
to
ab58a94
Compare
we really should have some tests for these |
Agreed. I can do it as part of this PR if you feel that we need it before merging. It's always harder when there's no tests to begin with, but better now than never! |
Summary
There are several issues with rendering notes:
This PR fixes it so that:
Closes: #2187
Checklist
Closes:
orFixes:
tags in the commit messages wherever applicable, or made sure those are not needed. See Submitting patchesTest report
Please provide a test report for the changes in this PR. You can use the template below, but feel free to modify it as needed.
Device: iPhone 16 Pro Simulator
iOS: iOS 18.3.1
Damus: 2ccd3d3
Steps:
nevent1qqsgv35vzvyl4eesqm8quk33jgxkddgvvnxntj3r75nk5jkwljgr4vgyx2pse

nevent1qqs04gq030x3ew3mgdumy2j324lpww08enx6q06yldmqmv43vr05x9gpz3mhxue69uhhyetvv9ujumn0wd68ytnzvuq36amnwvaz7tmwdaehgu3dwp6kytnhv4kxcmmjv3jhytnwv46qzxrhwden5te0wfjkccte9ehx7um5wfshg6fwvdhk6qg4waehxw309ajkgetw9ehx7um5wghxcctwvsx36csg

nevent1qqsv9z59d39e47j86577sun65a5a7pqac0hmqjxfzzvh8mqzz0m7facpz3mhxue69uhhyetvv9ujuerpd46hxtnfduq3vamnwvaz7tmjv4kxz7fwdehhxarj9e3xzmnyqyvhwumn8ghj7mn0wd68ytnsd3jkycmgv95kutn0wfnszrthwden5te0dehhxtnvdakqra33mf

nevent1qqs2qk90sjcwqmn87kclvf5hr23qurafksplsmf30ster4pn7f9rxgqppamhxue69uhkummnw3ezumt0d5q3samnwvaz7tmjv4kxz7fwdehhxarj9e3k7mfwv96szxthwden5te0vfhhxarj9ehx76m0w3shymewwahhy6cpzemhxue69uhkzarvv9ejumn0wd68ytnvv9hxgxl0wqu

nevent1qqsfzsfgv4qcp2pmrkxjrpxygzjhvpx723qsr0mpy6hxcxcej26u0lgpz3mhxue69uhhyetvv9ujuerpd46hxtnfduq3vamnwvaz7tmjv4kxz7fwdehhxarj9e3xzmnyqgstvj22wngc5t0687qvak06mt34spm3dl8pqu0ymcv7946xkmv8vps95mdqg

nevent1qqsxxhax8uk9dvguj6mks4awukyvhpazudnmazgs9hjkg365yrchehcpz4mhxue69uhhwmm59eek7anzd96zu6r0wd6qz9thwden5te0vaex2etwwdhh2mpwwdcxzcm9qythwumn8ghj7cmjv4shgu3wdehhxarj9emkjmn9qyd8wumn8ghj7argv4nx7un9wd6zumn0wd68yvfwvdhk6ckaxv2

nevent1qqs2nflv99gw3sqe7jk4vcl2j69r078anwxdl5ls9hhyh4jetmyj22cpzemhxue69uhhyetvv9ujumn0wd68ytnzv9hxgqgswaehxw309ahx7um5wgh8w6twv5qkvamnwvaz7tmxd9k8getj9ehx7um5wgh8w6twv5hkuur4vgchjct4dsuxkvp48yenwdm489k8xafkxajx2dmexcenwae5df6xwet4wa3k66p4dcmnwwpcdsm8smnvdeexwuenw3mx5mtx8a38ymmpv33kzum58468yat9qy28wumn8ghj7un9d3shjtnyv9kh2uewd9hsv67rrj

nevent1qqs8f47tv4mdjkj78a96vg4sh8d2q0nvpwkzggjw7gz4flmhfk6vy4spzpmhxue69uhkummnw3ezuamfdejsz9thwden5te0v4jx2m3wdehhxarj9ekxzmnyqyxhwumn8ghj7mn0wvhxcmmvqy28wumn8ghj7un9d3shjtnyv9kh2uewd9hs8rusn4
Screen.Recording.2025-03-01.at.8.43.08.PM.mov
Results: