Repository navigation
React migration phase 2: app shell, routing, theming, header/footer/settings, loader & error components - #867
Closed
vibhaseshadri-cognition wants to merge 3 commits into
Conversation
…oader and error components (migration phase 2) Co-Authored-By: Vibha Seshadri <vibha.seshadri@cognition.ai>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…m the HN API (migration phase 2) Co-Authored-By: Vibha Seshadri <vibha.seshadri@cognition.ai>
This was referenced Oct 6, 2026
…rap focus in settings dialog (migration phase 2) Co-Authored-By: Vibha Seshadri <vibha.seshadri@cognition.ai>
|
Closing as part of the nightly demo-repo reset — reopen if this demo artifact is still needed. |
devin-ai-integration
Bot
deleted the
devin/1791294931-react-phase2-shell
branch
October 26, 2026 12:11
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
Phase 2 of the Angular → React migration (stacked on #866 → #865). Ports the Angular app shell into
react/. Angular code is untouched.Routing: same URLs as
src/app/app.routes.tsplus the lazy modules':idchild routes:As in Angular,
/news,/itemand/userwith no param match nothing, and there is no catch-all route.feeds/Feed.tsx,item-details/ItemDetails.tsxanduser/UserProfile.tsxare placeholders. Phases 3, 4 and 5 replace their bodies and keep the default exports, props and rootdata-testidattributes.Shell components (
core/Header,core/Footer,core/SettingsDialog,shared/components/Loader,shared/components/ErrorMessage): same markup, class names and copy as the Angular templates, wired touseSettings()from Phase 1. Behaviour differences:NavLink(activeclass, same asrouterLinkActive) and callwindow.scrollTo(0, 0)on click.role="button", are keyboard-focusable, and respond to Enter and Space.onChange; Angular saved onkeyup, which missed changes from the spinner arrows.usePageViewscopies Angular'sNavigationEndhandler: whenwindow.gaexists it sendsga('set','page',url)and thenga('send','pageview'). It skips/because that URL immediately redirects. The GA snippet itself is not added here; it moves toindex.htmlin the PWA phase.index.htmlgets the Angular boot loader (#root:empty + .app-loader), the skip link and the noscript message.shared/components/SafeHtml(DOMPurify.sanitize) replaces Angular's sanitized[innerHTML]binding. It's added here so Phases 4 and 5 (comments, poll options, user bios) share one implementation.Styles:
styles/_themes.scss,_theme_variables.scssand_media.scssare copied from Angular, with@importchanged to@use,/division tomath.divanddarken()tocolor.adjust. Without Angular's view encapsulation, each component's SCSS is global, so element selectors are nested under the component's root class or id (e.g.#header h1,.overlay .popup). Vite uses themodern-compilerSass API, so there are no legacy-API deprecation warnings.Tests
src/test/renderWithProviders.tsxwraps components inMemoryRouter+SettingsProvider, stubsmatchMediaand adds aLocationProbe.e2e/shell.spec.tsreplaces the Phase 0 smoke test): the redirect, deep links for every feed, header navigation with the active link, the item and user routes, switching themes in the settings dialog (checks the computed header colour for each theme and that the choice survives a reload), and defaulting to night when the browser emulatesprefers-color-scheme: dark.fetchnever resolves in unit tests; requests are aborted in e2e). That keeps them about the shell, so Phases 3–5 can add real data fetching without editing these tests.Other changes:
tsconfig.node.jsonadds theDOMlib sopage.evaluatecallbacks typecheck.react-refresh/only-export-componentsfor test helpers.react-router-dom@6,dompurify@3,sass(dev).Local (
react/):format:check,lint,typecheck,test(76 tests passed, 100% coverage),build,e2e(10 passed).Devin-Org: engineering
Link to Devin session: https://app.devin.ai/sessions/89cdada34e094c0b8a61fae52bf25e08
Open in Devin Desktop: https://app.devin.ai/desktop/session/89cdada34e094c0b8a61fae52bf25e08?variant=devin
Requested by: @vibhaseshadri-cognition