Skip to content

Conversation

@urmauur
Copy link
Member

@urmauur urmauur commented Jul 24, 2025

Describe Your Changes

This pull request enhances the hardware settings and system monitor functionality by improving data fetching, error handling, and user experience. Key changes include adding loading states for hardware information, refining system usage polling, and improving code structure for better readability and maintainability.

Hardware Settings Enhancements:

  1. Loading State for Hardware Information:

    • Introduced an isLoading state and a loading spinner to display a message while hardware information is being fetched. [1] [2] [3]
  2. Improved Data Fetching:

    • Added a new getHardwareInfo service to fetch hardware details alongside system usage during the initial load. Errors are now logged for better debugging. [1] [2]
  3. Error Handling for Polling:

    • Enhanced error handling for periodic system usage polling to log failures without disrupting the UI.

System Monitor Enhancements:

  1. Polling System Usage:
    • Added a periodic polling mechanism to fetch system usage data every 5 seconds, with error handling to log failures. [1] [2]

Code Quality Improvements:

  1. Refactored Memory Usage Calculation:
    • Improved readability of memory usage calculation by reformatting code for better clarity.

Fixes Issues

  • Closes #
  • Closes #

Self Checklist

  • Added relevant comments, esp in complex areas
  • Updated docs (for bug fixes / features)
  • Created issues for follow-up changes or refactoring needed

Important

Enhances system monitoring and hardware settings with loading states, improved data fetching, error handling, and periodic polling.

  • Behavior:
    • Adds isLoading state and loading spinner in hardware.tsx to indicate hardware info fetching.
    • Introduces getHardwareInfo service in hardware.tsx for fetching hardware details.
    • Implements periodic polling every 5 seconds for system usage in hardware.tsx and system-monitor.tsx.
    • Logs errors during hardware info and system usage fetching in hardware.tsx and system-monitor.tsx.
  • Code Quality:
    • Refactors memory usage calculation in system-monitor.tsx for clarity.

This description was created by Ellipsis for 1463266. You can customize this summary. It will automatically update as commits are pushed.

@urmauur urmauur added this to the v0.6.6 milestone Jul 24, 2025
@urmauur urmauur requested review from louis-jan and qnixsynapse July 24, 2025 05:15
@urmauur urmauur self-assigned this Jul 24, 2025
@urmauur urmauur added this to Jan Jul 24, 2025
@urmauur urmauur moved this to Needs Review in Jan Jul 24, 2025
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to 1463266 in 1 minute and 55 seconds. Click for details.
  • Reviewed 479 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 3 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. web-app/src/routes/settings/hardware.tsx:239
  • Draft comment:
    Consider simplifying the conditional check for CPU extensions by directly using hardwareData.cpu?.extensions?.length > 0 instead of joining the array and checking the string length.
  • Reason this comment was not posted:
    Comment was on unchanged code.
2. web-app/src/routes/system-monitor.tsx:39
  • Draft comment:
    The polling logic for getSystemUsage is duplicated here; consider refactoring this into a shared custom hook to reduce redundancy.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment claims there is duplication but I only see one polling implementation. Without seeing evidence of duplication elsewhere, this comment appears to be speculative or incorrect. Even if there is duplication somewhere else in the codebase, that would be a cross-file issue which we're instructed to ignore. I could be missing duplicate polling logic in other files. The reviewer may have broader context about similar patterns elsewhere in the codebase. Even if there is duplication elsewhere, we're explicitly told to ignore cross-file issues. Within this file alone, there is no evidence of duplication. The comment should be deleted as it claims there is code duplication without providing clear evidence within this file, and any potential duplication across files should be ignored per our instructions.
3. web-app/src/routes/system-monitor.tsx:97
  • Draft comment:
    Ensure to guard against division by zero in the RAM usage calculation, as hardwareData.total_memory may be zero.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_PsERftlumnZV7NQR

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

@github-actions
Copy link
Contributor

Copy link
Contributor

@louis-jan louis-jan left a comment

Choose a reason for hiding this comment

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

LGTM

@urmauur urmauur merged commit 5d00cf6 into release/v0.6.6 Jul 24, 2025
19 of 21 checks passed
@urmauur urmauur deleted the fix/system-information branch July 24, 2025 05:39
@github-project-automation github-project-automation bot moved this from Needs Review to QA in Jan Jul 24, 2025
@urmauur urmauur moved this from QA to Done in Jan Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants