Skip to content

Conversation

@graycreate
Copy link
Member

Summary

  • Only show section titles in Explore tab when the corresponding data is available
  • Prevents empty section headers from appearing during initial network loading

Changes

  • Added conditional checks for each section in ExplorePage.swift:
    • 今日热议 section only shows when dailyHotInfo is not empty
    • 最热节点 section only shows when hottestNodeInfo is not empty
    • 新增节点 section only shows when recentNodeInfo is not empty
    • 节点导航 section only shows when nodeNavInfo is not empty

Test plan

  • Open the app and navigate to the Explore tab
  • Verify that section titles don't appear before data loads
  • Verify that all sections appear correctly after data loads
  • Pull to refresh and confirm behavior is consistent

🤖 Generated with Claude Code

Only show section titles when the corresponding data is available,
preventing empty section headers from appearing during initial load.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings December 21, 2025 06:49
Copy link

Copilot AI left a comment

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 fixes a UI issue where section titles appeared in the Explore tab even when their corresponding data hadn't loaded yet, resulting in empty headers during the initial network loading phase.

Key Changes:

  • Wrapped all four sections in conditional statements that check if their respective data arrays are non-empty before rendering
  • Applied the same pattern consistently across "今日热议" (Today Hot), "最热节点" (Hot Nodes), "新增节点" (New Nodes), and "节点导航" (Node Navigation) sections

Comment on lines +58 to +61
} header: {
SectionTitleView("今日热议")
.listRowInsets(EdgeInsets())
.listRowBackground(Color.itemBg)
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

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

The first section header includes .listRowInsets(EdgeInsets()) while the other three section headers (lines 75-76, 90-91, 105-106) do not. This inconsistency will cause the section titles to have different padding/insets, which may result in misaligned headers across the Explore page. All section headers should have consistent styling.

Copilot uses AI. Check for mistakes.
@graycreate graycreate merged commit d3be77a into main Dec 21, 2025
12 checks passed
@github-actions
Copy link

Code Coverage Report ❌

Current coverage: 34.22%

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants