Skip to content

Header footer refactor - #6568

Open
pablonoel wants to merge 9 commits into
datacommonsorg:masterfrom
pablonoel:header-footer-refactor
Open

Header footer refactor#6568
pablonoel wants to merge 9 commits into
datacommonsorg:masterfrom
pablonoel:header-footer-refactor

Conversation

@pablonoel

@pablonoel pablonoel commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

This PR refactors the Header, its menus and responsive states, and the footer, to use Emotion (CSS-in-JS,) and the Theme, It should look and work, exactly the same as before, minus some pixel-specific sizes and spacings due to normalization.

Changes

  • Added new Theme elements: theme.typography.menu scale, applied across menu components, header sizing, icons, elevation, spacing.xxxl
  • header.json: reordered menu items for positioning consistency

Convert header components to Emotion CSS-in-JS (header_bar, header_logo, menu_desktop, menu_desktop_rich_menu, menu_mobile, menu_mobile_rich_menu, menu_rich_link_group, menu_rich_section_group) using css and useTheme. Add header sizing and icons tokens, rename spacing.huge->xxxl and introduce DC_GRAY_LIGHTER in theme, plus elevation header shadow entries and updated Theme types. Small layout adjustment: DataSourceDetails gap updated to spacing.xxxl. Keeps existing behavior and analytics hooks while making header responsive and theme-driven.
Introduce a new theme.typography.menu scale (xs..xl) and update Theme types. Replace usages of theme.typography.text.* with the new theme.typography.menu.* in several header/menu components, tweak spacing (gaps and margins) for mobile and rich menu layouts, remove a stray test string from a heading, and switch a wrapper div to a fragment. These changes centralize menu-specific typography and refine menu spacing for consistent visual hierarchy.
Replace various theme.typography.text.* usages with theme.typography.menu.* across header bar components to standardize menu typography (header_logo, menu_desktop, menu_desktop_rich_menu, menu_mobile, menu_mobile_rich_menu, menu_rich_link_group, menu_rich_section_group). Adjust theme.menu scale by swapping XS/SM size values so menu.xs is smaller and menu.sm holds the larger size.
Refactor footer to use Emotion theming and responsive styles (footer.tsx, footer_app.tsx). Add ThemeProvider and theme import, centralize footer links, and update layout/typography for accessibility and responsiveness. Reorder and update header menu items/labels in server/config/base/header.json (swap Map Explorer/Data Download, Tutorials/API, Data Sources/FAQ). Tweak header bar components' styles: safer max-height handling, spacing/gap adjustments, and consistent menu typography (menu_desktop*, menu_mobile_rich_menu*, menu_rich_*). Update theme menu sizes/line-heights in theme.ts to match new styles.
@pablonoel
pablonoel requested a review from nick-nlb August 6, 2026 01:18
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request migrates the application's header and footer components to use Emotion for CSS-in-JS styling, ensuring better maintainability and consistency with the project's design system. It also introduces new theme tokens for typography and layout, fixes a critical rendering issue in the footer, and updates the navigation configuration.

Highlights

  • Styling Migration: Refactored the Header and Footer components to use Emotion CSS-in-JS, ensuring consistent styling and better maintainability.
  • Theme Updates: Integrated new theme tokens for header sizing, icons, elevation, and typography, enhancing the overall design system.
  • Bug Fix: Resolved a rendering crash in the Footer component by correctly implementing the ThemeProvider.
  • Navigation Improvements: Reordered menu items in the configuration and improved responsive menu behavior for better user experience.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the header and footer components to use Emotion CSS-in-JS styling and theme values, removing reliance on external CSS classes. It also updates the theme definitions with new header, icon, typography, and elevation variants, and reorders several header navigation items. The review feedback highlights missing semicolons in CSS-in-JS styles within menu_rich_link_group.tsx and an invalid CSS width value when the mobile drawer is open in menu_mobile.tsx.

Comment thread static/js/apps/base/components/header_bar/menu_rich_link_group.tsx Outdated
Comment thread static/js/apps/base/components/header_bar/menu_rich_link_group.tsx Outdated
Comment thread static/js/apps/base/components/header_bar/menu_mobile.tsx Outdated
Set explicit widths for the mobile menu when open (480px default, 320px under 580px, 280px under 400px) and keep transition/elevation. Also add missing semicolons after gap in MenuRichLinkGroup to satisfy CSS formatting/linting and avoid potential style parsing issues.
@pablonoel pablonoel self-assigned this Aug 6, 2026
Introduce an 'xl' header size in theme and Theme types, and update HeaderBar to use theme.header.xl when hideHeaderSearchBar is true so header height and grid rows adapt across breakpoints. Also remove an unused ICONS constant from theme.ts.
@pablonoel
pablonoel marked this pull request as ready for review August 6, 2026 15:04
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