Skip to content

Conversation

@dsuren1
Copy link

@dsuren1 dsuren1 commented Dec 5, 2025

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @dsuren1, 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 refines the logic for detecting unsaved changes in newly created resources. It removes the broader dirty state checks that applied to various resource types like Maps, Dashboards, and GeoStories, and instead introduces a more focused mechanism specifically for new Map Viewer resources. This change aims to simplify the underlying state management for resource creation and also includes a minor cleanup in the GeoStory initialization process.

Highlights

  • Refined Dirty State Detection: The previous, more general dirty state checks for new Maps, Dashboards, and GeoStories (isNewMapDirty, isNewDashboardDirty, isNewGeoStoryDirty) have been removed. This simplifies how unsaved changes are detected for new resources.
  • New Map Viewer Resource Check: A new, specific selector isNewMapViewerResource has been introduced. This selector is now used in getResourceDirtyState to determine if a newly created resource is a Map Viewer, indicating a 'dirty' state for this specific resource type.
  • Simplified GeoStory Initialization: The initialization logic for new GeoStory resources within newResourceObservable has been streamlined by removing an intermediate currentStory variable and a redundant spread operation, making the code more concise.
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

@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 reverts the functionality related to showing a pending indicator when a new unsaved resource is exited. The changes involve removing specific 'dirty state' checks for new maps, dashboards, and geostories, and their corresponding test cases. A new selector isNewMapViewerResource has been introduced, and the getResourceDirtyState logic has been updated to reflect these changes. The changes appear consistent with the revert's objective.

Comment on lines +347 to 349
if (isNewMapViewerResource(state)) {
return true;
}

Choose a reason for hiding this comment

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

medium

The getResourceDirtyState now explicitly returns true if the resource is a new VIEWER type. This means a newly created MapViewer resource will always be considered 'dirty', even if no modifications have been made from its default configuration. This behavior was also present before the revert in the isNewResourceDirty selector.

However, with the removal of specific dirty checks for new Map, Dashboard, and GeoStory resources, these types now rely on isDataChanged or isMetadataChanged to determine their 'dirty' state. This creates an inconsistency where new MapViewer resources are always considered dirty, while others are only dirty if actual changes occur.

If getResourceDirtyState is used to determine if a save operation is needed, this could lead to unnecessary save attempts for unmodified new MapViewer resources. Could you confirm if this behavior is intended, or if new MapViewer resources should also be checked for actual changes before being marked as dirty?

@allyoucanmap allyoucanmap merged commit 1b3c932 into GeoNode:master Dec 5, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants