PR 6/10 — Port the feed list and story item components - #758
Open
devanshi-gpta wants to merge 2 commits into
Open
devanshi-gpta wants to merge 2 commits into
devanshi-gpta wants to merge 2 commits into
Conversation
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:
|
Comment on lines
+4
to
+13
| a { | ||
| text-decoration: none; | ||
| font-weight: bold; | ||
|
|
||
| &:hover { | ||
| text-decoration: underline; | ||
| }; | ||
| } | ||
|
|
||
| ol { |
There was a problem hiding this comment.
Noted. Global SCSS is the established convention in react-app/ (_themes.scss targets global class names like .wrapper/.nav, so CSS Modules would break theming), and these rules are a verbatim port of feed.component.scss. The one real collision found so far (.name vs the header rule) is fixed in 3967066; a broader audit of the bare a/p/ol selectors is best done once the router mounts all views together.
Co-Authored-By: Devanshi Gupta <devanshi.gupta@cognition.ai>
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
Part of the Angular → React migration chain; based on
devin-09.08.2026-devanshi/add-shared-and-core-components. Portssrc/app/feeds/to React, leaving the Angular sources untouched (removed in the final cleanup PR).react-app/src/components/feeds/Item.tsx(fromfeeds/item/): takesitem: Story, readslistSpacing/titleFontSize/openLinkInNewTabfrom the settings context. The Angularget hasUrl()becomes an exported helperhasUrl(item) => item.url?.startsWith('http') ?? falsethat tolerates a missingurl(the Angular version threw on undefined).target="_blank"/rel="noopener"are spread in only whenopenLinkInNewTabis on, matching Angular's[attr.x]="… : null"semantics; both thesubtext-palmandsubtext-laptopblocks are preserved, with thecommentpipe replaced byformatCommentCount.react-app/src/pages/Feed.tsx(fromfeeds/feed/):feedTypearrives as a prop from the router,pagefromuseParams()(default 1). Data comes fromuseFetch(signal => fetchFeed(feedType, page, signal), [feedType, page]);Loaderwhile loading,ErrorMessagewithCould not load {feedType} stories.on failure.listStart = (page - 1) * 30 + 1feeds the<ol start>,window.scrollTo(0, 0)runs after each successful load, and the jobs header,list-marginrule and Prev (listStart !== 1) / More (items.length === 30) links are ported as-is.feed.component.scss/item.component.scsscopied verbatim next to the components with their@importpaths rewritten to../styles/….src/test-setup.tsgains awindow.matchMediafallback: jsdom does not implement it, and any test that rendersSettingsProvider(both new test files) crashed without it.Proposed fixes
Item(external vs. self post links, domain, job stories hiding points/comments) andFeed(liststart, pagination links, error message, jobs header) withfetchstubbed.npm run typecheck,npm run build,npm run lintandnpm testall pass inreact-app/(29 tests).Follow-up: routing is not wired up yet, so
Feedis rendered by the router PR later in the chain.Link to Devin session: https://app.devin.ai/sessions/6945f05e664647d2b370d15f63e0dd1a
Open in Devin Desktop: https://app.devin.ai/desktop/session/6945f05e664647d2b370d15f63e0dd1a?variant=devin
Requested by: @devanshi-gpta