Improve network detail json text size and expand icon#498
Improve network detail json text size and expand icon#498rteyssandier merged 1 commit intoopenflocon:mainfrom
Conversation
Summary of ChangesHello @snappdevelopment, 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 visual presentation of JSON data within the application by adjusting text sizing and correcting an icon's directional behavior. These changes aim to improve the clarity and intuitive interaction with JSON tree views, making the display of structured data more user-friendly and consistent with common UI patterns. Highlights
Changelog
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
Thank you for this pull request. The changes to reduce the JSON text size and fix the expander icon direction are great improvements for usability and consistency. The code is clean and follows the intended goal. I have one suggestion regarding theme handling in the FloconJsonTree component to make it robust for both light and dark modes.
| icon = Icons.Outlined.ChevronLeft, | ||
| icon = Icons.Outlined.ChevronRight, | ||
| searchState = searchState, | ||
| colors = defaultDarkColors, |
There was a problem hiding this comment.
The JsonTree colors are hardcoded to defaultDarkColors. This will not look right when the application is in light theme. You should conditionally apply colors based on the current theme to ensure visual consistency.
You will also need to add the following imports:
import androidx.compose.foundation.isSystemInDarkTheme
import com.sebastianneubauer.jsontree.defaultLightColors
| colors = defaultDarkColors, | |
| colors = if (isSystemInDarkTheme()) defaultDarkColors else defaultLightColors, |
The text size which is currently used for JsonTree in the network detail screen and json screen feels a little bit too big. I decreased the text size by using one of Flocons TextStyles, which improves readability especially in the network details screen because there is less space.
I also fixed the chevron icon. It was pointing in the wrong direction when expanding objects. Now it points to the right when collapsed or down when expanded, like most tree views (e.g. Android Studios file tree).