Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/mapgen-studio/src/ui/components/ViewControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import React from 'react';
// `bg-accent` on hover / `bg-muted` when active. Native `title=` hints are now
// the shadcn Tooltip (token-styled, delay-grouped under the shell provider).
// ============================================================================
import { Sun, Moon, Monitor } from 'lucide-react';
import { Grid3x3, Sun, Moon, Monitor } from 'lucide-react';
import { cn } from '../utils';
import { Tooltip, TooltipContent, TooltipTrigger } from '../../components/ui';
import type { ThemePreference } from '../types';
Expand Down Expand Up @@ -106,7 +106,7 @@ export const ViewControls: React.FC<ViewControlsProps> = ({
aria-pressed={showGrid}
className={showGrid ? iconBtnActive : iconBtn}>

<div className="w-4 h-4" />
<Grid3x3 className="w-4 h-4" />
</button>
</TooltipTrigger>
<TooltipContent>{gridTooltip}</TooltipContent>
Expand Down
28 changes: 28 additions & 0 deletions openspec/changes/mapgen-studio-grid-icon/proposal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Grid toggle icon + icon-rendering consistency

## Why

The ViewControls grid toggle rendered a literal empty `<div className="w-4
h-4" />` where its glyph belongs — an invisible button body (the user saw an
empty "Hide grid" control). Treated categorically per the standing rule:
icons must render through the one icon system, with no empty placeholders.

## Target Authority Refs

- `docs/projects/mapgen-studio-redesign/pass-5-design-fixes.md` (X2)
- `apps/mapgen-studio/.interface-design/system.md` (icon contract: lucide-react
is the sole icon system)

## What Changes

- `ViewControls` grid toggle renders `Grid3x3` (lucide, `w-4 h-4` matching
its cluster).
- Categorical sweep (src + live DOM): no other empty icon-sized
placeholders, no inline `<svg>`, no non-lucide icon libraries. The only
other glyph-less visible button is the overrides `Switch`, whose thumb is
its body by design.

## Impact

- Affected specs: `mapgen-studio`
- Affected code: `apps/mapgen-studio/src/ui/components/ViewControls.tsx`
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## ADDED Requirements

### Requirement: Icon Controls Always Render A Glyph From The Icon System

Every icon-only control SHALL render a visible lucide-react glyph — no empty
icon-sized placeholders and no second icon system — with the grid visibility
toggle rendering the grid glyph.

#### Scenario: Grid toggle shows its glyph

- **WHEN** the view controls render
- **THEN** the grid visibility toggle contains a lucide grid icon sized to
its cluster (`w-4 h-4`)

#### Scenario: No empty icon placeholders anywhere

- **WHEN** the app shell renders
- **THEN** no visible icon-only button has an empty body (excluding switch
primitives, whose thumb is the body)
12 changes: 12 additions & 0 deletions openspec/changes/mapgen-studio-grid-icon/tasks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## 1. Implementation

- [x] 1.1 `ViewControls`: grid toggle renders `Grid3x3` (lucide, `w-4 h-4`).
- [x] 1.2 Categorical sweep: src grep (empty icon-sized divs, inline svg,
non-lucide libs) + live-DOM scan for glyph-less visible buttons.

## 2. Verification

- [x] 2.1 `bun run openspec -- validate mapgen-studio-grid-icon --strict`
- [x] 2.2 tsc + vitest green
- [x] 2.3 Live DOM: grid toggle contains an `svg`; only the overrides
Switch is legitimately glyph-less.