Skip to content

site: refactor styles; read post title from frontmatter; fix lint - #60

Merged
gapry merged 1 commit into
mainfrom
css-code-refactoring
Nov 26, 2026
Merged

gapry merged 1 commit into
mainfrom
css-code-refactoring

Conversation

@gapry

@gapry gapry commented Nov 26, 2026

Copy link
Copy Markdown
Owner

No description provided.

@amazon-q-developer

Copy link
Copy Markdown

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.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 new titleMatch fallback 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.

Comment thread src/pages/Home/Home.jsx
Comment on lines +10 to +13
if (posts !== prevPosts) {
setPrevPosts(posts);
setCurrentPage(0);
}, [posts]);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 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.

@gapry
gapry merged commit 3708771 into main Nov 26, 2026
2 checks passed
@gapry
gapry deleted the css-code-refactoring branch November 26, 2026 08:48
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.

1 participant