Repository navigation
site: refactor styles; read post title from frontmatter; fix lint - #60
Conversation
|
Warning Amazon Q Developer for GitHub: end of support On January 30, 2027, AWS will discontinue support for the Amazon Q Developer for GitHub App. New app installations will no longer be available starting November 18, 2026. For capabilities similar to the Amazon Q Developer for GitHub App, explore Kiro and the Kiro GitHub App. For more information about the end of support, see Amazon Q Developer end-of-support announcement on the AWS DevOps Blog. |
There was a problem hiding this comment.
Review Summary
This PR performs a broad CSS refactoring (extracting design tokens into CSS custom properties, consolidating shared styles into index.css, removing inline magic values), reads post titles from frontmatter in both the build script and the markdown renderer, and cleans up component markup by removing now-redundant wrapper elements and CSS classes.
The CSS consolidation and frontmatter title-reading logic are well-structured. One merge-blocking logic bug was found in Home.jsx:
Critical Issue
src/pages/Home/Home.jsx – The replacement of useEffect with an inline render-time setState call introduces a stale-state rendering bug. When posts changes, setCurrentPage(0) is called during the render where currentPage is still the old value, so currentPosts is sliced using the wrong page index for that render frame. React will then re-render with the corrected state, but the intermediate slice is incorrect. The original useEffect approach was correct and should be restored.
No other blocking issues found.
post.config.js: The newtitleMatchfallback to slug-derived title is correct.MarkdownRenderer.jsx: Frontmatter stripping regex and tag parsing are correct; the removal of the unnecessary nested<div>wrapper is fine.Tags.jsx/NotFound.jsx: Style class name changes are consistent with the refactored CSS.src/styles/index.css/App.css: Clean extraction of global tokens and shared utilities — no functional regressions.
You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.
| if (posts !== prevPosts) { | ||
| setPrevPosts(posts); | ||
| setCurrentPage(0); | ||
| }, [posts]); | ||
| } |
There was a problem hiding this comment.
🛑 Logic Error: Calling setPrevPosts and setCurrentPage synchronously during render is a React anti-pattern that produces an incorrect intermediate render. When posts !== prevPosts, currentPage has not yet been reset to 0, so currentPosts is sliced from the stale page index for the first render frame before React re-renders with the corrected state. This means a wrong page of posts is momentarily computed and can be briefly displayed. The original useEffect approach was correct — the page reset happened after the render, not during it. Revert to useEffect with [posts] as the dependency to avoid the stale-slice bug.
No description provided.