維基百科上面有時候會想要看其他語言的頁面,以 Kalafina 這頁來說,想要點開跨國語系的 menu 點日文版頁面的時候,會出現這樣的情況:
游標移上去要點的時候,因為 lazy loading 跑完;DOM 被插入新的 node,造成本來想要的日文版連結跑到下面,然後按快一點的人就點到其他連結... 目前的解法是直接用 uBlock Origin 擋掉那個 node,讓他不要出現:
wikipedia.org##.cx-uls-relevant-languages-banner
這種類型的 UX flaw 在現代愈來愈多了,而且還是各 framework 都推薦的寫法... (各種 useEffect()
類的功能,頁面的結構先出來,再後續讀到內容時再更新頁面)
看到「Creating Perfect Font Fallbacks in CSS」這邊這段時想到的:
With font-display: swap, the browser will first render your text using the fallback typeface you specified in the font-family property[.]
font swapping 也是個讓人吐血的 UX flaw...
Even worse, often time such flaw is wrongfully encouraged by metrics. Imagine you're a front-end engineer and you just committed a new CSS design change. Now you're in A/B test and you noticed that your new version increased ads click rate by 30%. Congratulations right?
Later you realized it was all due to misclicks because the page pushed the ads onto where a popular link was. You tried to revert the change because it is the right thing to do, but now you'll have to convince everyone the click rate drop is not a true regression...
前端有个专门的词语叫 layout shift,Google 有文章作为参考:https://web.dev/articles/cls?hl=zh-tw
不过我周围的开发者(也包括我)大多不会关注这个,code 能执行就已经不错了😂