Chairs have no rotation controls (rotatable flag on configs)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 12:48:54 -04:00
parent 8c92def919
commit d98ce8ddb7
5 changed files with 29 additions and 24 deletions
+1
View File
@@ -162,6 +162,7 @@ export default function App() {
defaultWidth: d.width,
defaultHeight: d.height,
isTable: d.isTable,
rotatable: true,
available: d.available,
seatsPerUnit: d.seats,
},
+22 -20
View File
@@ -46,26 +46,28 @@ export function ItemPanel({ item, config, onPatch, onDelete, onClose }: Props) {
{item.locked ? " 🔒" : ""}
</div>
<div>
<div style={label}>Rotation</div>
<Wheel
value={item.rotation}
min={0}
max={359}
wrap
rows={3}
disabled={item.locked}
format={(v) => `${v}°`}
onChange={(v) => patch({ rotation: v })}
/>
<button
style={{ ...btn, marginTop: 8, width: "100%", opacity: item.locked ? 0.45 : 1 }}
disabled={item.locked}
onClick={() => patch({ rotation: (item.rotation + 90) % 360 })}
>
Rotate 90°
</button>
</div>
{config.rotatable && (
<div>
<div style={label}>Rotation</div>
<Wheel
value={item.rotation}
min={0}
max={359}
wrap
rows={3}
disabled={item.locked}
format={(v) => `${v}°`}
onChange={(v) => patch({ rotation: v })}
/>
<button
style={{ ...btn, marginTop: 8, width: "100%", opacity: item.locked ? 0.45 : 1 }}
disabled={item.locked}
onClick={() => patch({ rotation: (item.rotation + 90) % 360 })}
>
Rotate 90°
</button>
</div>
)}
{config.isTable && (
<div>
+3 -3
View File
@@ -19,9 +19,9 @@ export type Action =
| { kind: "addConfig"; config: FurnitureTypeConfig };
const BUILT_IN: FurnitureTypeConfig[] = [
{ id: "chair", name: "Chair", shape: "chair", defaultWidth: 0.5, defaultHeight: 0.5, isTable: false, available: 20 },
{ id: "table", name: "Table", shape: "table", defaultWidth: 1.8, defaultHeight: 0.8, isTable: true, available: 6, seatsPerUnit: 8 },
{ id: "screen", name: "Screen", shape: "screen", defaultWidth: 2, defaultHeight: 0.2, isTable: false, available: 2 },
{ id: "chair", name: "Chair", shape: "chair", defaultWidth: 0.5, defaultHeight: 0.5, isTable: false, rotatable: false, available: 20 },
{ id: "table", name: "Table", shape: "table", defaultWidth: 1.8, defaultHeight: 0.8, isTable: true, rotatable: true, available: 6, seatsPerUnit: 8 },
{ id: "screen", name: "Screen", shape: "screen", defaultWidth: 2, defaultHeight: 0.2, isTable: false, rotatable: true, available: 2 },
];
export const initialState: LayoutState = {
+1
View File
@@ -36,6 +36,7 @@ export interface FurnitureTypeConfig {
defaultWidth: number; // meters
defaultHeight: number;
isTable: boolean;
rotatable: boolean; // false = no rotation controls (chairs)
available: number; // inventory count
seatsPerUnit?: number; // type-level seats (tables, couches...)
}