A bug which only affected left-handed users

A bug which only affected left-handed users

一个只影响左撇子用户的 Bug

Verily, some of our brethren (and sistren) be afflicted with a sinister disposition. While the righteous scroll using the thumb of their right hand - as is good and proper - an accurs’d minority swing the other way. Look, you try writing an interesting bug report without sounding like a clanker, OK!

诚然,我们的一些兄弟姐妹患有一种“邪恶”的倾向(注:英文 sinister 原意为左,亦有邪恶之意)。当正义之士用右手拇指滑动屏幕——正如理所应当的那样——一小撮被诅咒的少数派却反其道而行之。听着,你自己试着写一份有趣的 Bug 报告,同时还不让自己听起来像个机器人试试看!

I try to optimise my blog as much as possible. It may not look like much, but it has got it where it counts. I’ve made a lot of special modifications myself to the base WordPress install. One of those modifications is reducing the amount of JavaScript in use to the bare minimum. Everything functions without it, but there are a few places where it helps - the most notable being comments.

我尽量优化我的博客。它看起来可能不怎么样,但在关键地方绝不含糊。我对 WordPress 的基础安装做了很多特殊的修改。其中一项修改是将 JavaScript 的使用量降至最低。即便没有 JS,一切功能也能正常运作,但在某些地方它确实有帮助——最显著的就是评论区。

That’s why I was distressed when a loyal reader wrote in saying there was a bug on my site. When they were scrolling the page a comment box would suddenly appear and interrupt their browsing. I scroll my own site a lot (probably more than is healthy) so why hadn’t I noticed this bug? Because I scroll with my right thumb and the bug reporter uses their left. The “reply” link which was being triggered is on the left side of the page.

这就是为什么当一位忠实读者写信告诉我网站有个 Bug 时,我感到很苦恼。当他们滚动页面时,评论框会突然弹出并打断他们的浏览。我经常滚动自己的网站(可能多到不健康的地步),为什么我没发现这个 Bug?因为我用右手拇指滚动,而报告 Bug 的读者用的是左手。被触发的“回复”链接正好位于页面左侧。

A bug which won’t be triggered by righteous people but infuriating to those who will surely be left behind after The Rapture™. To be fair, this bug was reported seven years ago - but I guess the WordPress team have been too busy cleaning up after their mad God-Emperor to take a look at it.

这是一个正义之士不会触发,但会让那些注定在“被提携”(The Rapture™)后被抛弃的人感到愤怒的 Bug。平心而论,这个 Bug 七年前就被报告了——但我猜 WordPress 团队一直忙于为他们疯狂的“神皇”收拾烂摊子,没空理会它。

Back in 2017, a developer added a touchstart listener to link clicks. I don’t really understand why. At one point in history, browsers couldn’t be sure if a touch event was the start of a click or a double-tap to zoom. So firing an event when a touch occurred on a link sort of made sense to avoid a 300ms delay. But that hadn’t been the case for several years - as this 2013 blog post makes clear. Even in 2015 it was no longer an issue. So why was this lefty-baiting code added? Not a clue.

回到 2017 年,一位开发者在链接点击事件中添加了一个 touchstart 监听器。我实在不明白为什么。在历史上某个时期,浏览器无法确定触摸事件是点击的开始还是双击缩放。因此,在链接上发生触摸时触发事件,在某种程度上是为了避免 300 毫秒的延迟。但正如这篇 2013 年的博文所言,这种情况已经多年不存在了。甚至在 2015 年,这就不再是个问题了。那么,为什么要添加这段专门针对左撇子的代码呢?毫无头绪。

Anyway, seven years after the bug was reported I committed a fix. It isn’t the most sophisticated change to WordPress - merely deleting a couple of lines. But hopefully it will stop those strange and unusual mutants from complaining that their unnatural thumb-usage is accidentally triggering unwanted events on my website.

总之,在 Bug 被报告七年后,我提交了一个修复程序。这并不是对 WordPress 最复杂的修改——仅仅是删除了几行代码。但希望这能阻止那些奇怪的变种人抱怨他们那“不自然”的拇指使用习惯意外触发了我网站上不必要的事件。

Sadly, there is as yet no way to prevent the corrupt from using our blessed sites. The WHAT-WG haven’t seen fit to take on board my suggestion of <meta handed="right"> to keep out the unwanted and polluted. So, hopefully, this change will at least prevent them complaining. Why, yes officer, I have had a glass or two of tonic wine. Why do you ask?

遗憾的是,目前还没有办法阻止那些堕落者使用我们神圣的网站。WHAT-WG 并没有采纳我提出的 <meta handed="right"> 建议,以将那些不受欢迎和被污染的人拒之门外。所以,希望这个改动至少能让他们闭嘴。啊,是的警官,我确实喝了一两杯汤力酒。你问这个干嘛?