Skip to content

Commit 48f3dbe

Browse files
Merge pull request #87 from jamesrochabrun/jroch-more-ideas
[codex] Add animation project scaffold
2 parents c9de886 + c9a5b70 commit 48f3dbe

19 files changed

Lines changed: 1586 additions & 4 deletions

Easel/CanvasWorkspaceEmptyState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ enum CanvasWorkspaceEmptyStateContent: Equatable {
5656
var message: String {
5757
switch self {
5858
case .noDesigns:
59-
return "Create a prototype, slide deck, or design system to start working."
59+
return "Create a prototype, slide deck, animation, or design system to start working."
6060
case .noSelection:
6161
return "Select an existing design or create a new one before sending a message."
6262
}

EaselTests/DesignKindSymbolPaletteTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ struct DesignKindSymbolPaletteTests {
3232
func projectKindsResolveToTheirMatchingLibraryPalettes() {
3333
#expect(DesignLibraryItemKind(projectKind: .prototype).symbolPalette == .prototype)
3434
#expect(DesignLibraryItemKind(projectKind: .slideDeck).symbolPalette == .slideDeck)
35+
#expect(DesignLibraryItemKind(projectKind: .animation).symbolPalette == .animation)
3536
}
3637
}
3738

Packages/EaselChat/Package.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ let package = Package(
4848
.product(name: "CodeEditSourceEditor", package: "CodeEditSourceEditor"),
4949
.product(name: "CodeEditLanguages", package: "CodeEditLanguages"),
5050
],
51+
resources: [
52+
.copy("ProjectTemplateAssets")
53+
],
5154
swiftSettings: [
5255
.swiftLanguageMode(.v5)
5356
]

Packages/EaselChat/Sources/EaselChat/DesignLibrary/DesignKindSymbolPalette.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import SwiftUI
88
enum DesignKindSymbolPalette {
99
case prototype
1010
case slideDeck
11+
case animation
1112
case designSystem
1213

1314
func accent(for colorScheme: ColorScheme) -> Color {
@@ -20,6 +21,10 @@ enum DesignKindSymbolPalette {
2021
return Color(red: 0.34, green: 0.45, blue: 0.74)
2122
case (.slideDeck, .dark):
2223
return Color(red: 0.66, green: 0.75, blue: 0.98)
24+
case (.animation, .light):
25+
return Color(red: 0.76, green: 0.36, blue: 0.22)
26+
case (.animation, .dark):
27+
return Color(red: 0.98, green: 0.64, blue: 0.46)
2328
case (.designSystem, .light):
2429
return Color(red: 0.55, green: 0.42, blue: 0.68)
2530
case (.designSystem, .dark):
@@ -39,6 +44,10 @@ enum DesignKindSymbolPalette {
3944
return Color(red: 0.64, green: 0.72, blue: 0.94)
4045
case (.slideDeck, .dark):
4146
return Color(red: 0.27, green: 0.34, blue: 0.54)
47+
case (.animation, .light):
48+
return Color(red: 0.94, green: 0.64, blue: 0.52)
49+
case (.animation, .dark):
50+
return Color(red: 0.52, green: 0.26, blue: 0.18)
4251
case (.designSystem, .light):
4352
return Color(red: 0.76, green: 0.64, blue: 0.82)
4453
case (.designSystem, .dark):
@@ -56,6 +65,8 @@ extension DesignLibraryItemKind {
5665
return .prototype
5766
case .slideDeck:
5867
return .slideDeck
68+
case .animation:
69+
return .animation
5970
case .designSystem:
6071
return .designSystem
6172
}

Packages/EaselChat/Sources/EaselChat/DesignLibrary/DesignLibraryItemKind.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Foundation
88
public enum DesignLibraryItemKind: String, Codable, CaseIterable, Identifiable, Sendable {
99
case prototype
1010
case slideDeck
11+
case animation
1112
case designSystem
1213

1314
public var id: String {
@@ -20,6 +21,8 @@ public enum DesignLibraryItemKind: String, Codable, CaseIterable, Identifiable,
2021
return "Prototype"
2122
case .slideDeck:
2223
return "Slide deck"
24+
case .animation:
25+
return "Animation"
2326
case .designSystem:
2427
return "Design system"
2528
}
@@ -32,6 +35,8 @@ public enum DesignLibraryItemKind: String, Codable, CaseIterable, Identifiable,
3235
return "Prototypes"
3336
case .slideDeck:
3437
return "Slide Decks"
38+
case .animation:
39+
return "Animations"
3540
case .designSystem:
3641
return "Design Systems"
3742
}
@@ -43,6 +48,8 @@ public enum DesignLibraryItemKind: String, Codable, CaseIterable, Identifiable,
4348
return "rectangle.inset.filled"
4449
case .slideDeck:
4550
return "rectangle.on.rectangle"
51+
case .animation:
52+
return "play.rectangle"
4653
case .designSystem:
4754
return "square.grid.2x2"
4855
}
@@ -58,6 +65,8 @@ public enum DesignLibraryItemKind: String, Codable, CaseIterable, Identifiable,
5865
self = .prototype
5966
case .slideDeck:
6067
self = .slideDeck
68+
case .animation:
69+
self = .animation
6170
}
6271
}
6372
}

Packages/EaselChat/Sources/EaselChat/DesignLibrary/DesignLibraryView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public struct DesignLibraryView: View {
116116
ContentUnavailableView {
117117
Label("No designs", systemImage: "square.grid.2x2")
118118
} description: {
119-
Text("Create a prototype, slide deck, or design system to see it here.")
119+
Text("Create a prototype, slide deck, animation, or design system to see it here.")
120120
} actions: {
121121
Button("Show Create Controls", systemImage: "sidebar.left", action: onCreateDesign)
122122
.buttonStyle(.borderedProminent)
@@ -128,7 +128,7 @@ public struct DesignLibraryView: View {
128128
ContentUnavailableView(
129129
"No designs",
130130
systemImage: "square.grid.2x2",
131-
description: Text("Create a prototype, slide deck, or design system to see it here.")
131+
description: Text("Create a prototype, slide deck, animation, or design system to see it here.")
132132
)
133133
.frame(maxWidth: .infinity, minHeight: 360)
134134
.padding(24)

Packages/EaselChat/Sources/EaselChat/EaselAgentInstructions.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ enum EaselAgentInstructions {
2929
- When the project ships a design system, it is the source of truth. Before writing any UI, read its spec at `resources/design-system/DESIGN.md`, then build every screen or slide directly from that system: reuse its exact colors, typography, spacing, radii, effects, and component families instead of inventing an ad-hoc palette, type scale, or component style. If you need a token the system does not define, extend it consistently rather than departing from it.
3030
- For slide deck projects, \(SlideDeckContract.authoringSummary)
3131
- For slide deck creation, \(slideDeckCreationGuidance)
32+
- For animation projects, \(AnimationScaffold.authoringGuidance)
3233
"""
3334

3435
static let codexDeveloperInstructionsPrefix = """
@@ -259,6 +260,10 @@ enum EaselAgentInstructions {
259260
lines.append("Slide deck contract: \(SlideDeckContract.authoringSummary)")
260261
}
261262

263+
if projectKind == .animation {
264+
lines.append("Animation contract: \(AnimationScaffold.authoringGuidance)")
265+
}
266+
262267
if projectKind == .prototype, let projectFidelity {
263268
lines.append("Current prototype fidelity: \(projectFidelity.displayName)")
264269
lines.append("The prototype fidelity contract specializes the bundled frontend skill. When the two differ, follow this fidelity contract for process, polish level, breadth, visual style, and interaction depth.")

Packages/EaselChat/Sources/EaselChat/LocalAgentHandoff/LocalAgentHandoffPromptBuilder.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ enum LocalAgentHandoffPromptBuilder {
4444
case .slideDeck:
4545
lines.append("Current project type: \(project.kind.displayName)")
4646
lines.append("Slide deck contract: \(SlideDeckContract.authoringSummary)")
47+
48+
case .animation:
49+
lines.append("Current project type: \(project.kind.displayName)")
50+
lines.append("Animation contract: \(AnimationScaffold.authoringGuidance)")
4751
}
4852

4953
if project.designSystem.kind == .custom {

Packages/EaselChat/Sources/EaselChat/ProjectTemplateAssets/Animation/vendor/babel.min.js

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)