Skip to content

React migration: ItemDetails + CommentItem components#439

Merged
devin-ai-integration[bot] merged 1 commit into
devin/1783534263-react-migrationfrom
devin/react-itemdetails-comment
Jul 8, 2026
Merged

React migration: ItemDetails + CommentItem components#439
devin-ai-integration[bot] merged 1 commit into
devin/1783534263-react-migrationfrom
devin/react-itemdetails-comment

Conversation

@devanshi-gpta

@devanshi-gpta devanshi-gpta commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Ports the Angular ItemDetailsComponent and recursive CommentComponent to React, replacing the existing stubs.

  • ItemDetails.tsx: fetches a story via fetchItemContent(itemID) in a useEffect keyed on itemID (with window.scrollTo(0,0)), rendering <Loader /> while pending and <ErrorMessage message="Could not load item comments." /> on failure. Preserves the original template structure: mobile header with a back button (navigate(-1)), laptop header (conditional item-header/head-margin classes), poll results with pollBar width points/poll_votes_count*100%, subject via dangerouslySetInnerHTML, and a comment-list of <CommentItem />. External-vs-internal title link keys off hasUrl = item.url.indexOf('http') === 0; openLinkInNewTab from useSettings() controls target/rel.
  • CommentItem.tsx: recursive component with local collapse state. Renders [+]/[-] toggle, user <Link>, time_ago, comment-text (innerHTML), and recurses over comment.comments into a subtree. Deleted comments render the [deleted] meta. Named CommentItem to avoid clashing with the Comment model type.
  • SCSS ported verbatim from the Angular component styles with @import paths rebased to ../shared/scss/... and :host >>> wrappers dropped.

npm run build (tsc + vite) and npm run lint both pass with no errors/warnings. No files outside src/item-details/ were touched.

Link to Devin session: https://app.devin.ai/sessions/f2735a4278f142dcb87cb5c2422a3edb
Requested by: @devanshi-gpta


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Open in Devin Review (Staging)

Co-Authored-By: Devanshi Gupta <devanshi.gupta@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

@devin-ai-integration devin-ai-integration Bot merged commit 8ff5078 into devin/1783534263-react-migration Jul 8, 2026
2 checks passed
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