Skip to content

Phase 4: Feed Feature (FeedPage + ItemRow)#312

Open
vibhaseshadri-cognition wants to merge 4 commits into
masterfrom
devin-06.09.2026-vibha/react-migration-phase4
Open

Phase 4: Feed Feature (FeedPage + ItemRow)#312
vibhaseshadri-cognition wants to merge 4 commits into
masterfrom
devin-06.09.2026-vibha/react-migration-phase4

Conversation

@vibhaseshadri-cognition

@vibhaseshadri-cognition vibhaseshadri-cognition commented Jun 9, 2026

Copy link
Copy Markdown

Summary

Implements the paginated feed list and story row components.

FeedPage (src/pages/FeedPage.tsx):

  • Reads feedType prop + page from URL params, fetches via fetchFeed(feedType, pageNum)
  • Shows Loader while loading, ErrorMessage on failure
  • Renders <ol start={(page-1)*30+1}> with ItemRow per item
  • Jobs feed: special header text, no numbering
  • Pagination: "Prev" (if page > 1), "More" (if items.length === 30)

ItemRow (src/components/feeds/ItemRow.tsx):

  • External link (href) if URL starts with http, otherwise internal Link to /item/:id
  • Domain, points, user link, time_ago, comment count via formatComment
  • Respects titleFontSize, listSpacing, openLinkInNewTab from settings
  • Mobile (subtext-palm) vs laptop (subtext-laptop) responsive layouts

Depends on Phase 3 (#311).

Link to Devin session: https://app.devin.ai/sessions/0bb1dd94ecbc4422a76b7a458d0f4e7c
Requested by: @vibhaseshadri-cognition


Devin Review

Status Commit
⚪ Not started

Run Devin Review

💡 Connect your GitHub account to enable automatic code reviews.

Open in Devin Review (Staging)

devin-ai-integration Bot and others added 4 commits June 9, 2026 16:57
- 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>
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant