Address review: shared PlantChip + named recent-plants cap
Build image / build-and-push (push) Successful in 17s
Build image / build-and-push (push) Successful in 17s
Gadfly on #100: - Extracted the tap-to-arm chip (icon + name + armed state) into a shared PlantChip, used by both RecentPlants and SeedTray, so the two quick-pick surfaces can't drift. SeedTray composes it (rounded={false}) with its remove button into one seamless pill. - Named the recent-strip cap: RECENT_PLANTS_MAX = 8, was a bare slice(0, 8). Verified live: recent chips and the tray render identically post-refactor. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01H3zbym8Doka2d7D48maSgZ
This commit is contained in:
@@ -45,6 +45,10 @@ import { ApiError } from '@/lib/api'
|
||||
|
||||
const routeApi = getRouteApi('/gardens/$gardenId')
|
||||
|
||||
// How many recently-planted chips the Plants-mode quick strip shows — a working
|
||||
// set, not the whole history; the picker covers the long tail.
|
||||
const RECENT_PLANTS_MAX = 8
|
||||
|
||||
export function GardenEditorPage() {
|
||||
const { gardenId } = routeApi.useParams()
|
||||
const gid = Number(gardenId)
|
||||
@@ -118,7 +122,7 @@ export function GardenEditorPage() {
|
||||
const recentPlants = useMemo(
|
||||
() =>
|
||||
recentlyPlantedIds(plantings)
|
||||
.slice(0, 8)
|
||||
.slice(0, RECENT_PLANTS_MAX)
|
||||
.map((id) => plantsById.get(id))
|
||||
.filter((p): p is Plant => !!p),
|
||||
[plantings, plantsById],
|
||||
|
||||
Reference in New Issue
Block a user