Skip to content

FEATURE 2 - Mesh selection outline #162

@lightningpixel

Description

@lightningpixel

FEATURE 2 — Mesh selection outline

As a user viewing a generated mesh, I want a visible outline around the
mesh when I click it, so I get clear feedback that it's selected before acting
on it (transform, delete, export).

The selection state already exists in Viewer3D.tsx (selected,
onSelect, onPointerMissed, click on the <primitive>), but there is no
visual indication. This ticket adds only the outline rendering.

Scope

  • Clicking the mesh draws a highlight outline around it.
  • Clicking empty space (onPointerMissed) removes the outline.
  • Outline follows the mesh across all view modes (solid / wireframe / normals
    / matcap / uv) and auto-rotate.
  • Subtle, on-brand color (e.g. violet #8b5cf6, matching the app accent).

Implementation

  • src/areas/generate/components/Viewer3D.tsx:
    • Wrap the scene contents in <Selection> and add <EffectComposer> with
      <Outline> (both from @react-three/postprocessing, already a dependency).
    • Wrap the mesh <primitive> in <Select enabled={selected}> so the outline
      is driven by the existing selected state — no new selection logic needed.
    • Tune <Outline> props: edgeStrength, visibleEdgeColor,
      hiddenEdgeColor, blur.
  • No backend, store, or API changes.

Acceptance criteria

  • Clicking the mesh shows an outline around it.
  • Clicking empty space removes the outline.
  • Outline renders correctly in every view mode and during auto-rotate.
  • No noticeable performance regression (composer enabled only when needed).
  • Existing Delete-to-remove and selection hint text still work.

Estimate: S

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status
    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions