Skip to content

fixes: Blank channel page edge case, prevents duplicate history entries on navigation#3410

Merged
tzarebczan merged 1 commit intomasterfrom
fixes-channel-hist
Feb 3, 2026
Merged

fixes: Blank channel page edge case, prevents duplicate history entries on navigation#3410
tzarebczan merged 1 commit intomasterfrom
fixes-channel-hist

Conversation

@tzarebczan
Copy link
Contributor

@tzarebczan tzarebczan commented Feb 3, 2026

Fixes

Issue Number:

What is the current behavior?

What is the new behavior?

Other information

PR Checklist

Toggle...

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting)
  • Refactoring (no functional changes)
  • Documentation changes
  • Other - Please describe:

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I have checked that this PR does not introduce a breaking change
  • This PR introduces breaking changes and I have provided a detailed explanation below

Summary by CodeRabbit

  • Bug Fixes

    • Prevents duplicate browser history entries when navigating to the current page.
    • Improved loading state handling with more granular logic across different content sections.
  • UX Improvements

    • Added "No Content Found" messaging for empty search results and missing playlist content.

…es on navigation

Ensures navigation actions triggered by buttons and tab changes
do not result in duplicate entries in browser history. This prevents
unnecessary back/forward navigation clutter.

Loading indicators are adjusted to prevent flickering when switching
between tabs or when sections are empty.

Fixes an issue where empty playlist sections would not display the
"No Content Found" message.
@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

The changes add duplicate history entry prevention at multiple navigation points (button clicks, tab switches, and store-level) and refactor loading state logic to be more granular based on section type, with explicit empty-state messaging.

Changes

Cohort / File(s) Summary
Navigation Guards
ui/component/button/view.jsx, ui/page/claim/internal/claimPageComponent/internal/channelPage/view.jsx, ui/store.js
Adds guards at button clicks, tab navigation, and store-level history to prevent duplicate entries by comparing current and target paths before navigation.
Loading State & Empty State UI
ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/homeTab/internal/homeTabSection/view.jsx
Refactors loading logic into granular section-type-specific conditions (featured, playlist, channels) and adds a "No Content Found" message when search results are empty or playlist lacks a claim ID.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 No more duplicate paths to explore,
History entries ne'er bloat anymore!
Loading states dance with precision and care,
Empty states whisper when nothing's there. ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: preventing duplicate history entries during navigation and fixing a blank channel page edge case.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fixes-channel-hist

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Failure to add the new IP will result in interrupted reviews.


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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@ui/component/button/view.jsx`:
- Around line 250-254: The click/navigation handler currently prevents
navigation if either path === currentPath or path === window.location.pathname,
which wrongly blocks cases where the current URL has a query string; remove the
second check (path === window.location.pathname) and only call
e.preventDefault() when path === currentPath (where currentPath is
window.location.pathname + window.location.search) so the component behavior
matches the store-level guard in ui/store.js; also update the inline comment to
state you are preventing duplicate history entries by comparing full
pathname+search.

Comment on lines +250 to +254
// Prevent duplicate history entries when navigating to the current page
const currentPath = window.location.pathname + window.location.search;
if (path === currentPath || path === window.location.pathname) {
e.preventDefault();
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Potential over-blocking: second condition may prevent legitimate navigation.

The condition path === window.location.pathname on Line 252 could incorrectly block navigation when the target path has no query string but the current URL does. For example:

  • Current URL: /channel?view=content
  • Target path: /channel

These are different destinations, but the second condition would match and call preventDefault().

Consider removing the second condition to align with the store-level guard in ui/store.js, which only compares full paths (pathname + search):

Proposed fix
         // Prevent duplicate history entries when navigating to the current page
         const currentPath = window.location.pathname + window.location.search;
-        if (path === currentPath || path === window.location.pathname) {
+        if (path === currentPath) {
           e.preventDefault();
         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Prevent duplicate history entries when navigating to the current page
const currentPath = window.location.pathname + window.location.search;
if (path === currentPath || path === window.location.pathname) {
e.preventDefault();
}
// Prevent duplicate history entries when navigating to the current page
const currentPath = window.location.pathname + window.location.search;
if (path === currentPath) {
e.preventDefault();
}
🤖 Prompt for AI Agents
In `@ui/component/button/view.jsx` around lines 250 - 254, The click/navigation
handler currently prevents navigation if either path === currentPath or path ===
window.location.pathname, which wrongly blocks cases where the current URL has a
query string; remove the second check (path === window.location.pathname) and
only call e.preventDefault() when path === currentPath (where currentPath is
window.location.pathname + window.location.search) so the component behavior
matches the store-level guard in ui/store.js; also update the inline comment to
state you are preventing duplicate history entries by comparing full
pathname+search.

@tzarebczan tzarebczan merged commit 2db0627 into master Feb 3, 2026
3 checks passed
@tzarebczan tzarebczan deleted the fixes-channel-hist branch February 3, 2026 17:15
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