Skip to content

Conversation

@schultek
Copy link
Contributor

@schultek schultek commented Oct 22, 2025

Part of #12548

Reorganizes the Jaspr components to the following:

  • Common components (Button, Card, etc) under components/common
    • @client components of these under components/common/client
  • Dartpad related under components/dartpad
  • Layout components (Header, Footer, SideNav, etc.) under components/layout
  • Page specific components (ArchiveTable, etc.) under components/pages

Also cleans up the initialization of custom components for jaspr_content, by moving any attribute parsing logic to the respective component.

@schultek schultek requested a review from parlough October 22, 2025 15:17
@schultek schultek requested review from a team and sfshaza2 as code owners October 22, 2025 15:17
@schultek schultek force-pushed the feat/organize-components branch from 892af74 to f6d1da0 Compare October 22, 2025 15:18
@schultek schultek removed the request for review from sfshaza2 October 22, 2025 15:18
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @schultek, 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 focuses on improving the component architecture of the Jaspr application by introducing a more structured and logical directory layout. It aims to enhance code organization, making it easier to locate, understand, and maintain components. Additionally, it streamlines the initialization of custom components by delegating attribute parsing directly to the component classes, reducing boilerplate in the main application file and promoting a cleaner component API.

Highlights

  • Component Reorganization: The pull request introduces a significant refactoring of the component directory structure, categorizing components into common, dartpad, layout, and pages subdirectories for better organization and maintainability.
  • Client-Side Component Grouping: Client-side components that are common across the site have been moved into a dedicated components/common/client directory, further enhancing the logical grouping of related files.
  • Custom Component Initialization Cleanup: The logic for parsing attributes for custom components (like Card, ArchiveTable, DownloadLatestButton, ExpansionList, and YouTubeEmbed) has been moved from main.dart into factory constructors within their respective component classes. This centralizes attribute handling and simplifies main.dart.
  • New YouTube Embed Component: A new YoutubeEmbed component has been added under components/common/youtube_embed.dart to encapsulate the logic for embedding YouTube videos, replacing the inline builder logic previously found in main.dart.
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 does a great job of reorganizing the components into a more logical structure, which significantly improves the project's maintainability. Moving the attribute parsing logic into the respective components is also a solid refactoring step that cleans up main.dart and adheres to the single responsibility principle. I've added a few suggestions to improve the robustness of attribute parsing in some of the newly created factory constructors and to fix a potentially broken import path. Overall, this is a very positive change for the codebase.

@flutter-website-bot
Copy link
Collaborator

flutter-website-bot commented Oct 22, 2025

Visit the preview URL for this PR (updated for commit befe430):

https://flutter-docs-prod--pr12588-feat-organize-components-dd88h0t5.web.app

Copy link
Member

@parlough parlough left a comment

Choose a reason for hiding this comment

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

Great cleanup! I like the fromAttributes constructors consolidating the logic into the relevant components.

@schultek schultek merged commit 9195ab9 into feat/jaspr-migration Oct 22, 2025
2 checks passed
@schultek schultek deleted the feat/organize-components branch October 22, 2025 15: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.

4 participants