show related posts in tag popover component#28
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a TagPopover component that displays related posts when clicking on a tag. The popover shows a list of other posts sharing the same tag and includes a link to browse all tags.
Changes:
- Created a new
TagPopovercomponent with styling to show related posts in a popover on tag click - Updated
IdeaPostNodetype to include thefields.slugproperty needed for filtering - Replaced static tag displays in
idea-post.tsxandIdeaRoll.tsxwith the interactiveTagPopovercomponent
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types/index.ts | Added fields.slug to IdeaPostNode interface to support post filtering |
| src/templates/idea-post.tsx | Integrated TagPopover component and passed currentSlug to filter out current post |
| src/style/tag-popover.module.css | Added CSS styles for popover layout and tag interactions |
| src/components/TagPopover.tsx | Implemented new component with GraphQL query to fetch and display related posts |
| src/components/IdeaRoll.tsx | Replaced static tag links with TagPopover component |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…eature/tag-popover
✅ Deploy Preview for project-idea-board ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
meganrm
approved these changes
Jan 26, 2026
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.
Problem
Advances #7
Originally wrote this hoping to have some work from #27 done but I'm deferring that pending prioritization.
Solution
Made a
TagPopovercomponent so that clicking on a tag shows a list of posts that share that tag, and a link to browse the (undeveloped) Tags page.I also added a type declaration for CSS modules so that we could drop the
requireimports for our CSS classes and use the pattern more like simularium website:import * as styles from "../style/tag-popover.module.css";and
className={styles.className}IMHO, we don't gain much from destructuring the class names because there is no TS check whether those fields actually exist, you can just
const { thingThatDoesntExist, thingThatIsNotReal } = require("../style/fake.module.css)That's fine, this version isn't more safe, but I slightly prefer that it prevents name collisions, in case you have a variable
tagContentand a class nametagContentyou can now have