Add filter menu support to home page for V2EX content categories #31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
selectedTabproperty toFeedStateto track the current filter selectionFeedActions.FetchData.Startto accept atabparameter for category-specific data fetchingFeedActions.ChangeTabaction for seamless tab switchingfeedStateReducerto handle tab changes with automatic content refreshUI Implementation
FeedTabFiltercomponent with horizontal scrollable tab pickerFeedPagepositioned above the feed contentBug Fix
Tab.displayName()method inTabInfo.swiftwhich was incorrectly returning empty strings instead of localized category namesUser Experience
The filter menu provides 10 content categories (全部, 技术, 创意, 好玩, Apple, 酷工作, 交易, 城市, 问与答, 最热) with:
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.