glyphfield / src/components
Purpose
Own interactive Studio editors, shared controls, direct manipulation, authentic
Canvas/WebGL/Lottie rendering, export UI, and documentation presentation.
Mental model & key files
StudioApp.tsx owns projects, tabs, active tool, and identity selection.
StudioToolWorkspace.tsx is the public tool-to-editor switch.
ShaderLabStudio.tsx is Design Lab despite the historical filename.
AnimationStudio.tsx, TimelinePanel.tsx, and audio components own motion.
CanvasViewport, EditableCanvasLayer, layer panels, ColorControl,
StudioSelect, and range controls are reusable editor primitives.
StudioArtboardBar shares Animation's artboard controls with Design Lab.
DesignVersionProvider owns one saved-design state; split history/file-action
consumers can sit in different bars without duplicating persistence.
SourceCodeDrawer is the human surface for tool serializers/validators.
Import its lightweight SourceCodeButton leaf when the drawer loads on demand.
LiveMaterialCanvas and adapters own authentic shader rendering.
DocsMdx.tsx owns reusable rich documentation components.
Patterns to follow / invariants
- Host components own state; shared controls are controlled and semantic.
- Use accessible labels that are unique within the active tool; agents operate them.
- Preview and export must consume the same resolved values.
- View zoom/pan never mutates artifact geometry.
- Canvas manipulation emits document/tool coordinates, not screen coordinates.
- Use shared color, select, range, button, scrollbar, header, and panel systems.
- Long-running exports expose progress and a stable Browser API action.
- Pause hidden/offscreen animation and honor reduced motion where applicable.
- The landing hero renders the real editor in initial HTML; do not put its
primary UI behind idle/admission timers. Presentation mode skips portable
source/autosave work, not editing or authentic rendering.
Common tasks → first action
- Add a control → find the shared control, add a precise accessible label, persist
through the host state, serialize it, and confirm export consumes it.
- Add a layer type → update render, selection, ordering, duplication/deletion,
serializer/adapter, saved design, source application, and export together.
- Add a shader behavior → update authentic preview, thumbnail/fallback, shared
settings, Animation compatibility, catalog metadata, and motion capture.
- Add export → return a typed non-empty artifact, expose it through automation,
add preview/download UI, and test MIME/filename/state consistency.
- Change docs visuals → use
DocsMedia, DocsMediaGrid, and DocsFeatureGrid.
Gotchas
Design Lab receives internal draft scope logo-shader but its automation/public ID
must be material. Do not infer render completion from a React state commit. Logo
shadows/outlines must follow alpha rather than rectangular bounds. Avoid independent
preview clocks for gallery cards. Do not run simultaneous GIF/MP4 exports.
1---2name: src-components-skill3description: Studio editors, shared UI systems, and authentic browser renderers.4---56# glyphfield / src/components78## Purpose910Own interactive Studio editors, shared controls, direct manipulation, authentic11Canvas/WebGL/Lottie rendering, export UI, and documentation presentation.1213## Mental model & key files1415- `StudioApp.tsx` owns projects, tabs, active tool, and identity selection.16- `StudioToolWorkspace.tsx` is the public tool-to-editor switch.17- `ShaderLabStudio.tsx` is Design Lab despite the historical filename.18- `AnimationStudio.tsx`, `TimelinePanel.tsx`, and audio components own motion.19- `CanvasViewport`, `EditableCanvasLayer`, layer panels, `ColorControl`,20 `StudioSelect`, and range controls are reusable editor primitives.21- `StudioArtboardBar` shares Animation's artboard controls with Design Lab.22 `DesignVersionProvider` owns one saved-design state; split history/file-action23 consumers can sit in different bars without duplicating persistence.24- `SourceCodeDrawer` is the human surface for tool serializers/validators.25 Import its lightweight `SourceCodeButton` leaf when the drawer loads on demand.26- `LiveMaterialCanvas` and adapters own authentic shader rendering.27- `DocsMdx.tsx` owns reusable rich documentation components.2829## Patterns to follow / invariants3031- Host components own state; shared controls are controlled and semantic.32- Use accessible labels that are unique within the active tool; agents operate them.33- Preview and export must consume the same resolved values.34- View zoom/pan never mutates artifact geometry.35- Canvas manipulation emits document/tool coordinates, not screen coordinates.36- Use shared color, select, range, button, scrollbar, header, and panel systems.37- Long-running exports expose progress and a stable Browser API action.38- Pause hidden/offscreen animation and honor reduced motion where applicable.39- The landing hero renders the real editor in initial HTML; do not put its40 primary UI behind idle/admission timers. Presentation mode skips portable41 source/autosave work, not editing or authentic rendering.4243## Common tasks → first action4445- Add a control → find the shared control, add a precise accessible label, persist46 through the host state, serialize it, and confirm export consumes it.47- Add a layer type → update render, selection, ordering, duplication/deletion,48 serializer/adapter, saved design, source application, and export together.49- Add a shader behavior → update authentic preview, thumbnail/fallback, shared50 settings, Animation compatibility, catalog metadata, and motion capture.51- Add export → return a typed non-empty artifact, expose it through automation,52 add preview/download UI, and test MIME/filename/state consistency.53- Change docs visuals → use `DocsMedia`, `DocsMediaGrid`, and `DocsFeatureGrid`.5455## Gotchas5657Design Lab receives internal draft scope `logo-shader` but its automation/public ID58must be `material`. Do not infer render completion from a React state commit. Logo59shadows/outlines must follow alpha rather than rectangular bounds. Avoid independent60preview clocks for gallery cards. Do not run simultaneous GIF/MP4 exports.