feat: sesli CAD asistani, bellek optimizasyonlari ve akilli cozunurluk
CI / Typecheck and unit tests (push) Canceled after 0s
Build and Push Docker Images / build (push) Canceled after 0s

- SnapVoice Turkce sesli CAD ve komut konsolu (/denetle, /ram, /eko, /otomatik, /sessiz)
- 3B uzamsal sesli radar ve gorme engelli gelistirici geometri denetim motoru
- LibreDWG/DXF ikili sikistirma, font tembel yukleme ve RAM optimizasyonu
- Monitor cozunurlugune gore otomatik uyarlamali dinamik grafik modu
This commit is contained in:
Enes Yakıştır
2026-11-02 13:37:37 +03:00
parent c09407bcb3
commit e7b6db9db6
32 changed files with 5503 additions and 285 deletions
+22 -1
View File
@@ -1,7 +1,7 @@
import { describe, expect, it } from "vitest";
import type { WorkplaneWorkspaceSettings } from "@/types/sketchforge";
import { formatMeasurementNumber, lengthDisplayUnit, millimetersToDisplay, normalizeScaleForUnits, parseMeasurementInput, scaleOptionsForUnits } from "@/lib/measurementUnits";
import { canBeginShapeDrag, DEFAULT_SNAP_GRID, DEFAULT_WORKPLANE_WORKSPACE, normalizeSnapGrid, normalizeWorkspaceSettings, shapeDimensionLimit, workplaneSettingsFingerprint, workspaceHydrationSyncDecision } from "@/lib/workplaneSettings";
import { canBeginShapeDrag, computeEffectivePixelRatio, DEFAULT_SNAP_GRID, DEFAULT_WORKPLANE_WORKSPACE, normalizeSnapGrid, normalizeWorkspaceSettings, shapeDimensionLimit, workplaneSettingsFingerprint, workspaceHydrationSyncDecision } from "@/lib/workplaneSettings";
describe("workplane settings helpers", () => {
it("accepts known snap grid values and falls back for unknown values", () => {
@@ -160,4 +160,25 @@ describe("workplane settings helpers", () => {
expect(workspaceHydrationSyncDecision(hydratedCommit.pendingFingerprint, projectTwo).shouldSync).toBe(true);
});
it("computes effective pixel ratio automatically according to monitor DPI and scene load", () => {
// 1. Auto mode with high-DPI monitor (e.g. 2.0x 4K/Retina)
const autoSettings: WorkplaneWorkspaceSettings = { ...DEFAULT_WORKPLANE_WORKSPACE, resolutionMode: "auto" };
expect(computeEffectivePixelRatio(autoSettings, 5, 2.0)).toBe(2.0); // Modest scene: native crystal clear 2x
expect(computeEffectivePixelRatio(autoSettings, 30, 2.0)).toBe(1.25); // Medium scene: balanced 1.25x
expect(computeEffectivePixelRatio(autoSettings, 60, 2.0)).toBe(1.0); // Heavy scene: auto-fallback to 1.0x to prevent RAM crash
// 2. 1080p standard monitor (1.0x) stays 1.0x
expect(computeEffectivePixelRatio(autoSettings, 10, 1.0)).toBe(1.0);
// 3. Native mode: always preserves native monitor DPR
const nativeSettings: WorkplaneWorkspaceSettings = { ...DEFAULT_WORKPLANE_WORKSPACE, resolutionMode: "native" };
expect(computeEffectivePixelRatio(nativeSettings, 80, 2.0)).toBe(2.0);
// 4. Eco mode: always 1.0x
const ecoSettings: WorkplaneWorkspaceSettings = { ...DEFAULT_WORKPLANE_WORKSPACE, resolutionMode: "eco" };
expect(computeEffectivePixelRatio(ecoSettings, 2, 2.0)).toBe(1.0);
const lowMemSettings: WorkplaneWorkspaceSettings = { ...DEFAULT_WORKPLANE_WORKSPACE, lowMemoryMode: true };
expect(computeEffectivePixelRatio(lowMemSettings, 2, 2.0)).toBe(1.0);
});
});