Skip to content

Conversation

@schultek
Copy link
Contributor

@schultek schultek commented Oct 22, 2025

Part of #12548

Migrate the remaining logic from main.js to Dart.

@schultek schultek requested a review from parlough October 22, 2025 13:24
@schultek schultek requested review from a team and sfshaza2 as code owners October 22, 2025 13:24
@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 finalizes the migration of client-side JavaScript logic from main.js to Dart. It consolidates operating system detection, interactive Table of Contents features, and platform-specific key displays into the Dart codebase, thereby eliminating the dependency on the legacy JavaScript file and streamlining the client-side scripting architecture.

Highlights

  • Complete JavaScript Migration: The entire main.js file, which contained various client-side functionalities, has been successfully migrated to Dart, leading to its removal from the project.
  • Refactored OS Detection: The logic for detecting the user's operating system has been moved and refactored into Dart, replacing the previous _ClientOperatingSystem enum and its fromUserAgent method with a new getOS() utility.
  • Table of Contents (TOC) Functionality: All interactive features of the Table of Contents, including the scrollspy mechanism, dropdown menu, and active link highlighting, have been reimplemented in Dart.
  • Platform-Specific Key Handling: The dynamic display of platform-specific keys (e.g., 'Command' for macOS, 'Control' for other OSes) is now managed entirely within the Dart codebase.
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 migrates the remaining JavaScript logic from main.js to Dart, enhancing the application's maintainability and performance. The changes include moving the getOS function, setting up platform-specific keys, and implementing table of contents functionality in Dart. The JavaScript file main.js is removed, and the corresponding script tag is removed from dash_layout.dart. The pull request also includes updates to the tab setup logic to use the Dart implementation of getOS.

@flutter-website-bot
Copy link
Collaborator

flutter-website-bot commented Oct 22, 2025

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

https://flutter-docs-prod--pr12587-feat-migrate-main-js-69tb2e8p.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.

Wooo, goodbye & farewell JS 👋

@parlough parlough merged commit 5a240ca into feat/jaspr-migration Oct 22, 2025
2 checks passed
@parlough parlough deleted the feat/migrate-main-js branch October 22, 2025 14:31
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