Skip to content

fix(web): avoid rerendering custom homepage content#5633

Open
qinhang3 wants to merge 1 commit into
QuantumNous:mainfrom
qinhang3:classic-home-custom-content-refresh
Open

fix(web): avoid rerendering custom homepage content#5633
qinhang3 wants to merge 1 commit into
QuantumNous:mainfrom
qinhang3:classic-home-custom-content-refresh

Conversation

@qinhang3

@qinhang3 qinhang3 commented Jun 20, 2026

Copy link
Copy Markdown

Summary

  • stop the classic homepage endpoint auto-rotation timer when custom homepage content is configured
  • derive a shared showDefaultHomePage flag for the default homepage branch
  • avoid rerendering injected custom homepage HTML every 3 seconds

Testing

  • verified the classic homepage code path and confirmed the timer now only runs for the default homepage

Summary by CodeRabbit

  • Bug Fixes
    • Improved home page display logic to correctly show the default home page when no custom content is configured.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1cc4fee4-3bc1-4773-9a4d-10e593163ee1

📥 Commits

Reviewing files that changed from the base of the PR and between 5e86644 and 98b4958.

📒 Files selected for processing (1)
  • web/classic/src/pages/Home/index.jsx

Walkthrough

The Home page introduces a computed showDefaultHomePage boolean derived from homePageContentLoaded and an empty homePageContent. This flag replaces the previously duplicated inline condition in two places: the endpoint-rotation useEffect (which now returns early when false and lists the flag as a dependency) and the JSX render branch for the default hero/banner section.

Changes

Home Page Default Content Guard

Layer / File(s) Summary
showDefaultHomePage flag, effect guard, and render condition
web/classic/src/pages/Home/index.jsx
Adds a single derived showDefaultHomePage boolean; the endpoint-rotation useEffect exits early when it is false and includes it in the dependency array; the JSX conditional uses it instead of the previous inline homePageContentLoaded && homePageContent === '' expression.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐇 A flag was born from two checks combined,
showDefaultHomePage — neat and defined.
The effect now guards with an early return,
The JSX reads clean wherever you turn.
One truth to rule them both, the rabbit declared,
And hopped away knowing the logic was shared! 🌟

🚥 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 accurately captures the main objective of the PR - preventing unnecessary re-renders of custom homepage content by disabling the auto-rotation timer. This directly aligns with the changeset's primary purpose.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant