Skip to content

Conversation

@meganrm
Copy link
Collaborator

@meganrm meganrm commented Dec 4, 2025

Problem

The site isnt going to be iframed so it needs it own banner

Solution

I copied over the banner css and image from allencell.org

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Steps to Verify:

Screenshots (optional):

Screenshot 2025-12-04 at 2 07 03 PM

@meganrm meganrm requested review from Copilot and rugeli December 4, 2025 22:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a customizable banner header feature to the catalog pages by copying banner CSS and image assets from allencell.org. The banner displays a title, optional subtitle, and optional background image.

Key Changes:

  • Created a new Header component with configurable title, subtitle, and background image
  • Added header configuration support in the CMS for catalog pages
  • Modified layout structure to support optional header rendering

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
static/admin/config.yml Added header configuration fields (title, subtitle, background) to CMS
src/utils/mediaUtils.ts Added utility function to extract image source from Gatsby file nodes
src/templates/normal-catalog.tsx Integrated header component with frontmatter data and GraphQL query
src/templates/disease-catalog.tsx Integrated header component with frontmatter data and GraphQL query
src/style/layout.module.css Refactored CSS selectors from .container to .content for proper scoping
src/style/banner.module.css Added banner styling with hardcoded background image fallback
src/pages/index.md Added header configuration to normal catalog page
src/pages/disease-catalog/index.md Added header configuration to disease catalog page
src/components/Layout.tsx Modified to accept and render optional header prop
src/components/Header.tsx Created new header component with banner styling

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

meganrm and others added 7 commits December 4, 2025 14:12
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

bannerContainer,
container,
titleContainer,
} = require("../style/banner.module.css");
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

The imported CSS module includes titleContainer but this class is not defined in banner.module.css. Either remove this unused import or add the missing CSS class definition.

Copilot uses AI. Check for mistakes.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
title: About the collection
header:
title: Disease Collection Cell Catalog
subtitle: ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: without a subtitle in the banner feels a bit empty, but if that's the intended design, all good by me!

@meganrm meganrm requested a review from Copilot December 5, 2025 20:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

const DiseaseCatalog = ({ data }: QueryResult) => {
const { markdownRemark: post } = data;
const imageFile = post.frontmatter.header?.background;
const backgroundImageUrl = getImageSrcFromFileNode(imageFile!);
Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

The non-null assertion operator (!) could cause a runtime error if imageFile is undefined. This is likely since background is marked as optional in the header configuration. Use optional chaining instead: const backgroundImageUrl = imageFile ? getImageSrcFromFileNode(imageFile) : undefined; to match the pattern used in normal-catalog.tsx.

Suggested change
const backgroundImageUrl = getImageSrcFromFileNode(imageFile!);
const backgroundImageUrl = imageFile ? getImageSrcFromFileNode(imageFile) : undefined;

Copilot uses AI. Check for mistakes.
@meganrm meganrm merged commit 9d9e9c5 into main Dec 5, 2025
@meganrm meganrm deleted the feature/banner branch December 5, 2025 20:58
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.

3 participants