Skip to content

Conversation

@SiriusXT
Copy link
Member

@SiriusXT SiriusXT commented Dec 5, 2025

Before fix:
图片

After fix:
图片

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @SiriusXT, 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 addresses a rendering anomaly in the NoteMap widget where the map would overflow its container when its type was changed via the ribbon interface. The primary fix ensures that the map's dimensions are properly re-evaluated and updated upon such type changes. Additionally, the PR refines the user experience by updating the expand and collapse icons within the NoteMap ribbon tab to more intuitively represent their respective actions.

Highlights

  • NoteMap Overflow Fix: The NoteMap now correctly resizes its dimensions when the map type is switched in the ribbon, preventing previous overflow issues. This was achieved by including mapType in the dependency array of the useEffect hook responsible for setting the graph's size.
  • Updated UI Icons: The icons for expanding and collapsing the NoteMap in the ribbon have been updated for improved visual clarity and consistency. The 'open full' action now uses bx-expand-vertical and the 'collapse' action uses bx-collapse-vertical.
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 addresses an overflow issue in the NoteMap component by ensuring the graph is resized when the map type is switched. The change in NoteMap.tsx correctly adds mapType to the dependency array of the resizing effect. The icon changes in NoteMapTab.tsx are also a good improvement for UI clarity.

I've identified a related potential issue where the graph might not be resized when the note prop changes, even though the graph is rebuilt. I've left a comment with a suggestion to fix this, which will make the component more robust against similar overflow bugs.

if (!containerSize || !graphRef.current) return;
graphRef.current.width(containerSize.width).height(containerSize.height);
}, [ containerSize?.width, containerSize?.height ]);
}, [ containerSize?.width, containerSize?.height, mapType ]);
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The useEffect hook at line 49, which rebuilds the graph, depends on note. However, this resizing effect does not. If the note prop changes but the mapType remains the same, the graph will be rebuilt but not resized, leading to a similar overflow issue as the one this PR aims to fix. To ensure the graph is always resized after being rebuilt, you should also include note.noteId in the dependency array.

Suggested change
}, [ containerSize?.width, containerSize?.height, mapType ]);
}, [ containerSize?.width, containerSize?.height, mapType, note.noteId ]);

@SiriusXT SiriusXT marked this pull request as ready for review December 5, 2025 07:22
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Dec 5, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Dec 5, 2025
@eliandoran eliandoran changed the base branch from main to stable December 5, 2025 09:58
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Dec 5, 2025
@eliandoran eliandoran changed the base branch from stable to main December 5, 2025 09:59
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Dec 5, 2025
@eliandoran eliandoran merged commit fb491d9 into main Dec 5, 2025
11 checks passed
@eliandoran eliandoran deleted the fix/note_map branch December 5, 2025 09:59
@eliandoran eliandoran added this to the v0.100.0 milestone Dec 5, 2025
eliandoran added a commit that referenced this pull request Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants