Skip to content

fix: restore default card icons after back-navigation - #1214

Open
khushal-winner wants to merge 1 commit into
layer5io:masterfrom
khushal-winner:bug/khushal-winner/1209
Open

fix: restore default card icons after back-navigation#1214
khushal-winner wants to merge 1 commit into
layer5io:masterfrom
khushal-winner:bug/khushal-winner/1209

Conversation

@khushal-winner

@khushal-winner khushal-winner commented Aug 21, 2026

Copy link
Copy Markdown

Fixes #1209

Changes

content/en/_index.md: added a pageshow listener that resets each
card icon to its data-default image via the existing restoreImage
helper when the homepage is restored from the back/forward cache.

Why

On iOS (Safari and Chrome), tapping a card fires mouseover, but
mouseout never runs because navigation interrupts it. The page is then
restored from WebKit's cache with the hover icon still set, and nothing
resets it. Android is unaffected; this change is a no-op there.

Tested locally with npm run build; needs a physical iPhone check on the
preview deployment to confirm the fix.

Signed commits

  • Yes, I signed my commits.

Summary by CodeRabbit

  • Bug Fixes
    • Documentation button images now reliably return to their default appearance when revisiting a page, including through browser back and forward navigation.

Copilot AI lite review requested due to automatic review settings August 21, 2026 14:10
@welcome

welcome Bot commented Aug 21, 2026

Copy link
Copy Markdown

Yay, your first pull request! 👍 A contributor will be by to give feedback soon. In the meantime, please review the Layer5 Community Welcome Guide and sure to join the community Slack.
Be sure to double-check that you have signed your commits. Here are instructions for making signing an implicit activity while peforming a commit.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@khushal-winner, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 32f07c18-e328-44e6-8d3a-3cd09c4b7dda

📥 Commits

Reviewing files that changed from the base of the PR and between 086d8b6 and 02459a2.

📒 Files selected for processing (1)
  • content/en/_index.md

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 60f84c6e-5534-45fd-9581-58425bd1a7f2

📥 Commits

Reviewing files that changed from the base of the PR and between a155743 and 086d8b6.

📒 Files selected for processing (1)
  • content/en/_index.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The documentation homepage now restores each documentation card image from its default source when the page is shown, including browser back and forward navigation.

Changes

Card icon restoration

Layer / File(s) Summary
Page-show image reset
content/en/_index.md
A pageshow listener finds .l5btn links and restores each nested image from its data-default source.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 086d8

This is a localized browser-behavior fix for restoring card icons after back-navigation, with no actionable merge-blocking risk remaining beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes restoring default card icons after browser back-navigation.
Linked Issues check ✅ Passed The change adds a pageshow handler that restores card icons after navigation, meeting issue #1209 requirements.
Out of Scope Changes check ✅ Passed The changes are limited to the homepage card-icon restoration required by issue #1209.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an iOS BFCache back-navigation behavior where homepage card icons can remain stuck in their hover state by resetting each card icon back to its default image on pageshow.

Changes:

  • Add a pageshow event listener to restore each homepage card icon to its data-default image using the existing restoreImage helper.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread content/en/_index.md Outdated
Signed-off-by: Khushal Malhotra <redmi5a3217@gmail.com>
@khushal-winner
khushal-winner force-pushed the bug/khushal-winner/1209 branch from 086d8b6 to 02459a2 Compare August 21, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Card icons render incorrectly on iPhone (Safari & Chrome) after back-navigation

2 participants