Editor: the toolkit is a rail tab on desktop, and the rail is wider #133
@@ -177,9 +177,7 @@ export const Canvas = forwardRef<
|
|||||||
st.setSel(m ? null : { type: 'object', id: o.id })
|
st.setSel(m ? null : { type: 'object', id: o.id })
|
||||||
st.setArmedKind(null)
|
st.setArmedKind(null)
|
||||||
st.setGhost(null)
|
st.setGhost(null)
|
||||||
// Focusing a bed is planting intent: the rail shows the plant palette
|
// Focusing is planting intent: the rail shows the toolkit's plant palette.
|
||||||
// (the toolkit's focused mode), not the inspector. A single click still
|
|
||||||
// selects into the Plot tab.
|
|
||||||
st.setTab('toolkit')
|
st.setTab('toolkit')
|
||||||
if (!el) return
|
if (!el) return
|
||||||
const bw = o.rotationDeg % 180 ? o.heightCm : o.widthCm
|
const bw = o.rotationDeg % 180 ? o.heightCm : o.widthCm
|
||||||
|
|||||||
+10
-12
@@ -14,18 +14,18 @@ import { useEditorStore } from './store'
|
|||||||
import type { EditorObject } from './types'
|
import type { EditorObject } from './types'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The desktop editor's toolkit. Out of focus: the seven object kinds as pill
|
* The desktop editor's toolkit, the rail's first tab. Out of focus: the seven
|
||||||
* rows — click to arm (then click the plan), or drag one straight onto it. In a
|
* object kinds as pill rows — click to arm (then click the plan), or drag one
|
||||||
* focused bed it swaps to the plant list with a search, same arm/drag behavior,
|
* straight onto it. In a focused bed it swaps to the plant list with a search,
|
||||||
* plus the bed's bulk tools (fill, clear, scan a packet).
|
* same arm/drag behavior, plus the bed's bulk tools (fill, clear, scan a
|
||||||
|
* packet).
|
||||||
*
|
*
|
||||||
* It started life as the workspace's left card (the handoff's layout) and now
|
* It started life as the workspace's left card (the handoff's layout) and
|
||||||
* lives as the first tab of the rail, so the plan and the rail get the width
|
* moved into the rail so the plan and the rail get the width the card took;
|
||||||
* the card took. `embedded` is that mode: no card chrome of its own, and no
|
* the rail's tab body provides the card chrome and the scrolling, and the tab
|
||||||
* "Toolkit" heading — the tab is the heading.
|
* is the heading.
|
||||||
*/
|
*/
|
||||||
export function Toolkit({
|
export function Toolkit({
|
||||||
embedded = false,
|
|
||||||
unit,
|
unit,
|
||||||
plants,
|
plants,
|
||||||
plantings,
|
plantings,
|
||||||
@@ -40,7 +40,6 @@ export function Toolkit({
|
|||||||
onClear,
|
onClear,
|
||||||
onScan,
|
onScan,
|
||||||
}: {
|
}: {
|
||||||
embedded?: boolean
|
|
||||||
unit: UnitPref
|
unit: UnitPref
|
||||||
plants: Plant[]
|
plants: Plant[]
|
||||||
plantings: EditorPlanting[]
|
plantings: EditorPlanting[]
|
||||||
@@ -62,10 +61,9 @@ export function Toolkit({
|
|||||||
const [query, setQuery] = useState('')
|
const [query, setQuery] = useState('')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn('flex min-h-0 flex-col gap-2 overflow-x-hidden', embedded ? 'flex-1' : 'panel overflow-y-auto p-3.5')}>
|
<div className="flex min-h-0 flex-1 flex-col gap-2 overflow-x-hidden">
|
||||||
{!focused ? (
|
{!focused ? (
|
||||||
<>
|
<>
|
||||||
{!embedded && <h6 className="mx-1 mb-1.5 mt-1">Toolkit</h6>}
|
|
||||||
{OBJECT_KINDS.map((k) => {
|
{OBJECT_KINDS.map((k) => {
|
||||||
const armed = armedKind === k.kind
|
const armed = armedKind === k.kind
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ const TRANSIENT = {
|
|||||||
armedLotId: null,
|
armedLotId: null,
|
||||||
ghost: null,
|
ghost: null,
|
||||||
seasonYear: null,
|
seasonYear: null,
|
||||||
tab: 'plot' as RailTab,
|
tab: 'plot' as RailTab, // the garden summary, not the first tab: a fresh editor shows what is there before how to add to it
|
||||||
mode: 'build' as PhoneMode,
|
mode: 'build' as PhoneMode,
|
||||||
journalScope: null,
|
journalScope: null,
|
||||||
liveObject: null,
|
liveObject: null,
|
||||||
|
|||||||
@@ -585,7 +585,6 @@ function Editor({
|
|||||||
const plot = inspector ?? <GardenSummary objects={objects} plantings={plantings} plantsById={plantsById} canEdit={canEdit} />
|
const plot = inspector ?? <GardenSummary objects={objects} plantings={plantings} plantsById={plantsById} canEdit={canEdit} />
|
||||||
const toolkit = (
|
const toolkit = (
|
||||||
<Toolkit
|
<Toolkit
|
||||||
embedded
|
|
||||||
unit={unit}
|
unit={unit}
|
||||||
plants={plants}
|
plants={plants}
|
||||||
plantings={plantings}
|
plantings={plantings}
|
||||||
|
|||||||
Reference in New Issue
Block a user