Skip to content

feat(hardware): add Windows collector and split integrated/discrete GPUs - #6

Merged
kerwin2046 merged 2 commits into
mainfrom
dev-adnaan
Sep 29, 2026
Merged

kerwin2046 merged 2 commits into
mainfrom
dev-adnaan

Conversation

@ad-naan

@ad-naan ad-naan commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds first-class Windows hardware collection behind a platform-agnostic collector
interface, and fixes GPU reporting so laptops correctly surface both the integrated
and discrete adapters instead of collapsing them into one entry (and dropping the dGPU).

Type of change

  • Bug fix
  • New feature
  • Hardware / collector support
  • Refactor (no behaviour change)
  • Documentation
  • Build or CI

Testing

Tested on Windows (x64). CPU topology, memory modules, and GPU classification were
verified against a live snapshot showing both an integrated GPU and a discrete GPU
present and correctly labelled.

  • pnpm typecheck
  • pnpm lint
  • pnpm build
  • Verified in the browser

Checklist

  • New user-visible strings are added for both en and zh in src/i18n/
  • New hardware fields are nullable and degrade gracefully on non-Linux platforms
  • No serial numbers, MAC addresses, IP addresses, or UUIDs are collected
  • Layer boundaries are respected (nothing outside src/app and src/server imports src/server/**)
  • Documentation updated if behaviour or structure changed

Related issues

…d interface

The hardware layer previously hard-coded Linux sysfs reads inside machine.ts and live.ts, which broke on Windows (ERR_UNKNOWN_BUILTIN_MODULE / empty topology) and mixed OS concerns.

- Add collector.ts defining the HardwareCollector contract plus the shared HwmonDevice/HwmonSource types (moved out of linux.ts).
- Add platform.ts as the single entry point that selects the collector for the current OS and re-exports readCpuTopology, readMemoryModules, readHwmon, and readModuleTemps.
- Add windows.ts collector using Win32/PowerShell sources for CPU topology and memory modules; add darwin.ts stub so macOS degrades gracefully instead of throwing.
- Point live.ts at platform.ts instead of importing linux.ts directly.
- Ignore local .adnify/ tooling output.
The UI previously collapsed every controller into a single 'GPU' role, so laptops with both an iGPU and a dGPU only surfaced the integrated adapter, and remote-desktop virtual display drivers polluted the list.

- machine.ts: filter out software / remote-desktop display adapters (Sunlogin OrayIdd, DisplayLink, Parsec, ToDesk, IDD, Windows Basic Display, etc.) so only real silicon is reported; refine integrated detection (Onboard bus + iGPU model heuristics) and drop the discrete-first sort now that role is derived downstream. Also backfill P-core max frequency from the package max when deep topology omits it.
- parts.ts: add role-aware selectors and a dedicated gpu-discrete PartId; make gpuDetail resolve integrated vs discrete rather than the first controller.
- detail.ts: add gpuDiscrete label and discrete-GPU intro copy for both locales.
- Overview.tsx / Laptop.tsx / Shell.tsx: consume the role selectors, render a separate discrete-GPU card and focus target, and highlight the correct adapter.
@kerwin2046

Copy link
Copy Markdown
Owner

@ad-naan @yuxino Thank you for the great contribution! 🙌
It’s great to have you contributing to PC·XRAY! 🚀

@kerwin2046
kerwin2046 merged commit 643b6d3 into main Sep 29, 2026
0 of 2 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.

2 participants