Skip to content

Fix: hide motherboard component on unsupported OS#1110

Merged
shm11C3 merged 1 commit into
developfrom
fix/hide-motherboard-on-unsupported-os
Feb 13, 2026
Merged

Fix: hide motherboard component on unsupported OS#1110
shm11C3 merged 1 commit into
developfrom
fix/hide-motherboard-on-unsupported-os

Conversation

@shm11C3

@shm11C3 shm11C3 commented Feb 13, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings February 13, 2026 17:25
@github-actions github-actions Bot added bug Something isn't working frontend labels Feb 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 79.84% (🎯 60%) 800 / 1002
🔵 Statements 77.81% (🎯 60%) 828 / 1064
🔵 Functions 71.2% (🎯 60%) 178 / 250
🔵 Branches 66.76% (🎯 60%) 231 / 346
File CoverageNo changed files found.
Generated in workflow #2224 for commit bdd594e by the Vitest Coverage Report Action

@shm11C3 shm11C3 merged commit 7147e82 into develop Feb 13, 2026
22 checks passed
@shm11C3 shm11C3 deleted the fix/hide-motherboard-on-unsupported-os branch February 13, 2026 17:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 hides the Motherboard dashboard item on OSes where it isn’t supported, preventing users from selecting or rendering that component outside of Windows.

Changes:

  • Filter the dashboard item selector list to exclude motherboard when not on Windows.
  • Render MotherboardDataInfo only when platform() === "windows".

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/features/hardware/dashboard/components/DashboardItemSelector.tsx Filters selectable dashboard items to hide motherboard on non-Windows.
src/features/hardware/dashboard/Dashboard.tsx Conditionally renders the motherboard dashboard component only on Windows.

Comment on lines 24 to 26
const { t } = useTranslation();
const os = platform();

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

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

platform() is evaluated on every render and it runs even when the component immediately returns null (when visibleItems is falsy). Consider moving the OS lookup after the early return and memoizing/caching it (e.g., useMemo) so the dropdown render doesn’t repeatedly call into the OS plugin unnecessarily.

Copilot uses AI. Check for mistakes.
Comment on lines 53 to 57
const { t } = useTranslation();
const sensors = useSensors(useSensor(PointerSensor));
const { visibleItems, toggleItem } = useDashboardSelector();
const os = platform();

Copilot AI Feb 13, 2026

Copy link

Choose a reason for hiding this comment

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

platform() is called directly in the component body, which means it runs on every re-render. If this call is non-trivial (plugin invoke), it should be memoized/cached (e.g., useMemo) or computed once higher up and passed down, so rendering/drag interactions don’t repeatedly re-query the OS.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants