Bitcoin Forum

Other => Meta => Topic started by: logfiles on April 14, 2024, 09:47:36 PM



Title: Long codes messing up the post history appearance. Solutions?
Post by: logfiles on April 14, 2024, 09:47:36 PM
Long codes are easily fit in a code box with left to right scroll buttons, and this makes the whole thread neat in the default Bitcointalk pages. However, if you check the post history of a user who recently posted a long code, it's a completely different story where the entire page is stretched based on the length of the code.

Why aren't the long codes in the post history displayed in the same way they appear in threads?

Example:
1. My post containing a long code - https://bitcointalk.org/index.php?topic=5492490.0 (Very neat)
2. My post history containing one of the posts with a long code - https://bitcointalk.org/index.php?action=profile;u=1247226;sa=showPosts (Very messy)


Title: Re: Long codes messing up the post history appearance. Solutions?
Post by: PX-Z on April 14, 2024, 11:04:08 PM
It's a known long time website look issue, it's the same thing for those big block images posted in ANN threads if the width is not set and the image is too large then it become like that on user post history. Unfortunately, theymos never fix it, well, unless PowerGlove do something to it.


Title: Re: Long codes messing up the post history appearance. Solutions?
Post by: logfiles on April 14, 2024, 11:58:54 PM
It's a known long time website look issue, it's the same thing for those big block images posted in ANN threads if the width is not set and the image is too large then it become like that on user post history. Unfortunately, theymos never fix it, well, unless PowerGlove do something to it.
Is it sort of bug?
I mean, if it's possible for the codes to appear neatly in the threads, then they surely should be able to replicate the same when one is viewing the post history


Title: Re: Long codes messing up the post history appearance. Solutions?
Post by: PX-Z on April 15, 2024, 02:57:31 AM
It's a known long time website look issue, it's the same thing for those big block images posted in ANN threads if the width is not set and the image is too large then it become like that on user post history. Unfortunately, theymos never fix it, well, unless PowerGlove do something to it.
Is it sort of bug?
I mean, if it's possible for the codes to appear neatly in the threads, then they surely should be able to replicate the same when one is viewing the post history
Looks like it.

I checked and compared both page, the difference is that the post history doesn't have this style "table-layout: fixed;" but if you will put this style on the table tags, the wide code tags content will be fixed but the dates and titles is affected, so putting width will fix it.

I just made a script to make it work, you can put it on any browser extension like Tampermonkey and Greasemonkey. Or you can try it first in the console of your desktop browser.

Code:
var urlString = window.location.href;
// Check if the URL contains "sa=showPosts"
if (urlString.indexOf("sa=showPosts") !== -1) {
  var tables = document.querySelectorAll("table.bordercolor[width='100%'][cellpadding='4']");
  tables.forEach(function(tables) {
    tables.style.tableLayout = "fixed";
  });

  var tds = document.querySelectorAll("table.bordercolor[width='100%'][cellpadding='4'] tr.titlebg2 >td:first-child");
  for (var i = 0; i < tds.length; i++) {
      tds[i].style.width = '15px';
  }
}


Title: Re: Long codes messing up the post history appearance. Solutions?
Post by: LoyceV on April 15, 2024, 09:31:58 AM
1. My post containing a long code - https://bitcointalk.org/index.php?topic=5492490.0 (Very neat)
2. My post history containing one of the posts with a long code - https://bitcointalk.org/index.php?action=profile;u=1247226;sa=showPosts (Very messy)
If you check the same post in my posts archive (https://loyce.club/archive/posts/6393/63933604.html) or (once in a while) in my notification bot (https://bitcointalk.org/index.php?topic=5331343.0), it's very neat again. That makes me think it's a css thing (https://loyce.club/notifications/theymos.css) that may be very easy to fix.


Title: Re: Long codes messing up the post history appearance. Solutions?
Post by: dkbit98 on April 15, 2024, 08:38:59 PM
Why aren't the long codes in the post history displayed in the same way they appear in threads?
I never liked those stretched pages, mostly when I search post history, and I think it happened even with some signature codes that are not so long.
I don't know why this is happening but it is probably a bug and looks like it's time for another PowerGlove SMF forum patch  :D


Title: Re: Long codes messing up the post history appearance. Solutions?
Post by: Faisal2202 on April 15, 2024, 08:59:28 PM
to OP: I got confused after opening your profile posts history, I thought you were done here, hehe, as the page was clean, and I did not see the empty space, I thought the code (scammer's) you have provided in the last post, somehow did something, well, I just wasted around 7 minutes on figuring it out, lazy me. Well, AFAIK remember ANN also does the same thing but our other posts remain on the left side of the page CMIIW.
I just made a script to make it work, you can put it on any browser extension like Tampermonkey and Greasemonkey. Or you can try it first in the console of your desktop browser.
The script worked just fine, it's a good thing, I hope the admin will consider this contribution and solve this error ASAP. As a lot of time will be saved, I never faced this error in code tags, but yeah faced it due to ANN threads. Thanks, dear PX-Z you are doing great work, Thanks for making this script. I just wanted to know how you know the table name, or row name, or title name, on that page. Is there any other script to extract such data?

I actually wanted to learn it. Thanks. 


Title: Re: Long codes messing up the post history appearance. Solutions?
Post by: PX-Z on April 15, 2024, 10:44:50 PM
I just wanted to know how you know the table name, or row name, or title name, on that page. Is there any other script to extract such data?
You can inspect element your post history or anywhere in this forum to check that every box like UI/look is made with table tags. For me to manipulate all affected tags since there's no class name or id i just use the table, its attributes and its value, also the ":nth-child()" selector. In this case i just use ":first-child" selector since i just need only the first "td", you will need the latter if you need the other nth in order of tags (parent > child)


Title: Re: Long codes messing up the post history appearance. Solutions?
Post by: PowerGlove on April 16, 2024, 02:50:35 PM
I don't know why this is happening but it is probably a bug and looks like it's time for another PowerGlove SMF forum patch  :D
Jeebus, I'm busy, yo. You can't just say "PowerGlove" every time this forum needs patchin'. (I'm just kidding, you totally can.) ;D

Hang on... I've already done (https://bitcointalk.org/index.php?topic=5432954) this one, haven't I? :-\

(In all seriousness, this problem has already been fixed, but it fell off of theymos' radar and has just been collecting dust. I recently reminded theymos about it, and I'm pretty certain he'll accept/merge the patch once I'm finished with one last testing/polishing pass. It's good/fortunate timing that logfiles posted a new topic about this, though, because the approach that PX-Z came up with a few posts up is smarter/neater than the approach I used originally, so I'll probably end up revising the patch as a result. @PX-Z: Nice job, man!)

That makes me think it's a css thing (https://loyce.club/notifications/theymos.css) that may be very easy to fix.
I mean, you're not wrong, and there is a simple CSS fix for this (see shahzadafzal's posts here (https://bitcointalk.org/index.php?topic=5432954.msg61541870#msg61541870) and here (https://bitcointalk.org/index.php?topic=5432954.msg61549533#msg61549533)).

But, if you look at the stylesheet, it's pretty obvious that the SMF devs didn't want [code] to be presented that way (with "wrapped" contents), and I agree with them. So, while the simple CSS tweak is tempting, I don't think that's the right solution here: changing how code renders in response to a pretty specific layout bug seems clumsy/ill-considered to me.

(BTW, last time this came up, you mentioned (https://bitcointalk.org/index.php?topic=5432954.msg61785305#msg61785305) something similar happening when replying to wide-code-containing PMs: I've got a patch for that, too, and I'll include it when I update that topic.) ;)