Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of change
Checklist
Related Issue
Fix: #637 (comment)
Changes
initCustomScrollbar()until after animations complete.animation-delayinPostPage.astro.stripOnloadAnimations()removes.onload-animationafter the first animation ends.sessionStorage.onLoadAnimationsDone) so later Swup navigations strip the class immediately.stripOnloadAnimations()in Swup’scontent:replaceto handle newly injected DOM.How To Test
Use DevTools to throttle traffic speed as 4G slow/3G to check if the page is still being reloaded.
Additional Notes
Root cause:
Swup swaps the page DOM without reloading assets. Elements that still have
.onload-animationget reinserted on eachcontent:replace, so the CSS keyframes restart and the navbar/post cards appear to “refresh” even though nothing is actually reloaded.In conclusion:
Animation class is the trigger. Removing
.onload-animationafter the first run stops keyframes from restarting when Swup replaces the DOM. A session flag preserves this behavior across in‑app navigations for the rest of the session.Others
I had a really rough morning. After 11 hours of trying to find a complete fix (I was only able to partially mitigate it), I still couldn’t solve the problem. For the next 5 hours, the coding AI kept telling me there was no fix and urged me to give up. I hadn’t slept for nearly 24 hours and felt overwhelmed - almost like the AI was pressuring me.
So let me summarize how this happens.
The reason why I said this was not related to swup is because I remove the following code, as the solution was to remove swup (and then nothing resolved):
fuwari/astro.config.mjs
Lines 36 to 49 in 6d39b0d
As of now, I asked GPT how this happens, and it told me the reason:
So, GPT seconds my initial conclusion, and I was partially right. But before I find out this, I was struggling on changing configuration like
config.cache,config.preloadfor a long time (I totally have no idea what I am configuring as I don't have knowledge of this, so for a long time I thought this was my own problem), unless I find out none of these change anything and decide to disable the whole swup and find out the issue persists.This is so despairing cuz I already spent hours on useless thing.
At the time, I decide to disable animation like what I mentioned in #637 (comment):
Since this started working, I began tracing the issue in
Layout.astroand found thatinitCustomScrollbar()was causing the problem. More time passed.But changing code of
initCustomScrollbar()hit the dead end. I gave up, and the progress I made after then is as below:Summary from GPT:
Besides of this, I also remove staggered per-card
animation-delayinPostPage.astro.This solution will mitigate the issue: navbar no longer refresh but the post cards are now instant flashing. Whatever, already much better than fully reload.
But this is not full fix. This is mitigation. At the time I already gave up thinking anything and decide to hand in coding AI to let it made decision. And this is where the nightmare starts:
The coding AI tried some approaches, failed for another hour. And then told me to give up.
I changed to Copilot, and it asked me to use gsap.
I changed to whatever again, and it kept modifying "4000ms" to other values and asked me to build and test.
...
I was in high pressure because I kept being asking to give up and being given craps.
After watching the network tab and console log for a long time, the AI figures out that it can use sessionStorage to store a flag and then remove
onload-animationclass (reference).Then the rest of the part is to refine the code and try to pass
astro checkas this is the correct approach.During the whole debugging process, I built 79 times and lost patience partway through. Maybe the coding AI sensed something was off and told me to give up, that I will never know the true reason.
The next day I woke up and remembered what I’ve done before. I have just one comment:
I feel sorry for being a noob.
I’ve been using this blog theme for more than two years. I know I’m not a professional, but since no one fixed the issue, I had to do it myself.
Even when it was actively maintained in the past, no one implemented fundamental enhancements like OG images.
When someone not professional like me have to do the professional thing, it is really driving me crazy.

Vibe coding helps me to learn, so I decided to trying fixing issue. I know "vibe coding" itself may trigger some kind of group, but what can I do when seeing a bug is not being fixed for 2 years when I am using it? I tried to avoid, but there is no other way. I can't just waste another year and then fix it because may be there will be another "another year" after that "another year".
(Caption: last commit of
initCustomScrollbar())So, I decide to do it now. I did the test, and not always follow what coding AI gives. I tried to think what the AI is giving me. I already did the best I can do.
I'm not sure when the maintainers will check this repository again. Maybe you could add a "Sponsor" section and use the service like Ko-fi to accept funds, if that would help maintain the project. Because no one knows when a noob like me have to deal with such bugs, what consequences (bugs) they can introduce.