Repository navigation
React migration 4/6: item details, polls and recursive comments - #941
Open
devin-ai-integration[bot] wants to merge 4 commits into
Open
devin-ai-integration[bot] wants to merge 4 commits into
devin-ai-integration[bot] wants to merge 4 commits into
Conversation
Co-Authored-By: Matthew Guerra <matthew.guerra@cognition.ai>
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
…ols keyboard-operable Co-Authored-By: Matthew Guerra <matthew.guerra@cognition.ai>
Author
There was a problem hiding this comment.
Devin Review found 1 finding. Devin automatically fixed it.
Fixed by Devin (1)
- Poll HTML sanitization goes untested — Added a poll test whose option content contains onerror/script HTML and asserts it is stripped.
Co-Authored-By: Matthew Guerra <matthew.guerra@cognition.ai>
…nitization Co-Authored-By: Matthew Guerra <matthew.guerra@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
This PR ports
item-details/(the page andcomment) intoreact-app/and replaces the placeholderItemDetailsPage. It is stacked on #938 (foundation) and independent of #939/#940.ItemDetailsPageloadsfetchItemContent(id)in an effect with anAbortController. While the item is loading it shows the loader, and on failure it showsErrorMessage("Could not load item comments."). It keeps both the mobile header (back button →navigate(-1), Angular'sLocation.back()) and the desktop header, with the title, domain, points, user and comment count. Jobs hide the points, user and comment links. The open-in-new-tab setting applies to the title link.points / poll_votes_count, with a guard against divide-by-zero.Commentrenders recursively.[-]/[+]collapses a subtree using local state (hidden, the same as Angular's[hidden]). Deleted comments show[deleted] | Comment Deleted.[innerHTML]sanitized the API's HTML, but React'sdangerouslySetInnerHTMLdoesn't. To keep that protection, story/comment/poll HTML now goes throughDOMPurify.sanitize(utils/sanitize.ts). The one new dependency isdompurify^3..main-content(already global) is dropped, and the styles are scoped under.item-page/.comment, since React doesn't scope component styles the way Angular did.ItemDetailsPage.test.tsxcovers the header, nested and deleted comments, collapse/expand, poll bar widths, stripping ofonerror/<script>/javascript:, the back button and the error state. Lint, typecheck, 26 tests and the build pass.This duplicates #935 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 fixed the finding · Follow Devin's work