Skip to content

Conversation

@pablonoel
Copy link
Contributor

@pablonoel pablonoel commented Dec 16, 2025

Description

This PR implements the new custom home page, as described in item #5 of the (https://docs.google.com/spreadsheets/d/1VtmR1H3VOBbEL_D0OxP9z0ZSFmD3H6k_ZldraM11CjA/edit?gid=592668190#gid=592668190)[UX Document] and on page 75 of the (https://docs.google.com/presentation/d/1ztyZwu8b3YzU1MMAFPI3iC-Hm00CE63rPb7eP6vGZlw/edit?slide=id.g39e49b38713_0_0#slide=id.g39e49b38713_0_0)[Rolling UX Deck]

Notes

In the process of building this new view of the home page, we reworked some aspects of customization to better facilitate the requirements.

Flask

The new Your Data Commons page uses the standard Data Commons header. Until now, there was only a single menu content definition available, "Header V2", and this was used in the primary Data Commons site.

We updated the server initialization logic (init.py) to allow for the custom DC to specify its own menu definition.

At the same time, we removed the old, now deprecated "header.json", and replaced it with what we were calling "header_v2.json", fulfilling a TODO. Now:

  • The primary Data Commons site is using "header.json" (what used to be header_v2)
  • The custom Data Commons is using a trimmed down json file supplied in its own config path.

The autocomplete (primary search)

This component is refactored to use Emotion. This allows the component to be used much more flexibly, as it no longer relies on the surrounding CSS context for its styles. In this PR, we are using it in a new Search content block.

We also standardized and refactored the display of the search to use Emotion. To allow the component to be used anywhere within the app without the need of specific styling.

Tools

The tools used to be fixed (effectively, a static component for the non-custom page). Tools is now rolled out to be a more generic component, where you can specify the intro content and which tools will be displayed.

Fonts

We plan to change the font of the custom page from Google Sans to Open Sans. However, that change is fairly complex (in terms of how the different fonts are used and interact with each other) and so for now we will roll that out into a subsequent PR.

Screenshots

Old Search

old_search

New Search

new_search
  • Improvements on alignment and spacing
  • Improvements on typography
  • Normalization (Theme) of colors and sizes

Old Search suggestions

old_search_suggestions

New Search Suggestions

new_search_suggestions
  • Improvements on alignment and spacing
  • Improvements on typography
  • Improvements on icons
  • Normalization (Theme) of colors and sizes

Load More styles

load_more load_more_hover load_more_scroll
  • Implemented the Load More styles to fit the new structure
  • Items now scrolls in place
  • Load more accounts for the fixed height of the search suggestions element removing one element of the 5 default results showing.

New custom DC
custom_dc

nick-next and others added 30 commits December 4, 2025 19:59
…ocation in homepage, because it is now used in multiple areas).
…(in particular, implementing functionality that allows us to display a version used by the coming custom home page).
… that is no longer used, and fulfilling a TODO).
…der.json. If we are in a custom DC, we will look in a particular directory (config/custom_dc) and, if we find a `header.json` in the enclosed custom directory, we will use that.

With this, we will be able to use the standard Data Commons header, while along custom DCs to customize the actual header content.
…conBox component that allows us to display descriptions as used on the new custom home page view.
… app, which will display the search bar and the tool list.
…ws it to be displayed anywhere on the site as a regular content component item.
…and display both the main site's header (with the custom content) as well as the new custom home page content (styling still coming).
… than HEADER_MENU_V2 (which has now been removed).

We also explicitly add the tool list because we have now added a stat var explorer tool to the list which isn't to display on the home page (by default we display all the tool types if none are given).
Clean up HTML and Classes from the main wrappers and components, keeping the same logic and functionality
# Conflicts:
#	static/js/apps/homepage/components/tools.tsx
# Conflicts:
#	static/js/apps/homepage/components/tools.tsx
pablonoel and others added 3 commits December 16, 2025 14:19
• Show Load more now its handled in the beginning
• The results can be infinite the wrapper nows scrolls past the visible threshold
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @pablonoel, 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 introduces a new custom homepage for Data Commons, designed to meet specific UX requirements. It involves a substantial refactoring of core UI components, particularly the search autocomplete and tools sections, leveraging Emotion for modern and flexible styling. The backend Flask server has also been enhanced to support custom header and footer configurations, providing greater flexibility for custom Data Commons deployments. These changes aim to deliver a more polished and customizable user interface.

Highlights

  • Custom Homepage Implementation: A new custom homepage has been implemented for Data Commons, aligning with specific UX design specifications and enabling a more tailored user experience.
  • Flexible Header/Footer Configuration: The Flask server logic has been updated to allow custom Data Commons instances to define their own header and footer menus, significantly enhancing customization capabilities.
  • Refactored Autocomplete Search: The primary search autocomplete component has been refactored to use Emotion for styling, improving its flexibility, visual consistency, and overall user experience.
  • Generic Tools Component: The 'Tools' section has been generalized into a reusable component, allowing for flexible configuration of displayed tools and introductory content across different pages.
  • Updated UI Styling with Emotion: Significant visual improvements have been applied to the search bar, search suggestions, and overall layout, standardizing colors, typography, and spacing using the Emotion CSS-in-JS library.
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 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 counter productive. 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

Copy link
Contributor

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

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 introduces a new custom homepage for Data Commons and refactors several key components to be more modular and maintainable. The backend changes in Flask to support custom header and footer configurations are well-implemented. On the frontend, the extensive refactoring of the search bar and its suggestions to use Emotion and a centralized theme is a significant improvement for styling consistency. The generalization of the Tools component also enhances reusability. Overall, the changes are well-structured and align with the PR's goals. I have a couple of minor suggestions to clean up some unused code.

With some of the class names having changed, the tests are now updated to compensate. Additionally, the test that counts the number of search results now only counts the actual search results (which number 4 because, in order to properly space the elements in the search results, we lowered the number to display from 5 to 4 to fit the show more equally). This means that we are checking for 4 search results, instead of the previous 6.
@pablonoel pablonoel marked this pull request as ready for review December 16, 2025 20:35
Copy link

@miss-o-soup miss-o-soup left a comment

Choose a reason for hiding this comment

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

Hi Pablo,
Thank you for doing all these changes and updates. I really love the care taken to clean up our search tool, going beyond the task at hand to build the custom DC page.
All looks good from my end so I defer to Dan for the code notes and tools refactoring. The only small nit that would like to call out is that we put in medium weight (aka a bit bolder) the location in the completion sentences that appear on the search tool. This is because they help visually to easily differentiate at glance what choice to make.
3nWUGUQ82qXjA9f
I'm attaching an image to point to what I mean.

Copy link
Contributor

@dwnoble dwnoble left a comment

Choose a reason for hiding this comment

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

Thanks @pablonoel !

…size for places, brings back the cursor:text
@pablonoel
Copy link
Contributor Author

Hi Pablo, Thank you for doing all these changes and updates. I really love the care taken to clean up our search tool, going beyond the task at hand to build the custom DC page. All looks good from my end so I defer to Dan for the code notes and tools refactoring. The only small nit that would like to call out is that we put in medium weight (aka a bit bolder) the location in the completion sentences that appear on the search tool. This is because they help visually to easily differentiate at glance what choice to make. 3nWUGUQ82qXjA9f I'm attaching an image to point to what I mean.

Noted! added back the weight increase

Screenshot 2025-12-22 at 11 25 59 AM

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.

4 participants