Phase 5: Item Details & Recursive Comments#313
Open
vibhaseshadri-cognition wants to merge 5 commits into
Open
Conversation
- Replace Angular build config with Vite + React 18 setup - Create vite.config.ts, tsconfig.json, package.json with React deps - Add entry points: src/main.tsx, src/App.tsx, index.html - Port SCSS theming files (_themes.scss, _theme_variables.scss, _media.scss) - Define TypeScript interfaces in src/types/ (Story, Comment, User, Settings, PollResult, FeedType) - Move static assets to public/ directory for Vite serving - Remove Angular-specific files: angular.json, tsconfig.app/spec.json, tslint.json, karma.conf.js, ngsw-config.json, browserslist, polyfills.ts, test.ts, all *.module.ts files - Remove Angular dependencies, add react, react-dom, react-router-dom v6 - Verify npm run dev starts and app shell renders Co-Authored-By: Vibha Seshadri <vibha.seshadri@cognition.ai>
- Add src/services/hackernews-api.ts: fetchFeed, fetchItemContent (with poll sub-fetching via Promise.all), fetchPollContent, fetchUser using plain fetch - Add src/contexts/SettingsContext.tsx: React Context + useReducer for Settings state, localStorage persistence, system dark mode detection with matchMedia listener - Add src/components/shared/Loader.tsx + SCSS: CSS loading animation ported from Angular - Add src/components/shared/ErrorMessage.tsx + SCSS: skull error display ported from Angular - Add src/utils/formatComment.ts: replaces Angular CommentPipe (0→'discuss', 1→'1 comment', n→'n comments') - Update tsconfig.json include paths for new directories Co-Authored-By: Vibha Seshadri <vibha.seshadri@cognition.ai>
- Add Header with NavLink navigation, logo, settings toggle, scrollTo(0,0) on nav clicks - Add Footer with static content matching Angular template - Add Settings panel with theme radios, open-in-new-tab checkbox, font size and list spacing inputs - All components consume SettingsContext - Port all SCSS styles from Angular components Co-Authored-By: Vibha Seshadri <vibha.seshadri@cognition.ai>
- FeedPage: paginated feed with loader/error states, 30 items/page, prev/more navigation - ItemRow: story row with external/internal link logic, domain, points, user, time_ago, comment count - Respects settings: titleFontSize, listSpacing, openLinkInNewTab - Mobile/laptop responsive layouts via subtext-palm/subtext-laptop - Jobs feed special header text - SCSS ported from Angular feed and item components Co-Authored-By: Vibha Seshadri <vibha.seshadri@cognition.ai>
- ItemDetailsPage: fetches item by ID, back button via useNavigate(-1), poll results with percentage bars, dangerouslySetInnerHTML for content, mobile/laptop responsive layouts - Comment: recursive rendering of nested comments, collapse/expand toggle, deleted comment display - SCSS ported from Angular item-details and comment components Co-Authored-By: Vibha Seshadri <vibha.seshadri@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 was referenced Jun 9, 2026
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 the item details page and recursive comment component.
ItemDetailsPage (
src/pages/ItemDetailsPage.tsx):fetchItemContent, shows Loader/ErrorMessageuseNavigate(-1)(mobile)width: points/poll_votes_count*100%bar per optiondangerouslySetInnerHTMLComment (
src/components/comments/Comment.tsx):comment.commentschildren[+]/[-][deleted] | Comment DeleteddangerouslySetInnerHTMLDepends on Phase 4 (#312).
Link to Devin session: https://app.devin.ai/sessions/0bb1dd94ecbc4422a76b7a458d0f4e7c
Requested by: @vibhaseshadri-cognition
Devin Review