Skip to content

feature: React migration phase 3 — feed list and feed item - #869

Closed
vibhaseshadri-cognition wants to merge 1 commit into
devin/1791294931-react-phase2-shellfrom
devin/1791295334-react-phase3-feeds
Closed

vibhaseshadri-cognition wants to merge 1 commit into
devin/1791294931-react-phase2-shellfrom
devin/1791295334-react-phase3-feeds

Conversation

@vibhaseshadri-cognition

Copy link
Copy Markdown

Summary

Migration phase 3 (stacked on Phase 2 #867): replaces the Feed placeholder with a port of Angular's FeedComponent + ItemComponent.

  • react/src/feeds/Feed.tsx — fetchFeed(feedType, page, signal) in an effect keyed on [feedType, pageNum]; AbortController aborted in cleanup (unmount/page change), AbortErrors and late responses ignored. Loader → list / ErrorMessage("Could not load {feedType} stories."), window.scrollTo(0, 0) after load, jobs header only for jobs, <ol start={(page-1)*30+1}> with list-margin except on jobs, ‹ Prev (page > 1) / More › (items.length === 30). Root div.main-content[data-testid=feed][data-feed-type][data-page] is rendered in every state.
  • react/src/feeds/FeedItem.tsx — external a.title (target/rel only when openLinkInNewTab) + (domain), or internal /item/:id link; .subtext-palm / .subtext-laptop blocks with user/points/comments hidden for type === 'job'; margin-bottom: {listSpacing}px, title font-size: {titleFontSize}px.
  • SCSS ported to Feed.scss / FeedItem.scss, nested under .feed / .feed-item.
  • Tests: Feed.test.tsx, FeedItem.test.tsx (mocked hackernewsApi, shared factory src/test/feedStories.ts), e2e/feeds.spec.ts + e2e/fixtures/feeds.ts (all 5 feeds: list + /x/1 → /x/2 → /x/1, error state per feed, jobs rows, comments link → /item/:id, ask title → /item/:id).

Parity notes (intentional deviations)

  • Page change shows the loader. Angular kept the old list on screen (with the old start) until the new page arrived and never cleared errorMessage. React resets to loading per request so the list number/nav never go stale and an earlier error doesn't stick.
  • Previous request is aborted on page change/unmount (Angular left subscriptions open).
  • hasUrl tolerates a missing url (item.url?.startsWith('http')); Angular would throw on undefined.
  • Non-numeric page param falls back to 1 (Angular would call the API with NaN).
  • Feed-level anchor styles (bold, hover underline) are scoped to .job-header a / .nav a, matching Angular's view encapsulation where they didn't reach story rows.
  • Root gets an extra feed class (main-content feed) to scope SCSS without bleeding into ItemDetails/UserProfile, which also use .main-content.
  • Angular's no-op *ngIf="feedType !== 'new'" on the <ol> dropped (never false).

Coverage (npm test)

File               | % Stmts | % Branch | % Funcs | % Lines
All files          |     100 |      100 |     100 |     100
 src/feeds         |     100 |      100 |     100 |     100
  Feed.tsx         |     100 |      100 |     100 |     100
  FeedItem.tsx     |     100 |      100 |     100 |     100

Locally: format:check, lint, typecheck, test (107 passed), build, e2e (23 passed) all green.

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/f1105e215c184c1eab62a12bc7f0b06e
Open in Devin Desktop: https://app.devin.ai/desktop/session/f1105e215c184c1eab62a12bc7f0b06e?variant=devin
Requested by: @vibhaseshadri-cognition

@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

…tests (migration phase 3)

Co-Authored-By: Vibha  Seshadri <vibha.seshadri@cognition.ai>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1791295334-react-phase3-feeds branch from 7a2a89a to 52340da Compare October 6, 2026 14:54
@devin-ai-integration

Copy link
Copy Markdown

Closing as part of the nightly demo-repo reset — reopen if this demo artifact is still needed.

@devin-ai-integration
devin-ai-integration Bot deleted the devin/1791295334-react-phase3-feeds branch October 26, 2026 12:11
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