Git Komut Rehberi & Terminal Asistanı
Sıfırdan Yeni Bir Depo Başlatın:
Mevcut Bir Git Deposu veya Klasörü Gönderin:
Hataları Geri Alma, İptal & Temizlik:
Son commit'i geri al (yapılan değişiklikleri korur):
git reset --soft HEAD~1
Yapılan yerel değişiklikleri iptal et (çalışma ağacını temizler):
git restore .
Takip edilmeyen gereksiz dosyaları sil:
git clean -fd
Değişiklikleri geçici sakla ve geri getir (stash):
git stash git stash pop
Dal (Branch) ve Sürüm Etiketleri:
Yeni dal aç ve geçiş yap:
git checkout -b yeni-ozellik git push -u origin yeni-ozellik
Sürüm etiketi (tag) oluştur ve gönder:
git tag -a v1.0.0 -m "Sürüm 1.0.0" git push origin --tags
feat: improve shape tools and project previews
This commit is contained in:
@@ -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, workplaneSettingsFingerprint, workspaceHydrationSyncDecision } from "@/lib/workplaneSettings";
|
||||
import { canBeginShapeDrag, 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", () => {
|
||||
@@ -63,6 +63,43 @@ describe("workplane settings helpers", () => {
|
||||
expect(normalizeWorkspaceSettings({ gridColor: "not-a-color" }).gridColor).toBe(DEFAULT_WORKPLANE_WORKSPACE.gridColor);
|
||||
});
|
||||
|
||||
it("keeps app limits until a shape receives an explicit customization", () => {
|
||||
const untouched = normalizeWorkspaceSettings({});
|
||||
const customized = normalizeWorkspaceSettings({
|
||||
shapeCustomizations: {
|
||||
box: { width: 48, maxDimension: 720 },
|
||||
sphere: { height: Number.NaN, maxDimension: 9000 },
|
||||
},
|
||||
});
|
||||
|
||||
expect(untouched.shapeCustomizations).toEqual({});
|
||||
expect(shapeDimensionLimit(untouched, "box", 160)).toBe(160);
|
||||
expect(customized.shapeCustomizations.box).toEqual({ width: 48, maxDimension: 720 });
|
||||
expect(customized.shapeCustomizations.sphere).toEqual({ maxDimension: 2000 });
|
||||
expect(shapeDimensionLimit(customized, "box", 160)).toBe(720);
|
||||
expect(shapeDimensionLimit(customized, "cylinder", 220)).toBe(220);
|
||||
});
|
||||
|
||||
it("normalizes supported special-shape defaults", () => {
|
||||
const customized = normalizeWorkspaceSettings({
|
||||
shapeCustomizations: {
|
||||
cylinder: { sides: 500 },
|
||||
roundRoof: { sides: 900 },
|
||||
sphere: { steps: 2 },
|
||||
cone: { topRadius: -4, baseRadius: 9000, sides: 40 },
|
||||
text: { text: "A custom label that is much too long", font: "Serif", bevel: 12, segments: 9.6 },
|
||||
gear: { gearType: "helical", teeth: 23.7, toothSize: 3, centerHoleSize: -5, helixAngle: 90, helixQuality: 3 },
|
||||
},
|
||||
});
|
||||
|
||||
expect(customized.shapeCustomizations.cylinder).toEqual({ sides: 500 });
|
||||
expect(customized.shapeCustomizations.roundRoof).toEqual({ sides: 512 });
|
||||
expect(customized.shapeCustomizations.sphere).toEqual({ steps: 6 });
|
||||
expect(customized.shapeCustomizations.cone).toEqual({ topRadius: 0, baseRadius: 1000, sides: 40 });
|
||||
expect(customized.shapeCustomizations.text).toEqual({ text: "A custom label that is m", font: "Serif", bevel: 8, segments: 10 });
|
||||
expect(customized.shapeCustomizations.gear).toEqual({ gearType: "helical", teeth: 24, toothSize: 3, centerHoleSize: 0, helixAngle: 45, helixQuality: 4 });
|
||||
});
|
||||
|
||||
it("can require selection before a shape starts moving", () => {
|
||||
expect(canBeginShapeDrag(false, false)).toBe(true);
|
||||
expect(canBeginShapeDrag(true, false)).toBe(false);
|
||||
|
||||
Reference in New Issue
Block a user