-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Reset activity panel error icon to normal state when clicked #4379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset activity panel error icon to normal state when clicked #4379
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary of Changes
Hello @deluan, 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 user experience of the activity panel by introducing a way to visually acknowledge errors. When an error occurs, an error icon is displayed; however, once the user clicks to open the panel, this icon is replaced by the standard 'OK' icon, indicating the error has been seen, while the detailed error message remains visible within the panel. This change is accompanied by new unit tests to ensure the robustness of this new behavior.
Highlights
- Improved UI Error Handling: Implemented a mechanism to acknowledge and clear the activity panel's error icon once the user opens the panel, providing a better visual indication of acknowledged issues without hiding the underlying error message.
- Enhanced Test Coverage: Added a new test file (
ActivityPanel.test.jsx
) with a dedicated test case to verify the correct behavior of the activity panel's error icon clearing logic upon user interaction.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
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 issue 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 or fill out our survey to provide feedback.
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
-
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. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves error handling in the ActivityPanel component by implementing error acknowledgment functionality and adding comprehensive test coverage.
- Adds state management to track when users acknowledge errors by opening the activity panel
- Implements automatic error icon reset behavior that changes the icon from error to normal state after user interaction
- Introduces test coverage for the ActivityPanel component with focus on error handling behavior
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
ui/src/layout/ActivityPanel.jsx | Adds error acknowledgment state management and updates icon display logic |
ui/src/layout/ActivityPanel.test.jsx | Adds new test file covering error icon reset functionality |
Comments suppressed due to low confidence (2)
ui/src/layout/ActivityPanel.test.jsx:5
- The test file only covers the error acknowledgment scenario. Consider adding tests for the normal state (no error), scanning state, and edge cases like multiple clicks or state transitions.
import { describe, it, beforeEach } from 'vitest'
ui/src/layout/ActivityPanel.test.jsx:12
- The mock is missing the 'vi' import statement. This should be imported from 'vitest' to avoid potential runtime errors.
vi.mock('../subsonic', () => ({
There was a problem hiding this 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 improves error handling in the Activity Panel by making the error icon clearable by the user. It also introduces tests for this new behavior. The implementation works, but I've suggested a refactoring to simplify the logic and improve maintainability. Additionally, I've found a critical issue in the new test file where a mock is misconfigured, which would cause the test to fail. A fix is provided.
Replaced boolean errorAcknowledged state with acknowledgedError string state to track which specific error was acknowledged. This prevents icon flickering when error messages change and simplifies the logic by removing the need for useEffect. Key changes: - Changed from errorAcknowledged boolean to acknowledgedError string state - Added derived isErrorVisible computed value for cleaner logic - Removed useEffect dependency on scanStatus.error changes - Updated handleMenuOpen to store actual error string instead of boolean flag - Fixed test mock to return proper error state matching test expectations This change addresses code review feedback and follows React best practices by using derived state instead of imperative effects.
Description
This PR improves the user experience of the activity panel by resetting the error icon to its normal state when the user clicks on it, while preserving the error message visibility within the panel itself.
Problem: Previously, when a scan error occurred, the activity panel icon would remain in an error state (showing an error icon) indefinitely, even after the user opened the panel to view the error details. This created visual noise and didn't provide a way for users to acknowledge they had seen the error.
Solution: The icon now returns to its normal state after the user clicks it for the first time, indicating they have acknowledged the error. The error message remains visible in the activity panel, ensuring users can still access the error details.
Related Issues
This addresses a UX improvement request from a client.
Type of Change
Implementation Details
errorAcknowledged
state to track when the user has clicked the activity panel while an error is presentscanStatus.error
exists AND!errorAcknowledged
useEffect
watchingscanStatus.error
)data-testid
attributes to both icon states for better testabilityBehavior Details
Checklist
Please review and check all that apply:
How to Test
Additional Notes