feat: Add dark mode support for overall analytics for student#794
feat: Add dark mode support for overall analytics for student#794barani-2502 merged 2 commits intomainfrom
Conversation
Summary of ChangesHello, 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 introduces full dark mode compatibility for the student analytics section. The changes ensure that all visual elements, from text and icons to charts and tables, adapt seamlessly to a dark theme, providing a consistent and user-friendly interface regardless of the user's preferred display setting. This enhancement significantly improves the aesthetic and accessibility of the analytics features. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
This pull request introduces comprehensive dark mode support across the analytics UI by adding dark: Tailwind CSS classes to various HTML elements, including breadcrumbs, empty state messages, graphical and tabular reports, page headings, pagination, and tabs. This involves adjusting background, text, border, and SVG colors for better contrast in a dark theme, and also updates the base layout and body classes. Review feedback highlights two issues: a hardcoded light fallback color for chart labels in analytics_scripts.html that could cause readability problems in light mode, and a typo in a Tailwind CSS class (dark:hover-text-neutral-200) within breadcrumbs.html.
| color: getComputedStyle(document.documentElement) | ||
| .getPropertyValue('--tw-text-neutral-100') || '#f5f5f5', |
There was a problem hiding this comment.
Hardcoding the fallback color to a light shade (#f5f5f5) will make the chart labels unreadable in light mode against a light background. The color should be conditional based on the current theme (light/dark).
A better approach is to check if dark mode is enabled and set the color accordingly. For light mode, we can use a dark color like Chart.js's default (#666) or another dark gray from your theme.
| color: getComputedStyle(document.documentElement) | |
| .getPropertyValue('--tw-text-neutral-100') || '#f5f5f5', | |
| color: document.documentElement.classList.contains('dark') ? '#f5f5f5' : '#666', |
| <path fill-rule="evenodd" d="M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z" clip-rule="evenodd" /> | ||
| </svg> | ||
| <a href="{{ '/analytics/'|url }}?parent=1" class="ml-4 text-sm font-medium text-gray-500 hover:text-gray-700">Maths</a> | ||
| <a href="{{ '/analytics/'|url }}?parent=1" class="ml-4 text-sm font-medium text-gray-500 hover:text-gray-700 dark:text-neutral-400 dark:hover-text-neutral-200">Maths</a> |
There was a problem hiding this comment.
There's a typo in the Tailwind CSS class for the dark mode hover state. dark:hover-text-neutral-200 is not a valid class. It should be dark:hover:text-neutral-200.
| <a href="{{ '/analytics/'|url }}?parent=1" class="ml-4 text-sm font-medium text-gray-500 hover:text-gray-700 dark:text-neutral-400 dark:hover-text-neutral-200">Maths</a> | |
| <a href="{{ '/analytics/'|url }}?parent=1" class="ml-4 text-sm font-medium text-gray-500 hover:text-gray-700 dark:text-neutral-400 dark:hover:text-neutral-200">Maths</a> |
|
Uh oh!
There was an error while loading. Please reload this page.