Skip to content

React migration 1/6: foundation app in react-app/ - #938

Open
devin-ai-integration[bot] wants to merge 4 commits into
masterfrom
devin/task-2-react-foundation
Open

devin-ai-integration[bot] wants to merge 4 commits into
masterfrom
devin/task-2-react-foundation

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Summary

First of six PRs migrating angular2-hn from Angular to React. This one only adds files: it creates a standalone React 19 + TypeScript + Vite app in react-app/ and leaves the Angular app and its build untouched. That means it can merge by itself.

What it ports from Angular:

  • Models (src/models): Story, Comment, User, PollResult, Settings, FEED_TYPES, THEMES
  • API (src/api/hackerNewsApi.ts): replaces HackerNewsAPIService. It uses fetch and supports AbortSignal, and a non-OK response now throws. Poll options are fetched and their votes summed, as before.
    • Profiles: fetchUser calls api.hnpwa.com/v0/user/:id.json because node-hnapi's /user/:id now returns 404. Feeds and items still use node-hnapi.
  • Settings (SettingsProvider / useSettings): replaces SettingsService and keeps the same localStorage keys (theme, openLinkInNewTab, titleFontSize, listSpacing). If no theme is saved, the system dark-mode preference is used.
  • Routes (src/routes.tsx): same as app.routes.ts, with / → /news/1, :feed/:page, and lazy-loaded item/:id and user/:id. The pages are placeholders that later PRs fill in.
  • Shared pieces: Loader, ErrorMessage, theme SCSS, and static assets. In the SCSS, / division and darken() were replaced with math.div and color.adjust so it builds on current Dart Sass.
  • CI: .github/workflows/react-app.yml runs lint, typecheck, vitest (19 tests) and build when react-app/** changes.

Next PRs: 2 shell, 3 feeds, 4 item details, 5 user profile, 6 cutover (move to repo root, PWA, delete Angular).

This duplicates #932 from an earlier parallel migration stack. Only one of them should land.

Devin-Org: engineering

Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/a08488aa0df94f1ba5fcd309e7df132d
Link to Bot: https://devin-gtm.devinenterprise.com/org/devin-gtm/bots/a78446fd2653463e94cefb31caca525b
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/a08488aa0df94f1ba5fcd309e7df132d?variant=devin


Note

Devin could not open this Pull Request as matthewguerra-cog: they have no GitHub connection usable for this repository.
As a fallback, Devin opened this PR as itself.


🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

Devin Review

Co-Authored-By: Matthew Guerra <matthew.guerra@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown
Author

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

Co-Authored-By: Matthew Guerra <matthew.guerra@cognition.ai>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 finding. Devin automatically fixed it.

Fixed by Devin (1)
  • Failed poll option hides entire item — Real regression vs Angular (which subscribed per option): a single failed option rejected the whole item. Now uses Promise.allSettled, keeps failed entries and sums only loaded votes; added a test.

View findings in Devin Review · Follow Devin's work

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Author
Browser verification — React foundation

Tested locally with the Vite dev server.

  • ✅ / redirects to /news/1, and all five feed routes render their placeholders.
  • ✅ The lazy /item/:id and /user/:id routes show the loader, then the right placeholder.
  • ✅ Saved night and AMOLED themes persist across reloads. A missing or invalid saved theme falls back to the default.
  • ✅ /favicon.ico and /assets/images/logo.svg return HTTP 200. Supported routes log no console errors.
  • /foo shows React Router's default 404 page. The cutover PR handles unknown routes.

The production preview build wasn't tested.

Default theme Night theme Lazy loader
Default Night Loader

Recording

Written by Devin

devin-ai-integration Bot and others added 2 commits November 11, 2026 20:47
Co-Authored-By: Matthew Guerra <matthew.guerra@cognition.ai>
Co-Authored-By: Matthew Guerra <matthew.guerra@cognition.ai>
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.

0 participants