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
release: publish v0.6.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { Grid3X3, Palette, Ruler, X } from "lucide-react";
|
||||
import { useState, type CSSProperties } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import { normalizeScaleForUnits, scaleOptionsForUnits, WORKSPACE_UNIT_OPTIONS } from "@/lib/measurementUnits";
|
||||
import { DEFAULT_WORKPLANE_WORKSPACE } from "@/lib/workplaneSettings";
|
||||
import type { GridSize, WorkplaneWorkspaceSettings } from "@/types/sketchforge";
|
||||
@@ -52,15 +52,27 @@ export function WorkspaceSettingsModal({
|
||||
}) {
|
||||
const [defaultSaved, setDefaultSaved] = useState(false);
|
||||
const [activeSection, setActiveSection] = useState<WorkspaceSettingsSection>("appearance");
|
||||
const [dimensionDrafts, setDimensionDrafts] = useState(() => ({
|
||||
width: workspace.width.toFixed(workspace.accuracy),
|
||||
depth: workspace.depth.toFixed(workspace.accuracy),
|
||||
}));
|
||||
const scaleOptions = scaleOptionsForUnits(workspace.units);
|
||||
const scaleValue = normalizeScaleForUnits(workspace.units, workspace.scale);
|
||||
useEffect(() => {
|
||||
setDimensionDrafts({
|
||||
width: workspace.width.toFixed(workspace.accuracy),
|
||||
depth: workspace.depth.toFixed(workspace.accuracy),
|
||||
});
|
||||
}, [workspace.accuracy, workspace.depth, workspace.width]);
|
||||
const patchWorkspace = (patch: Partial<WorkspaceSettings>) => {
|
||||
setDefaultSaved(false);
|
||||
const next = { ...workspace, ...patch };
|
||||
onWorkspaceChange({ ...next, scale: normalizeScaleForUnits(next.units, next.scale) });
|
||||
};
|
||||
const setDimension = (key: "width" | "depth", value: string) => {
|
||||
const next = clamp(Number.parseFloat(value) || DEFAULT_WORKPLANE_WORKSPACE[key], MIN_WORKSPACE_SIZE, MAX_WORKSPACE_SIZE);
|
||||
const parsed = Number.parseFloat(value);
|
||||
const next = clamp(Number.isFinite(parsed) ? parsed : workspace[key], MIN_WORKSPACE_SIZE, MAX_WORKSPACE_SIZE);
|
||||
setDimensionDrafts((current) => ({ ...current, [key]: next.toFixed(workspace.accuracy) }));
|
||||
patchWorkspace({ [key]: next, sizePreset: "Custom" } as Partial<WorkspaceSettings>);
|
||||
};
|
||||
const setWorkspaceSizePreset = (sizePreset: string) => {
|
||||
@@ -113,15 +125,6 @@ export function WorkspaceSettingsModal({
|
||||
<strong>Appearance</strong>
|
||||
<span>Adjust the canvas and navigation behavior.</span>
|
||||
</div>
|
||||
<div className="workspace-row">
|
||||
<span>Background color</span>
|
||||
<button
|
||||
className="workspace-color-button"
|
||||
style={{ "--workspace-bg": workspace.background } as CSSProperties}
|
||||
aria-label="Background color"
|
||||
onClick={() => patchWorkspace({ background: workspace.background === "#f8fbfc" ? "#eaf7fb" : "#f8fbfc" })}
|
||||
/>
|
||||
</div>
|
||||
<WorkspaceToggle label="Show shadows" checked={workspace.showShadows} onChange={(showShadows) => patchWorkspace({ showShadows })} />
|
||||
<WorkspaceToggle label="Show grid" checked={workspace.showGrid} onChange={(showGrid) => patchWorkspace({ showGrid })} />
|
||||
<WorkspaceToggle
|
||||
@@ -199,22 +202,36 @@ export function WorkspaceSettingsModal({
|
||||
<span>Width</span>
|
||||
<input
|
||||
type="number"
|
||||
value={workspace.width.toFixed(workspace.accuracy)}
|
||||
value={dimensionDrafts.width}
|
||||
min={MIN_WORKSPACE_SIZE}
|
||||
max={MAX_WORKSPACE_SIZE}
|
||||
step={1}
|
||||
onChange={(event) => setDimension("width", event.currentTarget.value)}
|
||||
onChange={(event) => {
|
||||
const value = event.currentTarget.value;
|
||||
setDimensionDrafts((current) => ({ ...current, width: value }));
|
||||
}}
|
||||
onBlur={(event) => setDimension("width", event.currentTarget.value)}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === "Enter") event.currentTarget.blur();
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
<span>Length</span>
|
||||
<input
|
||||
type="number"
|
||||
value={workspace.depth.toFixed(workspace.accuracy)}
|
||||
value={dimensionDrafts.depth}
|
||||
min={MIN_WORKSPACE_SIZE}
|
||||
max={MAX_WORKSPACE_SIZE}
|
||||
step={1}
|
||||
onChange={(event) => setDimension("depth", event.currentTarget.value)}
|
||||
onChange={(event) => {
|
||||
const value = event.currentTarget.value;
|
||||
setDimensionDrafts((current) => ({ ...current, depth: value }));
|
||||
}}
|
||||
onBlur={(event) => setDimension("depth", event.currentTarget.value)}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === "Enter") event.currentTarget.blur();
|
||||
}}
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user