Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 20, 2025

Implemented a comprehensive filter menu system for the V2EX home page, allowing users to browse content by different categories including 技术, 创意, 好玩, Apple, 酷工作, and more.

Changes Made

Core State Management

  • Added selectedTab property to FeedState to track the current filter selection
  • Enhanced FeedActions.FetchData.Start to accept a tab parameter for category-specific data fetching
  • Introduced new FeedActions.ChangeTab action for seamless tab switching
  • Updated feedStateReducer to handle tab changes with automatic content refresh

UI Implementation

  • Created FeedTabFilter component with horizontal scrollable tab picker
  • Integrated filter UI into FeedPage positioned above the feed content
  • Applied consistent styling with visual highlighting for selected tabs
  • Maintains responsive design principles with proper spacing and typography

Bug Fix

  • Fixed Tab.displayName() method in TabInfo.swift which was incorrectly returning empty strings instead of localized category names

User Experience

The filter menu provides 10 content categories (全部, 技术, 创意, 好玩, Apple, 酷工作, 交易, 城市, 问与答, 最热) with:

  • Automatic content refresh when switching between categories
  • Visual feedback with blue highlighting for the selected tab
  • Smooth horizontal scrolling for easy navigation
  • Persistent filter state during app usage

The implementation follows the existing Redux-like architecture pattern and integrates seamlessly with current V2EX API endpoints, ensuring consistent performance and maintainability.

Fixes #3.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: graycreate <5203798+graycreate@users.noreply.github.com>
@github-actions
Copy link

Code Coverage Report ❌

Current coverage: 0%

Copilot AI changed the title [WIP] Filter menu support in home page Add filter menu support to home page for V2EX content categories Sep 20, 2025
Copilot AI requested a review from graycreate September 20, 2025 06:49
Copilot finished work on behalf of graycreate September 20, 2025 06:49
@github-actions github-actions bot added size/M and removed size/XS labels Sep 20, 2025
@github-actions
Copy link

Code Coverage Report ❌

Current coverage: 0%

@graycreate graycreate closed this Sep 23, 2025
@graycreate graycreate deleted the copilot/fix-3 branch September 23, 2025 15:12
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.

Filter menu support in home page

2 participants