fix(picker): cascade thread DPI contexts and harden the round-three review points

- setThreadDpiAwareness checks SetThreadDpiAwarenessContext's return value
  and cascades per-monitor-v2 -> per-monitor -> system-aware; DPI stays a
  deliberate cosmetic best-effort - a host accepting none (or lacking the
  API, pre-1607) still gets the modern dialog instead of a downgrade to the
  legacy fallback chain over a cosmetic concern.
- The mocked-koffi world now uses a distinctive 4-byte pointer width and
  rejects mis-sized out-buffers and mis-divided vtable offsets, so a
  regression to hardcoded 8s fails the suite (the ia32 bug class).
- A keyless built-worker e2e guard loads lib/worker.cjs under plain
  worker_threads on POSIX (the workflow-workerthread shape).
- The 'loaded lazily' module claims are reworded to attribute laziness to
  the dynamic import('koffi') calls, and the discarded close-attempt
  rejection is named at its catch.
This commit is contained in:
Huanqi Cao
2026-08-03 21:42:05 +08:00
parent 8500a21658
commit e182f03230
12 changed files with 128 additions and 35 deletions

View File

@@ -49,9 +49,12 @@ export interface Win32FolderDialog {
/** The thread-level native surface the dialog sequencing runs against. */
export interface Win32DialogBindings {
/**
* Best-effort per-monitor-v2 DPI opt-in for the calling thread. Absent
* before Windows 10 1703; implementations swallow only that absence, so an
* old host merely renders the dialog at system DPI.
* Opt the calling thread into the best supported DPI awareness
* (per-monitor-v2, then per-monitor, then system-aware), checking each
* call's result. Best-effort on purpose: a host accepting none of them
* (or lacking the API, pre-1607) still shows the modern dialog — possibly
* blurry above 100 % scaling — because a cosmetic degradation must not
* cost the tier.
*/
setThreadDpiAwareness(): void
/**