React migration: Full component implementation#326
Open
devanshi-gpta wants to merge 1 commit into
Open
Conversation
…s, and PWA Implements the complete Angular → React migration: - TypeScript interfaces for all models (Story, Comment, User, PollResult, Settings) - API service using native fetch (replaces Angular HttpClient + RxJS) - Settings context with React Context + localStorage persistence - All SCSS styles ported with theming (default, night, AMOLED black) - Components: Header, Footer, SettingsPanel, Feed, FeedItem, Comment, ItemDetails, UserProfile, Loader, ErrorMessage - React Router v6 with all feed routes, item details, user profiles - PWA configuration via vite-plugin-pwa with workbox runtime caching - Utility functions (formatComment pipe replacement) Co-Authored-By: Devanshi Gupta <devanshi.gupta@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Implements all components, services, and configuration for the Angular → React migration on top of the scaffolding from PR #322. This completes the 17 planned child-session tasks in a single PR.
Architecture:
models/types.ts— TypeScript interfaces (Story,Comment,User,PollResult,Settings) +FeedType/Themeunion types replacing Angular classesapi/hn-api.ts—fetch-based API layer (fetchFeed,fetchItemContent,fetchUser) replacingHackerNewsAPIService+ RxJS Observables; polls are fetched withPromise.allcontext/SettingsContext.tsx+useSettings.ts— React Context replacing Angular'sSettingsService; persiststheme,openLinkInNewTab,titleFontSize,listSpacingtolocalStorage; respectsprefers-color-scheme: darkmedia queryApp.tsx—BrowserRouter+Routesmatching the Angular route config:/:feedType/:page,/item/:id,/user/:idwithNavigateredirect from/to/news/1Components ported 1:1 from Angular:
Header,Footer,SettingsPanel,Feed,FeedItem,Comment(recursive),ItemDetails(with poll support),UserProfile,Loader,ErrorMessageStyles: All SCSS ported including the theme mixin system (default/night/AMOLED black), media queries, and component-specific styles.
PWA:
vite-plugin-pwaconfigured withautoUpdate, manifest icons, and WorkboxNetworkFirstruntime caching for the HN API.tsc -b,eslint, andvite buildall pass clean.Link to Devin session: https://app.devin.ai/sessions/a1e65eb5f0104fdb81ade88690b7fff8
Requested by: @devanshi-gpta
Devin Review