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
Improve editor history, CAD tools, and ruler workflows
This commit is contained in:
@@ -4,7 +4,7 @@ import { useEffect, useState, type CSSProperties } from "react";
|
||||
import { Check, LoaderCircle, Minus, Plus, RotateCcw, X } from "lucide-react";
|
||||
import { displayStepFromMillimeters, displayToMillimeters, formatMeasurementNumber, lengthDisplayUnit, millimetersToDisplay } from "@/lib/measurementUnits";
|
||||
import type { CadModifierKind, CadModifierQuality } from "@/lib/cadModifierTypes";
|
||||
import { edgeModifierSelectionStatus } from "@/lib/cadModifierRuntime";
|
||||
import { CAD_MODIFIER_MAX_SHARP_ANGLE, edgeModifierSelectionStatus } from "@/lib/cadModifierRuntime";
|
||||
import type { WorkplaneWorkspaceSettings } from "@/types/sketchforge";
|
||||
|
||||
const MIN_EDGE_MODIFIER_AMOUNT = 0.001;
|
||||
@@ -104,8 +104,12 @@ function EdgeModifierSlider({
|
||||
onBlur={commitDraft}
|
||||
onKeyDown={(event) => {
|
||||
if (event.key === "Enter") {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
event.currentTarget.blur();
|
||||
} else if (event.key === "Escape") {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
setDraft(formatSliderValue(controlValue, workspace.accuracy, controlStep));
|
||||
setEditing(false);
|
||||
}
|
||||
@@ -216,8 +220,8 @@ export function EdgeModifierPanel({
|
||||
</div>
|
||||
|
||||
<div className="edge-modifier-quick-actions">
|
||||
<button type="button" disabled={!prepared} onClick={onSelectAll}>All sharp edges</button>
|
||||
<button type="button" disabled={!prepared} onClick={onClear}>Clear</button>
|
||||
<button type="button" disabled={!prepared || busy} onClick={onSelectAll}>All sharp edges</button>
|
||||
<button type="button" disabled={!prepared || busy} onClick={onClear}>Clear</button>
|
||||
</div>
|
||||
|
||||
{appliedFeatureCount > 0 ? (
|
||||
@@ -260,27 +264,27 @@ export function EdgeModifierPanel({
|
||||
step={EDGE_MODIFIER_AMOUNT_STEP}
|
||||
workspace={workspace}
|
||||
length
|
||||
disabled={!prepared}
|
||||
disabled={!prepared || busy}
|
||||
onChange={onAmountChange}
|
||||
/>
|
||||
|
||||
{kind === "chamfer" ? <EdgeModifierSlider label="Angle" value={chamferAngle} min={5} max={85} step={1} unit="deg" workspace={workspace} disabled={!prepared} onChange={onChamferAngleChange} /> : null}
|
||||
{kind === "chamfer" ? <EdgeModifierSlider label="Angle" value={chamferAngle} min={5} max={85} step={1} unit="deg" workspace={workspace} disabled={!prepared || busy} onChange={onChamferAngleChange} /> : null}
|
||||
|
||||
<EdgeModifierSlider label="Sharp-edge threshold" value={sharpAngle} min={1} max={120} step={1} unit="deg" workspace={workspace} disabled={!prepared} onChange={onSharpAngleChange} />
|
||||
<EdgeModifierSlider label="Sharp-edge threshold" value={sharpAngle} min={1} max={CAD_MODIFIER_MAX_SHARP_ANGLE} step={1} unit="deg" workspace={workspace} disabled={!prepared || busy} onChange={onSharpAngleChange} />
|
||||
|
||||
<label className="edge-modifier-check">
|
||||
<input type="checkbox" checked={tangentChain} disabled={!prepared} onChange={(event) => onTangentChainChange(event.currentTarget.checked)} />
|
||||
<input type="checkbox" checked={tangentChain} disabled={!prepared || busy} onChange={(event) => onTangentChainChange(event.currentTarget.checked)} />
|
||||
<span>Select tangent chains</span>
|
||||
</label>
|
||||
|
||||
<label className="edge-modifier-check">
|
||||
<input type="checkbox" checked={preserveEdgeSize} disabled={!prepared} onChange={(event) => onPreserveEdgeSizeChange(event.currentTarget.checked)} />
|
||||
<input type="checkbox" checked={preserveEdgeSize} disabled={!prepared || busy} onChange={(event) => onPreserveEdgeSizeChange(event.currentTarget.checked)} />
|
||||
<span>Keep edge size when resizing</span>
|
||||
</label>
|
||||
|
||||
<label className="edge-modifier-field">
|
||||
<span>Preview quality</span>
|
||||
<select value={quality} disabled={!prepared} onChange={(event) => onQualityChange(event.currentTarget.value as CadModifierQuality)}>
|
||||
<select value={quality} disabled={!prepared || busy} onChange={(event) => onQualityChange(event.currentTarget.value as CadModifierQuality)}>
|
||||
<option value="draft">Draft</option>
|
||||
<option value="standard">Standard</option>
|
||||
<option value="fine">Fine</option>
|
||||
|
||||
@@ -106,8 +106,6 @@ function getShapeProperties(shape: WorkplaneShape, onUpdate: ShapeInspectorUpdat
|
||||
if (shape.kind === "cylinder") {
|
||||
return [
|
||||
{ label: "Sides", value: shape.sides ?? 96, min: 3, max: 128, step: 1, onChange: (sides) => onUpdate({ sides: Math.round(sides) }) },
|
||||
{ label: "Bevel", value: shape.bevel ?? 0, min: 0, max: 10, onChange: (bevel) => onUpdate({ bevel }) },
|
||||
{ label: "Segments", value: shape.segments ?? 1, min: 1, max: 24, step: 1, onChange: (segments) => onUpdate({ segments: Math.round(segments) }) },
|
||||
{ label: "Length", value: depth, min: MIN_SHAPE_SIZE, max: 160, onChange: setDepth },
|
||||
{ label: "Width", value: width, min: MIN_SHAPE_SIZE, max: 160, onChange: setWidth },
|
||||
{ label: "Height", value: shape.height, min: MIN_SHAPE_SIZE, max: 160, onChange: setHeight },
|
||||
@@ -208,6 +206,7 @@ export function ShapeInspector({
|
||||
onEditSketch,
|
||||
canSeparateParts = false,
|
||||
onSeparateParts,
|
||||
onInteractionActiveChange,
|
||||
}: {
|
||||
shape: WorkplaneShape;
|
||||
snap: GridSize;
|
||||
@@ -220,6 +219,7 @@ export function ShapeInspector({
|
||||
onEditSketch?: () => void;
|
||||
canSeparateParts?: boolean;
|
||||
onSeparateParts?: () => void;
|
||||
onInteractionActiveChange?: (active: boolean) => void;
|
||||
}) {
|
||||
const solidColor = shape.hole ? fallbackSolidColor(shape) : shape.color;
|
||||
const locked = Boolean(shape.locked);
|
||||
@@ -227,6 +227,8 @@ export function ShapeInspector({
|
||||
const [propertiesOpen, setPropertiesOpen] = useState(true);
|
||||
const [colorOpen, setColorOpen] = useState(false);
|
||||
|
||||
useEffect(() => () => onInteractionActiveChange?.(false), [onInteractionActiveChange]);
|
||||
|
||||
return (
|
||||
<aside className="shape-inspector" aria-label={`${shape.name} shape settings`} onPointerDown={(event) => event.stopPropagation()}>
|
||||
<div className="shape-inspector-header">
|
||||
@@ -300,6 +302,8 @@ export function ShapeInspector({
|
||||
type="color"
|
||||
value={solidColor}
|
||||
disabled={locked}
|
||||
onFocus={() => onInteractionActiveChange?.(true)}
|
||||
onBlur={() => onInteractionActiveChange?.(false)}
|
||||
onChange={(event) => {
|
||||
onUpdate({ color: event.target.value, hole: false });
|
||||
setColorOpen(false);
|
||||
@@ -339,12 +343,12 @@ export function ShapeInspector({
|
||||
<div className="property-list" id={`properties-${shape.id}`}>
|
||||
{properties.map((property) => {
|
||||
if (property.type === "text") {
|
||||
return <TextProperty key={property.label} {...property} disabled={locked} />;
|
||||
return <TextProperty key={property.label} {...property} disabled={locked} onInteractionActiveChange={onInteractionActiveChange} />;
|
||||
}
|
||||
if (property.type === "select") {
|
||||
return <SelectProperty key={property.label} {...property} disabled={locked} />;
|
||||
}
|
||||
return <RangeProperty key={property.label} {...property} workspace={workspace} disabled={locked} />;
|
||||
return <RangeProperty key={property.label} {...property} workspace={workspace} disabled={locked} onInteractionActiveChange={onInteractionActiveChange} />;
|
||||
})}
|
||||
</div>
|
||||
) : null}
|
||||
@@ -403,7 +407,8 @@ function RangeProperty({
|
||||
workspace,
|
||||
disabled,
|
||||
onChange,
|
||||
}: RangePropertyConfig & { workspace: WorkplaneWorkspaceSettings; disabled?: boolean }) {
|
||||
onInteractionActiveChange,
|
||||
}: RangePropertyConfig & { workspace: WorkplaneWorkspaceSettings; disabled?: boolean; onInteractionActiveChange?: (active: boolean) => void }) {
|
||||
const allowsAboveSliderMax = label === "Length" || label === "Width" || label === "Height";
|
||||
const isLength = propertyUsesLengthUnit(label);
|
||||
const accuracy = workspace.accuracy;
|
||||
@@ -429,6 +434,7 @@ function RangeProperty({
|
||||
const nextModelValue = toModelValue(finiteNext);
|
||||
onChange(allowsAboveSliderMax ? Math.max(min, nextModelValue) : clamp(nextModelValue, min, max));
|
||||
setEditing(false);
|
||||
onInteractionActiveChange?.(false);
|
||||
};
|
||||
const handleSliderChange = (nextValue: number) => {
|
||||
const next = clamp(Number.isFinite(nextValue) ? nextValue : controlMin, controlMin, controlMax);
|
||||
@@ -449,6 +455,7 @@ function RangeProperty({
|
||||
disabled={disabled}
|
||||
inputMode="decimal"
|
||||
onFocus={() => {
|
||||
onInteractionActiveChange?.(true);
|
||||
setDraft(formatPropertyNumber(controlValue, accuracy, controlStep));
|
||||
setEditing(true);
|
||||
}}
|
||||
@@ -474,6 +481,11 @@ function RangeProperty({
|
||||
step={controlStep}
|
||||
value={sliderValue}
|
||||
disabled={disabled}
|
||||
onFocus={() => onInteractionActiveChange?.(true)}
|
||||
onBlur={() => onInteractionActiveChange?.(false)}
|
||||
onPointerDown={() => onInteractionActiveChange?.(true)}
|
||||
onPointerUp={() => onInteractionActiveChange?.(false)}
|
||||
onPointerCancel={() => onInteractionActiveChange?.(false)}
|
||||
onChange={(event) => handleSliderChange(Number(event.currentTarget.value))}
|
||||
/>
|
||||
</div>
|
||||
@@ -481,7 +493,7 @@ function RangeProperty({
|
||||
);
|
||||
}
|
||||
|
||||
function TextProperty({ label, value, disabled, onChange }: TextPropertyConfig & { disabled?: boolean }) {
|
||||
function TextProperty({ label, value, disabled, onChange, onInteractionActiveChange }: TextPropertyConfig & { disabled?: boolean; onInteractionActiveChange?: (active: boolean) => void }) {
|
||||
return (
|
||||
<label className="text-property">
|
||||
<span>{label}</span>
|
||||
@@ -491,6 +503,8 @@ function TextProperty({ label, value, disabled, onChange }: TextPropertyConfig &
|
||||
disabled={disabled}
|
||||
maxLength={24}
|
||||
spellCheck={false}
|
||||
onFocus={() => onInteractionActiveChange?.(true)}
|
||||
onBlur={() => onInteractionActiveChange?.(false)}
|
||||
onChange={(event) => onChange(event.currentTarget.value)}
|
||||
/>
|
||||
</label>
|
||||
|
||||
Reference in New Issue
Block a user