Skip to content

feat: Add dark mode support for overall analytics for student#794

Merged
barani-2502 merged 2 commits intomainfrom
analytics_student
Mar 12, 2026
Merged

feat: Add dark mode support for overall analytics for student#794
barani-2502 merged 2 commits intomainfrom
analytics_student

Conversation

@barani-2502
Copy link
Contributor

@barani-2502 barani-2502 commented Mar 12, 2026

  • This commit adds dark mode support for overall analytics.
  • Updates analytics tables, charts, breadcrumbs, tabs, pagination, and empty states for dark mode.
  • Adds Tailwind dark classes and dynamic text colors for better readability.
  • Adds base layout of student with sidebar and navbar.

@gemini-code-assist
Copy link

Summary of Changes

Hello, 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

  • Dark Mode Support: Implemented comprehensive dark mode styling across all analytics pages for a more comfortable viewing experience in low-light conditions.
  • UI Element Styling: Applied dark mode specific Tailwind CSS classes to various UI components including breadcrumbs, empty states, graphical reports, page headings, pagination, tabs, and tabular reports.
  • Chart Readability: Adjusted chart legend colors dynamically to ensure readability in dark mode, fetching colors from CSS variables.
  • Layout Update: Updated the base layout for the analytics page to use src/testpress/layout/student_layout.html and adjusted block names accordingly.

🧠 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
  • src/analytics/includes/analytics_scripts.html
    • Added borderColor and borderWidth properties to the chart dataset for visual consistency.
    • Implemented dynamic color and font styling for chart legend labels to support dark mode.
  • src/analytics/includes/breadcrumbs.html
    • Applied dark mode styling to breadcrumb links and their associated SVG icons.
  • src/analytics/includes/empty.html
    • Added dark mode classes to the empty state container, icon, and heading for proper theme integration.
  • src/analytics/includes/graphical_reports.html
    • Integrated dark mode styling for list items, subject titles, and navigation icons within graphical reports.
  • src/analytics/includes/page_heading.html
    • Updated the page heading with dark mode specific text colors.
  • src/analytics/includes/pagination.html
    • Applied dark mode styling to the pagination navigation, links, and SVG icons, including a distinct color for the active page.
  • src/analytics/includes/tabs.html
    • Added dark mode classes to the tab selection dropdown, tab container, and individual tab links and icons, with an updated active tab color.
  • src/analytics/includes/tabular_reports.html
    • Implemented dark mode styling for the table structure, headers, body, and detail links within tabular reports.
  • src/analytics/index.html
    • Updated the base layout template from layouts/student_base.html to src/testpress/layout/student_layout.html.
    • Changed the content block name from body_class to main_content.
    • Applied dark mode background and border styling to the main analytics content container.
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 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.

Comment on lines +53 to +54
color: getComputedStyle(document.documentElement)
.getPropertyValue('--tw-text-neutral-100') || '#f5f5f5',

Choose a reason for hiding this comment

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

high

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.

Suggested change
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>

Choose a reason for hiding this comment

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

medium

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.

Suggested change
<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>

@github-actions
Copy link

github-actions bot commented Mar 12, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-03-12 12:07 UTC

@barani-2502 barani-2502 merged commit f1ca6a5 into main Mar 12, 2026
6 of 7 checks passed
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.

1 participant