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
checkpoint: stabilize editor geometry and workspace settings
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { X } from "lucide-react";
|
||||
import type { CSSProperties } from "react";
|
||||
import { useState, type CSSProperties } from "react";
|
||||
import { DEFAULT_WORKPLANE_WORKSPACE } from "@/lib/workplaneSettings";
|
||||
import type { GridSize, WorkplaneWorkspaceSettings } from "@/types/sketchforge";
|
||||
|
||||
@@ -38,15 +38,21 @@ export function WorkspaceSettingsModal({
|
||||
snap,
|
||||
onWorkspaceChange,
|
||||
onSnapChange,
|
||||
onMakeDefault,
|
||||
onClose,
|
||||
}: {
|
||||
workspace: WorkspaceSettings;
|
||||
snap: GridSize;
|
||||
onWorkspaceChange: (next: WorkspaceSettings) => void;
|
||||
onSnapChange: (next: GridSize) => void;
|
||||
onMakeDefault: () => void;
|
||||
onClose: () => void;
|
||||
}) {
|
||||
const patchWorkspace = (patch: Partial<WorkspaceSettings>) => onWorkspaceChange({ ...workspace, ...patch });
|
||||
const [defaultSaved, setDefaultSaved] = useState(false);
|
||||
const patchWorkspace = (patch: Partial<WorkspaceSettings>) => {
|
||||
setDefaultSaved(false);
|
||||
onWorkspaceChange({ ...workspace, ...patch });
|
||||
};
|
||||
const setDimension = (key: "width" | "depth", value: string) => {
|
||||
const next = clamp(Number.parseFloat(value) || DEFAULT_WORKPLANE_WORKSPACE[key], MIN_WORKSPACE_SIZE, MAX_WORKSPACE_SIZE);
|
||||
patchWorkspace({ [key]: next, sizePreset: "Custom" } as Partial<WorkspaceSettings>);
|
||||
@@ -122,7 +128,21 @@ export function WorkspaceSettingsModal({
|
||||
options={["1:1 (millimeters)", "1:10 (centimeters)", "1:100 (meters)", "1:1000 (meters)"]}
|
||||
onChange={(scale) => patchWorkspace({ scale })}
|
||||
/>
|
||||
<WorkspaceSelect label="Snap Grid" value={snap} options={GRID_SIZES} onChange={(next) => onSnapChange(next as GridSize)} />
|
||||
<WorkspaceSelect
|
||||
label="Accuracy"
|
||||
value={`0.${"0".repeat(workspace.accuracy)}`}
|
||||
options={["0.0", "0.00", "0.000"]}
|
||||
onChange={(accuracy) => patchWorkspace({ accuracy: accuracy.slice(2).length as WorkspaceSettings["accuracy"] })}
|
||||
/>
|
||||
<WorkspaceSelect
|
||||
label="Snap Grid"
|
||||
value={snap}
|
||||
options={GRID_SIZES}
|
||||
onChange={(next) => {
|
||||
setDefaultSaved(false);
|
||||
onSnapChange(next as GridSize);
|
||||
}}
|
||||
/>
|
||||
<WorkspaceSelect
|
||||
label="Workplane size"
|
||||
value={workspace.sizePreset}
|
||||
@@ -135,7 +155,7 @@ export function WorkspaceSettingsModal({
|
||||
<span>Width</span>
|
||||
<input
|
||||
type="number"
|
||||
value={workspace.width.toFixed(2)}
|
||||
value={workspace.width.toFixed(workspace.accuracy)}
|
||||
min={MIN_WORKSPACE_SIZE}
|
||||
max={MAX_WORKSPACE_SIZE}
|
||||
step={1}
|
||||
@@ -146,7 +166,7 @@ export function WorkspaceSettingsModal({
|
||||
<span>Length</span>
|
||||
<input
|
||||
type="number"
|
||||
value={workspace.depth.toFixed(2)}
|
||||
value={workspace.depth.toFixed(workspace.accuracy)}
|
||||
min={MIN_WORKSPACE_SIZE}
|
||||
max={MAX_WORKSPACE_SIZE}
|
||||
step={1}
|
||||
@@ -161,7 +181,7 @@ export function WorkspaceSettingsModal({
|
||||
<span>Block size</span>
|
||||
<input
|
||||
type="number"
|
||||
value={workspace.gridBlockSize.toFixed(2)}
|
||||
value={workspace.gridBlockSize.toFixed(workspace.accuracy)}
|
||||
min={MIN_GRID_BLOCK_SIZE}
|
||||
max={MAX_GRID_BLOCK_SIZE}
|
||||
step={0.5}
|
||||
@@ -171,8 +191,14 @@ export function WorkspaceSettingsModal({
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
<button className="make-default-button" onClick={() => onWorkspaceChange(DEFAULT_WORKPLANE_WORKSPACE)}>
|
||||
Make default
|
||||
<button
|
||||
className="make-default-button"
|
||||
onClick={() => {
|
||||
onMakeDefault();
|
||||
setDefaultSaved(true);
|
||||
}}
|
||||
>
|
||||
{defaultSaved ? "Default saved" : "Make default"}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user