[WIP] fix(sticky-header): Make the sticky header and the title header fit together better#1216
[WIP] fix(sticky-header): Make the sticky header and the title header fit together better#1216Zes-MinKey-Young wants to merge 1 commit intoStarCitizenTools:mainfrom
Conversation
|
Warning Rate limit exceeded@alistair3149 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 31 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (3)
WalkthroughRefactors mobile header animations: introduces a new LESS variable for mobile header easing, changes sticky header positioning from top-offset to transform-based offset, and standardizes transition-timing-function usage for header-related components. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
本地MediaWiki上做的测试: 用 用 (觉得您的头像很有意思就拿下来本地测试了,希望您别介意) |
|
Thanks for the PR and the detailed write-up!
mediawiki-skins-Citizen/.editorconfig Line 7 in 2bcc717
I don't mind :) |
| // Instead, ease-out is actually better because fading out with ease-in is laggy. | ||
| // Also, using different timing functions for fade-in and fade-out creates the trouble | ||
| // that we cannot use a single mixin class `.mixin-citizen-sticky-header-element` for both cases. | ||
| @mobile-header-transition-timing-function: var( --transition-timing-function-ease-out ); |
There was a problem hiding this comment.
We can just create a CSS variable (e.g. --transition-timing-function-nav ) directly. Using CSS var makes it accessible for interface admins on wiki, and we don't have to do the @import when we use it in other LESS styles.
For the name, mobile header is not quite right since the page sticky header also uses a transition in the desktop mode.
Visual Studio Code |
|
For VSC, you can change the current line style on the bottom right corner of the UI. Opening the whole repo as a folder should set the right settings too. |
|
The transition plays when the sticky header snaps back to the position, which looks a bit out of place: Recording.2025-12-09.213317.mp4 |
|
@alistair3149 目前3.11顶部标题栏用的是 所以在我的提交中,我让 如果标题顶栏也用 |
That might be the reason why |
赞同,不过我们要不要把标题顶栏改成基于 |
Hmm that is a good question. I do want to avoid using |
我又来了。
讲个笑话,我跑linter给我报了28351个错误,全是“行尾序列应为Unix风格(LF)”的错误😂。
我把标题栏进入和收回的缓动都改成了
ease-out。(请看注释)尽管有人可能会认为这个不对称,我觉得还好,毕竟以前的版本其实也没有用ease-in。而且这样我们就可以用一个LESS混入类解决问题。但是我遇到了点困难。我把sticky header的定位改为了
top: 0,位置变换完全由transform处理。(您可以试试用top,它不如用transform严丝合缝。)这样一来虽然说贴合更好了,但是定位不太对了,如果快速翻向文件页顶部,这个吸顶的文件页目录会明显地跳一下。一个解决办法是把标题栏改成也必须用
top的。我不知道这合不合适。请帮我解决这个问题,然后合并修改,谢谢。
Machine translated:
Hello again!
A (not so) little linting story: The linter reported 28,351 errors all of which were about "Line ending sequences should be Unix-style (LF)". Let's just say I had a fun time scrolling through those 😂.
Animation Easing: I've changed the easing curves for both the title bar's expand and collapse animations to ease-out. (Please see the code comments). While some might consider this asymmetrical, I think it's acceptable because the previous version didn't use
ease-ineither. The main advantage is that we can now handle both states using a single LESS mixin.Sticky Header Positioning Challenge: I encountered a slight issue while working on the sticky header. I changed its positioning to use top: 0, intending to handle all movement solely through
transformfor better performance/consistency (You can try usingtopfor animations; it's not as seamless astransform). While this makes the positioning tighter, it introduced a new problem. e.g. When quickly scrolling to the top of a file page, the sticky ToC now has a noticeable jump.A potential fix is to adjust the title bar's styling so it mustalso be positioned using top. I'm not entirely sure if this is the appropriate approach or if it might have unintended side effects. Could you please advise on the best way to resolve this jumping issue?
Please help me fix the issue before merging. Thanks.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.